Fetch
Clean extracted content from up to 10 URLs in one call. JavaScript-heavy pages are rendered when needed, and PDFs and JSON endpoints work too.
POST
/api/v1/fetch15000 base units · 0.015 USDTOne payment covers the whole batch. Each URL is processed independently, and per-URL failures appear in errors[]. You are charged only if at least one URL succeeds.
Body
| Field | Type | |
|---|---|---|
urls | string[] | Required. 1–10 URLs. |
format | markdown | html | json | Default markdown. |
purpose | string | Why you are fetching. Max 2000 chars. |
links / image_links / iframe_links | boolean | Also return outbound, image or iframe URLs. |
page_metadata | boolean | Return canonical, Open Graph, Twitter and robots metadata. |
ttl | integer | Cache freshness tolerance in seconds. 0 forces a live fetch. Omit to accept any cached entry. |
per_url_timeout_ms | integer | 1–110000. |
include_selectors / exclude_selectors | string[] | CSS scoping, up to 20 each. exclude is applied first. |
if_none_match / if_modified_since | string | Conditional fetch, single URL only. Gives not_modified: true when nothing changed. |
include_etag_and_last_modified | boolean | Return validators so you can replay them later. |
Example
ts
await paidFetch("https://your-domain.com/api/v1/fetch", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
urls: ["https://www.tinyfish.ai/", "https://en.wikipedia.org/wiki/Web_scraping"],
include_selectors: ["article", "main"],
}),
});Response
json
{
"results": [
{
"url": "https://www.tinyfish.ai/",
"final_url": "https://www.tinyfish.ai/",
"title": "TinyFish | Enterprise Web Agent Infrastructure",
"description": "TinyFish provides enterprise infrastructure for AI web agents.",
"language": "en",
"format": "markdown",
"text": "# TinyFish | Enterprise Web Agent Infrastructure\n\n..."
}
],
"errors": []
}If every URL fails, the response is 502 with "error": "all_failed" and the per-URL errors, and nothing is settled.