Shtn API

GET requests

Generating shortened URL

Make a GET request to https://shtn.pw/api/generate?url=URL HERE

For example: https://shtn.pw/api/generate?url=example.com

It will return the shortened URL. Example: https://shtn.pw/abcdef

Resolving a code

Make a get request to https://shtn.pw/api/resolve?code=CODE HERE

For example: https://shtn.pw/api/resolve?code=abcdef

It will return the resolved URL. Example: http://example.com/abcdef

Getting clicks

Make a get request to https://shtn.pw/api/clicks?code=CODE HERE

For example: https://shtn.pw/api/clicks?code=abcdef

It will return all clicks as a number.

JSON

You can fetch codes data in JSON:
Make a get request to https://shtn.pw/json/CODE HERE

https://shtn.pw/json/abcdef should get you:

{ "code": "abcdef", "url": "http://example.com", "clicks": 30 }