Endpoints
Extract
A JSON schema or a named template, and up to 100 URLs in, rows out — pricing tables, spec sheets, job listings.
POST
/v1/extract
Request
Send a JSON body with a URL (or a list) and any options. The response holds data and what the call cost.
import requestsr = requests.post( 'https://api.snoopscan.com/v1/extract', headers={'Authorization': 'Bearer sk_YOUR_KEY'}, json={ 'urls': [ 'https://example.com/pricing' ], 'schema': { 'type': 'object', 'properties': { 'plan': { 'type': 'string' }, 'price': { 'type': 'number' } } }, 'prompt': 'The cheapest paid plan' },)print(r.json())
const r = await fetch('https://api.snoopscan.com/v1/extract', { method: 'POST', headers: { Authorization: 'Bearer sk_YOUR_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ "urls": [ "https://example.com/pricing" ], "schema": { "type": "object", "properties": { "plan": { "type": "string" }, "price": { "type": "number" } } }, "prompt": "The cheapest paid plan" }),});console.log(await r.json());
curl -X POST https://api.snoopscan.com/v1/extract \ -H 'Authorization: Bearer sk_YOUR_KEY' \ -H 'Content-Type: application/json' \ -d '{ "urls": [ "https://example.com/pricing" ], "schema": { "type": "object", "properties": { "plan": { "type": "string" }, "price": { "type": "number" } } }, "prompt": "The cheapest paid plan"}'
Returns json · in your schema · validated.
Parameters
| Field | Type | Default | What it does |
|---|---|---|---|
urls
required |
array of string | — | The pages to extract from, 1 to 100. Each page gets its own result. |
model
|
object | — | Your own model provider and key. Model calls are billed to your key, at no credit cost. |
prompt
|
string | — | Plain-language guidance on what to pick out, e.g. "the cheapest paid plan". |
schema
|
object | — | Your own JSON Schema for the fields you want. Give this or template, not both. |
scrapeOptions
|
object | — | How each page is fetched: the same options /v1/scrape takes. |
template
|
string | — | A named template instead of a schema — product, article, jobPosting and more. GET /v1/templates lists them with their fields. |
Response
A success returns {"success": true, "data": {…}}. data holds the formats you asked for, the page's metadata, and a cost object with what the call was charged. A failure returns {"success": false, "error": {…}} with an error code. See Errors.
Failed requests are not charged.
Re-reading a page you already fetched, within
maxAge, is free. See Credits for every rate.