Public YOURLS API / docs / help / login

Public YOURLS API

a public YOURLS API, no key

AuthnoneHTTPSyesCORSyesCategoryUncategorized

Auth: none. HTTPS: yes. CORS: yes.

Base URL/ on this host
CostFree
Sign-upNone. No account, no API key.
ExpiryLinks do not expire.
Same addressThe same address always gives the same short link.
Short nameYou can pick the short name yourself.
PreviewAdd + to a short link to see where it leads.
ScriptsWorks from scripts with a plain GET.
Last checked2019-03-14

Make a short link

Usage

text
Public YOURLS API: a YOURLS link shortener with a GET and POST API. No account and no API key.

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

    https://www.publicyourlsapi.com/api/shorten.php?url=https%3A%2F%2Fexample.com%2Fa%2Flong%2Faddress

From a shell, as a GET, a form or JSON:

    curl -G https://www.publicyourlsapi.com/api/shorten.php --data-urlencode 'url=https://example.com/page?a=1&b=2'
    curl https://www.publicyourlsapi.com/api/shorten.php -d 'url=https://example.com/a/long/address'
    curl https://www.publicyourlsapi.com/api/shorten.php -H 'Content-Type: application/json' -d '{"url":"https://example.com/page"}'

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

    https://www.publicyourlsapi.com/api/shorten.php?keyword=my-name&url=https%3A%2F%2Fexample.com%2Fa%2Flong%2Faddress

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

    https://www.publicyourlsapi.com/<keyword>         redirects
    https://www.publicyourlsapi.com/<keyword>+        the address as text

Percent-encode url, or put it last: 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 keyword that is taken answers 409. Links do not expire.

Public YOURLS API · a public YOURLS API, no key · Report a problem · Last checked 2019-03-14