POST /v2/scrape · selectors
Typed fields from a page by CSS, XPath, regex or JSONPath — no LLM
When you know where the data sits, name the fields and the selectors that find them. The same JSON comes back every time, in milliseconds, for 1 credit a page — no model, no tokens, no guessing.
- Endpoint
POST /v2/scrape · selectors- Mode
- Synchronous (a scrape format) · also in crawl and batch jobs
- Credits
- 1 per page — no LLM credits
- Also
- formats: [{type: "selectors"}] on
POST /v1/scrape· crawl and batch scrapeOptions · MCP toolengine_scrape(selectors)
What it's for
Listings and catalogues
Name, price and rating of every product on a listing page: one item selector, a few fields, a typed list back.
Embedded JSON and APIs
JSON-LD, Next.js __NEXT_DATA__ or a JSON endpoint read directly with JMESPath — no HTML parsing at all.
The same fields across a whole site
Put the format in a crawl's scrapeOptions and every page answers in the same shape, 1 credit a page.
From a query to selectors
Add "exportPlan": true to a query format: data.queryPlan is the learned plan as a selectors format — run it from then on without an LLM.
How it works
- Fetch
The page is fetched exactly as for a scrape (the same engines, cache and limits).
- Select
Without
itemyou get one object; withitemone object per match, each field read relative to it. Per field: a CSS or XPath selector, then an optional regex on the selected text, then an optional JMESPath on JSON — in that order. - Process
A fixed list of processors shapes the values (number, url, date, map …). No user code, eval or lambda runs anywhere; regular expressions run under a time limit.
- Answer
data.selectorsholds the values. An empty field is named in the warning (field_empty:price, orfield_partial:price:3/20in item mode) — never a silent null; a cap that was hit is named too (items_capped). - Export
A crawl or batch job with a selectors format exports as CSV, JSONL or XML:
GET /v2/crawl/{id}/export?format=csv&explode=selectorswrites one row per item, with the fields as columns.
Selectors, query or json?
| You know… | Use | Credits per page |
|---|---|---|
| where the data sits (a CSS class, an XPath, a JSON path) | the selectors format | 1 — no LLM |
| what you want, not where it is | the query format — the LLM finds the selectors once, then they are cached | 5, then 2 |
| a free-form record from one page | the json format | 5 |
Measured on the books.toscrape.com front page: 20 of 20 books matched exactly, extraction took 9.5 ms (median) — 0 LLM calls, 1 credit.
Request parameters
Full docs →| Field | Type | Default | Description |
|---|---|---|---|
formats[] · selectorsrequired | object | — | {"type": "selectors", "fields": {…}, "item": {…}}. |
fieldsrequired | object | — | Field name → {css | xpath | regex | jsonpath, extract, all, process, source}, up to 200 fields; a field can hold nested fields (up to 6 levels). |
item | object | — | {css | xpath | jsonpath} — one object per match (up to 500); without it, one object for the page. |
css | string | — | CSS with ::text and ::attr(name) (parsel), up to 500 characters. |
xpath | string | — | XPath 1.0. Prefixed extension functions (re:test …) are refused — use regex. |
regex | string | — | On the selected text (after css/xpath) or on the raw source; the first group, else the whole match. Up to 300 characters, time-limited per field. |
jsonpath | string | — | JMESPath (a leading $. is accepted) on source: auto (a JSON body, else __NEXT_DATA__, else the JSON-LD blocks), body, next_data or json_ld. |
extract | string | "text" | For element matches: text, own_text, html, inner_html, href, src (both made absolute) or attr:<name>. |
all | boolean | false | Every match as a list (otherwise the first non-empty value). |
process | array | — | Up to 10 of: strip, clean_ws, lower, upper, first, last, join, number, int, url, date, {"default": …}, {"map": {…}}. |
Inside the selectors format a typo is an error, not a warning: an unknown key or processor, or an invalid selector, answers 400 with the field's path (fields.price.css: invalid CSS selector …) before any page is fetched.
Example request
curl -X POST https://crawl.echolotnews.com/v2/scrape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://books.toscrape.com/",
"formats": [
{
"type": "selectors",
"item": {
"css": "article.product_pod"
},
"fields": {
"title": {
"css": "h3 a::attr(title)"
},
"price": {
"css": ".price_color::text",
"process": [
"strip",
"number"
]
},
"rating": {
"css": "p.star-rating::attr(class)",
"process": [
{
"map": {
"One": 1,
"Two": 2,
"Three": 3,
"Four": 4,
"Five": 5
}
}
]
}
}
}
]
}'import requests
API = "https://crawl.echolotnews.com"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
resp = requests.post(f"{API}/v2/scrape", headers=HEADERS, json={
"url": "https://books.toscrape.com/",
"formats": [
{
"type": "selectors",
"item": {
"css": "article.product_pod",
},
"fields": {
"title": {
"css": "h3 a::attr(title)",
},
"price": {
"css": ".price_color::text",
"process": ["strip", "number"],
},
"rating": {
"css": "p.star-rating::attr(class)",
"process": [
{
"map": {
"One": 1,
"Two": 2,
"Three": 3,
"Four": 4,
"Five": 5,
},
},
],
},
},
},
],
}, timeout=120)
resp.raise_for_status()
for b in resp.json()["data"]["selectors"]:
print(b["title"], b["price"], b["rating"])const API = "https://crawl.echolotnews.com";
const headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" };
const res = await fetch(`${API}/v2/scrape`, {
method: "POST",
headers,
body: JSON.stringify({
"url": "https://books.toscrape.com/",
"formats": [
{
"type": "selectors",
"item": {
"css": "article.product_pod"
},
"fields": {
"title": {
"css": "h3 a::attr(title)"
},
"price": {
"css": ".price_color::text",
"process": [
"strip",
"number"
]
},
"rating": {
"css": "p.star-rating::attr(class)",
"process": [
{
"map": {
"One": 1,
"Two": 2,
"Three": 3,
"Four": 4,
"Five": 5
}
}
]
}
}
}
]
}),
});
const json = await res.json();
json.data.selectors.forEach((b) => console.log(b.title, b.price, b.rating));# 1. Connect once (Claude Code)
claude mcp add --transport http echolot https://crawl.echolotnews.com/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
# 2. Ask in plain words — the agent calls engine_scrape, e.g.
# "List title, price and star rating of the books on books.toscrape.com — no LLM"
# Tool call it makes:
{
"name": "engine_scrape",
"arguments": {
"url": "https://books.toscrape.com/",
"selectors": {
"item": {
"css": "article.product_pod"
},
"fields": {
"title": {
"css": "h3 a::attr(title)"
},
"price": {
"css": ".price_color::text",
"process": [
"strip",
"number"
]
},
"rating": {
"css": "p.star-rating::attr(class)",
"process": [
{
"map": {
"One": 1,
"Two": 2,
"Three": 3,
"Four": 4,
"Five": 5
}
}
]
}
}
}
}
}Example response
{
"success": true,
"data": {
"selectors": [
{ "title": "A Light in the Attic", "price": 51.77, "rating": 3 },
{ "title": "Tipping the Velvet", "price": 53.74, "rating": 1 }
],
"metadata": { "title": "All products | Books to Scrape - Sandbox", "statusCode": 200,
"creditsUsed": 1 }
}
}Response fields
| Field | Type | Meaning |
|---|---|---|
data.selectors | object | array | One value per field — a list of objects with item. |
warning | string | field_empty:<field>, field_partial:<field>:n/m, selector_error:<field>:<reason>, items_capped — what did not match, by name. |
Credits
Pricing →| What | Credits |
|---|---|
| A page with the selectors format (any number of fields) | 1 |
| LLM | 0 — none is called |
| Each page of a crawl or batch job | 1 |
Start with 500 free credits
No card required. Every endpoint, REST and MCP.