TLS API

Tudedude's Link Shortener features full API support, allowing you to implement link shortening services into the service of your choice!

The API can be accessed via HTTP GET requests, and responds with JSON information. There is currently a rate limit of 5 requests per second. If you would like to expand the rate limit for your scripts, there will soon be an account system, allowing you to register API keys with larger allowances. If you would like special allowance in the meantime, please e-mail me at me@tudedude.me

To access the API, send a GET request to the endpoint at https://asf.pw/api.php. For more information, select an operation from the sidebar.

Create Links
To create a link with the API, send a GET request to https://asf.pw/api.php?action=create.
Arguments
Field Values Description Required
link String This argument is the link to redirect the shortened link to. Yes
hash String The short URL to use for the shortened link. May not be longer than 32 characters or use characters other than a-z, A-Z and 0-9, as well as _+-.,!. Yes
domain Specific String This argument specifies which domain the link should be under. It must be one of the following strings: asf.pw, 2meirl4.me,tdls.wtf, sht.wtf,hotdamn.cam, or jointhe.murdersuicide.club. If a domain is not specified, it will default to asf.pw. No
Sample Responses
Successful Creation

Upon successful link creation, the returned JSON object will have fields containing the hash that was entered into the database, the domain it was entered under, and an error field, set to false.

https://asf.pw/api.php?action=create&hash=short&link=https://tudedude.me
HTTP/1.0 200 OK
{"error":"false","hash":"short","domain":"asf.pw"}
Missing Required Field

If an API request is missing a required field, such as the hash or link, the returned JSON object will contain an "error" field set to true, as well as an "errorMessage" field containing the human-readable error message specifying what field is missing.

https://asf.pw/api.php?action=create&hash=short
HTTP/1.0 200 OK
{"error":"true","errorMessage":"Link unspecified","field":"link"}
https://asf.pw/api.php?action=create&link=https://tudedude.me
HTTP/1.0 200 OK
{"error":"true","errorMessage":"Link hash unspecified","field":"hash"}
Hash In Use

If a link is attempted to be created with a hash that is already in use, the returned JSON object will contain an "error" field set to true, as well as an "errorMessage" field containing a human-readable error message notifying the user that the hash is already in use.

https://asf.pw/api.php?action=create&hash=Tudedude&link=https://tudedude.me
HTTP/1.0 200 OK
{"error":"true","errorMessage":"That name is not available","field":"hash"}
API Rate Limit

Until the implementation of the upcoming API key & developer account system, API requests are rate-limited to 30 requests per minute per IP. This is measured by checking against all requests within the last 60 seconds, at the time of request. Exceeding this rate limit will simply result in your requests being filtered out until you have space for more requests. No permanent action will be taken unless abuse is detected. The JSON object will have an "error" field set to true, as well as an "errorMessage" field containing a human-readable error message notifying the user that your requests are currently being sent too fast. The server will also return a 429 request.

https://asf.pw/api.php
HTTP/1.0 429 Too many requests
{"error":"true","errorMessage":"You are forbidden from acessing this page [429 Too many requests]","field":"null"}
Get Link Info
To retrieve link info with the API, send a GET request to https://asf.pw/api.php?action=info.
Arguments
Field Values Description Required
hash String The hash of the link to retrieve info for. Yes
domain Specific String This argument specifies which domain the link should be under. It must be one of the following strings: asf.pw, 2meirl4.me,tdls.wtf, sht.wtf,hotdamn.cam, or jointhe.murdersuicide.club. If a domain is not specified, it will default to asf.pw. No
Sample Responses
Successful Search

With a successful link search, the returned JSON object will have an "error" field, set to false, a "hash" field with the hash of the link returned, a "link" field with the link the hash points to, a "time" field with the timestamp that the link was created, and a "visits" field with the number of times the link has been visited.

https://asf.pw/api.php?action=info&hash=Tudedude
HTTP/1.0 200 OK
{"error":"false","hash":"Tudedude","link":"https://tudedude.me","time":"2017-02-26 07:13:36","visits":"3"}
Link Not Found

If an API request specifies a link hash that does not exist, or fails to specify the correct domain, the returned JSON object will have an "error" field, set to true, and an "errorMessage" field with the human-readable error message notifying the user that the link was not found.

https://asf.pw/api.php?action=info&hash=Tudedudee
HTTP/1.0 200 OK
{"error":"true","errorMessage":"Link not found"}
Missing Required Field

If an API request is missing a required field, the returned JSON object will contain an "error" field set to true, as well as an "errorMessage" field containing the human-readable error message specifying what field is missing.

https://asf.pw/api.php?action=info
HTTP/1.0 200 OK
{"error":"true","errorMessage":"Link hash unspecified"}