Skip to content
API reference

API reference

The addresses anyone can call from outside CrowOn, with no account. All of them only read; nothing here posts or changes anything.

The app's own /api/… calls need a signed-in session and are internal, so they aren't listed. A public API for posting, login and more is in preparation.

The example responses are real calls made with a test account.

BASE URL
https://crowon.app
ENDPOINTS
GET  /oembedGET  /embed/{id}GET  /embed.jsGET  /s/p/{id}GET  /s/v/{id}GET  /s/u/{handle}GET  /@{handle}

Authentication

No key or token is needed. Any site can call these (/oembed and /embed.js send Access-Control-Allow-Origin: *).

Only posts that are public to everyone, from people who allow embeds, are shown.

curl
curl "https://crowon.app/oembed?url=https://crowon.app/s/p/p-8f3a21c7d09e"

Errors

/oembed answers errors with an error in JSON.

Codes

404not_found
No such post, it can't be embedded (not public to everyone, embeds off, deleted or hidden), or the address isn't CrowOn's
501json_only
format was something other than json
404
{"error":"not_found"}
501
{"error":"json_only"}

oEmbed

GET /oembed

Returns the embed code for a post or video link (oEmbed 1.0, rich). Discoverable from the <link rel="alternate" type="application/json+oembed"> on share link pages.

Parameters

urlstringRequired
A /s/p/…, /s/v/… or /embed/… link, or the app address /#/p/…
maxwidthinteger
240–540, 540 by default
formatstring
json only

Returns

The embed code (html), the author, and a thumbnail when the post has a photo or video. Cached for an hour.

curl
curl "https://crowon.app/oembed?url=https://crowon.app/s/p/p-8f3a21c7d09e&maxwidth=540"
RESPONSE
{  "version": "1.0",  "type": "rich",  "provider_name": "CrowOn",  "provider_url": "https://crowon.app",  "title": "Morning light at the station.",  "author_name": "Mika Sato",  "author_url": "https://crowon.app/@mika.sato",  "html": "<blockquote class=\"crowon-embed\" data-post=\"p-8f3a21c7d09e\" style=\"max-width:540px;margin:0 auto\"><a href=\"https://crowon.app/s/p/p-8f3a21c7d09e\">View this post on CrowOn</a></blockquote><script async src=\"https://crowon.app/embed.js\"></script><noscript><iframe src=\"https://crowon.app/embed/p-8f3a21c7d09e\" width=\"540\" height=\"640\" style=\"border:0;max-width:100%\" loading=\"lazy\" title=\"CrowOn\"></iframe></noscript>",  "width": 540,  "height": 220,  "cache_age": 3600}

Embed card

GET /embed/{id}

The post as a single card in HTML. On CrowOn, this is the only address another site may put in an iframe.

Parameters

idstringRequired
The post or video ID (in the path)
themestring
light or dark. Follows the viewer's device by default

Returns

The card's HTML. A post that can't be shown returns 404 with a "This post isn't available" card. Cached for a minute.

curl
curl -i https://crowon.app/embed/p-8f3a21c7d09e
RESPONSE
HTTP/1.1 200 OKContent-Type: text/html; charset=utf-8Cache-Control: public, max-age=60Content-Security-Policy: default-src 'none'; … frame-ancestors * <!doctype html><html lang="en"><head>…<title>CrowOn</title>…

Embed script

GET /embed.js

Replaces each blockquote.crowon-embed on the page with an iframe of /embed/{id} and keeps it as tall as the card. Load it once, however many posts the page has.

Parameters

data-postattributeRequired
The post ID
data-themeattribute
light or dark
HTML
<blockquote class="crowon-embed" data-post="p-8f3a21c7d09e" data-theme="dark">  <a href="https://crowon.app/s/p/p-8f3a21c7d09e">View this post on CrowOn</a></blockquote><script async src="https://crowon.app/embed.js"></script>
RESPONSE
HTTP/1.1 200 OKContent-Type: text/javascript; charset=utf-8Cache-Control: public, max-age=86400Access-Control-Allow-Origin: *

Share links

GET /s/p/{id}GET /s/v/{id}GET /s/u/{handle}

The addresses Copy link in the app makes. They return the tags for link previews, and send people who open them to crowon.app.

Posts with a photo get og:image and summary_large_image; videos get og:type video.other and og:video. The preview is in Japanese when the browser is set to Japanese, and English otherwise.

Parameters

/s/p/{id}post
Posts public to everyone, or to anyone with the link
/s/v/{id}video
Shorts videos
/s/u/{handle}profile
Name, bio and profile photo

Returns

HTML with Open Graph and X card tags. Cached for 5 minutes. Anything that can't be shown gets an "isn't available" preview.

curl
curl https://crowon.app/s/p/p-8f3a21c7d09e
RESPONSE
<meta property="og:site_name" content="CrowOn"><meta property="og:title" content="Post by Mika Sato"><meta property="og:description" content="Morning light at the station."><meta property="og:type" content="article"><meta property="og:url" content="https://crowon.app/s/p/p-8f3a21c7d09e"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Post by Mika Sato"><meta name="twitter:description" content="Morning light at the station."><link rel="alternate" type="application/json+oembed" href="https://crowon.app/oembed?url=…"><meta http-equiv="refresh" content="0;url=/#/p/p-8f3a21c7d09e">