shrtcode API Documentation


API Base

https://api.shrtco.de/v2/

All API Methods support GET and POST Requests.



Authentication

This API doesn't require any Authentication.



Rate Limits

The number of request is limited to 1 requests per second, per IP address.



Terms of use

By using our API you agree to our terms of service. The API is based on a fair-use policy.



Errors

All unsuccessful API calls return an error message along with an error_code. See the table below to learn more about the meaning of each error_code:


error_code Error
1 No URL specified ("url" parameter is empty)
2 Invalid URL submitted
3 Rate limit reached. Wait a second and try again
4 IP-Address has been blocked because of violating our terms of service
5 shrtcode code (slug) already taken/in use
6 Unknown error
7 No code specified ("code" parameter is empty)
8 Invalid code submitted (code not found/there is no such short-link)
9 Missing required parameters
10 Trying to shorten a disallowed Link. More information on disallowed links


Shortening a Link

/shorten

Create a short link for a given URL. Requires a `url` parameter.


Example

GET/POST: https://api.shrtco.de/v2/shorten?url=example.org/very/long/link.html

Response

{
  "ok": true,
  "result": {
      "code": "KCveN",
      "short_link": "shrtco.de/KCveN",
      "full_short_link": "https://shrtco.de/KCveN",
      "short_link2": "9qr.de/KCveN",
      "full_short_link2": "https://9qr.de/KCveN",
      "share_link": "shrtco.de/share/KCveN",
      "full_share_link": "https://shrtco.de/share/KCveN",
      "original_link": "http://example.org/very/long/link.html"
  }
}


Getting information on a Link

/info

Get the long link of a shortened link and much more. Requires a `code` parameter containing a shrtcode code. The code is the last part of a short link. Example short link: shrtco.de/example -> Code: "example"


Example

GET/POST: https://api.shrtco.de/v2/info?code=example

Response

{
  "ok": true,
  "result": {
        "code": "example",
        "url": "http://www.example.com/",
        "password_protected": false,
        "blocked": false,
        "created": "2018-05-17 16:46:29"
    }
}


Contact

If you need help using this API, have feature request or want to have extended functionality (e.g. custom domains and/or custom short-links), feel free to contact us via email:

[email protected]