tinyx402

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 USDT

One 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

FieldType
urlsstring[]Required. 1–10 URLs.
formatmarkdown | html | jsonDefault markdown.
purposestringWhy you are fetching. Max 2000 chars.
links / image_links / iframe_linksbooleanAlso return outbound, image or iframe URLs.
page_metadatabooleanReturn canonical, Open Graph, Twitter and robots metadata.
ttlintegerCache freshness tolerance in seconds. 0 forces a live fetch. Omit to accept any cached entry.
per_url_timeout_msinteger1–110000.
include_selectors / exclude_selectorsstring[]CSS scoping, up to 20 each. exclude is applied first.
if_none_match / if_modified_sincestringConditional fetch, single URL only. Gives not_modified: true when nothing changed.
include_etag_and_last_modifiedbooleanReturn 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.