Extract
POST/api/extract reads a page and uses AI to return structured JSON — either a default summary, or whatever shape you describe in a prompt. Metered by the AI tokens used; requires an API key. This endpoint is live.
Request body
urlstringrequired
The URL to extract from.
promptstring
Optional. Describe the JSON you want (e.g. pricing tiers as a list of name + price). Alias:
instruction. Omit for a default { title, summary, topics, entities }.Example request
curl -X POST https://synoppy.com/api/extract \
-H "Authorization: Bearer $SYNOPPY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://news.ycombinator.com",
"prompt": "Return { title, summary, topics }"
}'Response
{
"success": true,
"url": "https://news.ycombinator.com",
"model": "synoppy-extract-1",
"data": {
"title": "Hacker News",
"summary": "Community news on startups, tech and code.",
"topics": ["startups", "programming", "AI"],
"entities": ["Y Combinator"]
},
"usage": { "inputTokens": 1842, "outputTokens": 96 },
"latencyMs": 8206,
"creditsUsed": 6,
"creditsRemaining": 4994
}The underlying model is an internal detail with automatic failover; responses always report the engine as synoppy-extract-1.
Response fields
successboolean
True when extraction succeeded.
urlstring
The URL that was read.
modelstring
Always "synoppy-extract-1" — the engine name (the provider is abstracted, with automatic failover).
dataobject
The structured result. With no prompt it's a default
{ title, summary, topics, entities }; with a prompt it matches the shape you describe.usage{ inputTokens, outputTokens }
Token counts for the call — the basis for the metered credit cost.
latencyMsnumber
End-to-end time in milliseconds (AI calls are slower than static reads).
creditsUsednumber
Credits charged — metered by the AI tokens used, so cost scales with page size and output.
creditsRemainingnumber
Your credit balance after this call.
In code
import { Synoppy } from "@synoppy/sdk";
const synoppy = new Synoppy({ apiKey: process.env.SYNOPPY_API_KEY });
const res = await synoppy.extract("https://stripe.com/pricing", {
prompt: "Return plans as a list of { name, monthlyPrice }",
});
console.log(res.data);