motd: last touched 2025-03-02. be nice to the server.
get a short link from the command line
$ curl in, short link out.
$ uptime
14:02:11 up 412 days, 3:08, 1 user, load average: 0.00, 0.01, 0.05
$ cat usage.txt
YOURLS Get: a free URL shortener. No sign-up and no API token.
Make a link. The answer is the short link on one line:
https://www.yourlsget.com/?url=https://example.com/a/long/address
From a shell:
curl -G https://www.yourlsget.com/shorten --data-urlencode 'url=https://example.com/page?a=1&b=2'
curl https://www.yourlsget.com/shorten -d 'url=https://example.com/a/long/address'
Pick the short name yourself, 1 to 64 letters, digits, - or _:
https://www.yourlsget.com/?alias=my-name&url=https://example.com/a/long/address
As JSON:
https://www.yourlsget.com/?format=json&url=https://example.com/a/long/address
curl https://www.yourlsget.com/shorten -H 'Accept: application/json' -d 'url=https://example.com/page'
Follow a link, or see where it leads without going there:
https://www.yourlsget.com/<code> redirects
https://www.yourlsget.com/<code>+ the address as text
https://www.yourlsget.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.
append + to any short link to see where it leads. works from scripts with a plain GET.