API
Send an app link to GET /api/link and get the https link back, or send a LinkOpen link and get the app link. No key, no account.
- Works on
- Any language
- Sends
- The app link or the LinkOpen link, to linkopen.app. The API works the answer out from it and stores nothing.
Make a link
Send an app link to GET /api/link and get the https link back as plain text. It follows the same rules as the converter.
| Parameter | Values | Notes |
|---|---|---|
url | required | The app link, up to 2048 characters. URL-encode it; curl’s --data-urlencode does that for you. To read a link back, send link instead. |
mode | auto | manual | auto (the default) opens the app as soon as the link is clicked. manual shows a page with an Open link button first. Links to websites (http, https) always come back as manual. |
format | text | json | text (the default) returns just the link. json returns {"link", "url", "mode"}, where mode is the one the link actually got. |
curl -G https://linkopen.app/api/link \
--data-urlencode 'url=obsidian://open?vault=Notes&file=Projects%2FRoadmap'https://linkopen.app/s/1kAHDkPYC4KYM6PAHAFATmAVlAxhGBSATAGIBKYAhgCYC2pADkAcurl -G https://linkopen.app/api/link \
--data-urlencode 'url=slack://channel?team=T0001&id=C0001' \
-d mode=manual -d format=json{"link":"https://linkopen.app/0/slack%3A%2F%2Fchannel%3Fteam%3DT0001%26id%3DC0001","url":"slack://channel?team=T0001&id=C0001","mode":"manual"}const params = new URLSearchParams({ url: 'obsidian://open?vault=Notes&file=Roadmap' })
const res = await fetch(`https://linkopen.app/api/link?${params}`)
const link = await res.text()Read a link back
Send a LinkOpen link as link instead of url and get the app link inside it. Links on www.linkopen.app and the old shortlink.studio address work too.
| Parameter | Values | Notes |
|---|---|---|
link | required | The LinkOpen link, up to 2048 characters, URL-encoded. Send url or link, not both. |
format | text | json | text (the default) returns just the app link. json returns {"link", "url", "mode"}, where mode says what the link does when clicked. |
mode is ignored here: the link already has one. Website links always read back as manual, since their page asks before it goes on.
curl -G https://linkopen.app/api/link \
--data-urlencode 'link=https://linkopen.app/0/slack%3A%2F%2Fopen'slack://opencurl -G https://linkopen.app/api/link \
--data-urlencode 'link=https://linkopen.app/s/1kAHDkPYC4KYM6PAHAFATmAVlAxhGBSATAGIBKYAhgCYC2pADkA' \
-d format=json{"link":"https://linkopen.app/s/1kAHDkPYC4KYM6PAHAFATmAVlAxhGBSATAGIBKYAhgCYC2pADkA","url":"obsidian://open?vault=Notes&file=Projects%2FRoadmap","mode":"auto"}Errors
A request LinkOpen can’t make a link from, or read one from, gets status 400 and a short message, as plain text, or as {"error": "…"} with format=json. The messages:
url is missingurl is longer than 2048 charactersurl must start with a scheme, like obsidian:, for stray text such as a note titlejavascript: links are not allowed, and the same fordata:andvbscript:mode must be auto or manualformat must be text or json, always as plain textsend url or link, not bothlink is longer than 2048 characterslink is not a LinkOpen link, for any other address, and for a LinkOpen link whose page would say it’s broken
curl -G https://linkopen.app/api/link \
--data-urlencode 'url=Roadmap' -d format=json{"error":"url must start with a scheme, like obsidian:"}CORS and caching
Responses send Access-Control-Allow-Origin: *, so a web page on any site can call the API with fetch. Successful responses may be cached for a day. The API doesn’t save the links it’s sent; the answer is worked out on each request.
The API is described in OpenAPI 3.1 at /openapi.json, for GPT actions, automation platforms and API catalogs. The app link formats from the URL scheme list are at /schemes.json.
curl -sS -D - -o /dev/null -G https://linkopen.app/api/link \
--data-urlencode 'url=slack://open' | grep -iE '^(access-control|cache-control)'access-control-allow-origin: *
cache-control: public, max-age=86400