# Polymorphism Open Graph preview API — spec 1.7.0 # Reference: https://www.poly.io/social-card-preview/api/ # # Open this file in VS Code (REST Client) or a JetBrains IDE and run either request. # Every response is HTTP 200. Branch on the `ok` field, never on the status code. @baseUrl = https://api.poly.io @url = https://example.com ### Preview a URL GET {{baseUrl}}/og?url={{url}} ### Preview a URL, identified — 2,000 a day instead of 500, no key and no signup GET {{baseUrl}}/og?url={{url}} x-og-contact: you@example.com ### Check your allowance. Checking does not spend any of it GET {{baseUrl}}/og/quota # Every parameter the preview endpoint takes: # url — The page to inspect, http or https. URL-encode it. Required unless site is given. Repeat it, up to 5 times, to check several pages in one request: the answer is then a batch, with one result per url in the order asked. # site — An origin instead of url. Reads the sitemap, clusters URLs by shape and returns a plan of one representative page per template. With a path (example.com/blog/), or /* for the whole site, the plan is the sitemap's pages under it, and under.urls lists up to 1,000 of them. # cap — With site, the longest plan to return. Clamped 1–100, default 40. # ua — Fetch as a named platform crawler: facebook, x, linkedin, slack, discord or browser. Defaults to our own crawler. # fresh — Set to 1 to bypass the five-minute cache. For the deploy-check-fix-recheck loop, where the re-check otherwise lands inside the window and reports the state before your fix. Costs a quota unit like any request. # contact — An email or URL identifying you; raises the daily allowance. The x-og-contact header is preferred. # key — An API key. The x-og-key header is preferred — a key in a query string ends up in logs and Referer headers.