API reference

Link preview

1 endpoint, served at https://orbitwrite.com/api/v1. Each one lists the credentials it accepts, its parameters and every response it can give.

Read Open Graph metadata for a URL#

POST/api/v1/link-preview

Fetches a public URL and returns its Open Graph / Twitter card metadata for rendering a link preview. Private, loopback and non-HTTP addresses are rejected.

Authentication

An API key or OAuth access token as a bearer token, or a signed-in session.

Body application/json

urlstringRequired

Format uri.

Responses

200object

Metadata for the URL

Response attributes
previewLinkPreviewRequired
Child attributes
urlstringRequired

The URL the metadata was read from, after redirects — may differ from the requested one.

titlestring | nullRequired
descriptionstring | nullRequired
imagestring | nullRequired
siteNamestring | nullRequired
typestringRequired

video when the page advertises video content (og:type, a Twitter player card, or a known video host), article otherwise. Drives the player-card layout in the composer.

  • "video"
  • "article"
400Error

Invalid request

Response attributes
errorstringRequired
issuesany[]
401Error

Not signed in

Response attributes
errorstringRequired
issuesany[]
429Error

Rate limit exceeded

Response attributes
errorstringRequired
issuesany[]
POST /api/v1/link-preview
curl -X POST "https://orbitwrite.com/api/v1/link-preview" \
  -H "Authorization: Bearer $ORBITWRITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com"
}'
Response
{
  "preview": {
    "url": "string",
    "title": "string",
    "description": "string",
    "image": "string",
    "siteName": "string",
    "type": "video"
  }
}