Public Link API
Documentation / Getting started Suggest Edits

Public Link API

a link API for everybody

Docs, a console, no keys.

Make a link

Usage

Public Link API: a free URL shortener. No sign-up and no API token.

Make a link. The answer is JSON and the short link is in "shorturl":

    https://www.publiclinkapi.com/api/v2/action/shorten?url=https://example.com/a/long/address

From a shell:

    curl -G https://www.publiclinkapi.com/api/v2/action/shorten --data-urlencode 'url=https://example.com/page?a=1&b=2'
    curl https://www.publiclinkapi.com/api/v2/action/shorten -d 'url=https://example.com/a/long/address'

Pick the short name yourself, 1 to 64 letters, digits, - or _:

    https://www.publiclinkapi.com/api/v2/action/shorten?alias=my-name&url=https://example.com/a/long/address

As one line of text:

    https://www.publiclinkapi.com/api/v2/action/shorten?format=text&url=https://example.com/a/long/address

Follow a link, or see where it leads without going there:

    https://www.publiclinkapi.com/<code>         redirects
    https://www.publiclinkapi.com/<code>+        the address as text
    https://www.publiclinkapi.com/<code>.json    the address and when the link was made

Put url last, or percent-encode it: an address written out as it is
runs to the end of the line, with its own ? and & in it.

The same address gives the same short link every time, unless you name
it yourself. A name that is taken answers 409. Links do not expire.

Try It

GET/api/v2/action/shorten

No key in the header, no body to send. A plain GET is the whole request.

Response

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8

publiclinkapi.com/k3x9

Parameters

format
html, sent by this form
url
the address to shorten
alias
a short name you pick, optional
© 2016 Public Link API. Support
Powered by Pagehorn Free Plan