Fetch
Fetch and extract content from URLs
Fetches web pages, renders JavaScript-heavy pages when needed, and returns clean extracted content in your preferred format. Submit up to 10 URLs, get back structured content. Per-URL failures appear in errors[] and do not fail the entire request.
Per-URL error codes (in errors[].error):
- target_http_error — target server returned a non-2xx HTTP status other than 404/410; the raw status code is in errors[].status
- page_not_found — target URL returned HTTP 404 or 410; the raw status code is in errors[].status
- target_unreachable — connection refused, TLS failure, DNS failure, or other network error
- timeout — request timed out
- proxy_error — proxy tunnel failure
- bot_blocked — bot-challenge page detected (Cloudflare, etc.)
- empty_content — page loaded but no extractable text was found
- login_required — the target redirected to a login or account wall; retrying without credentials will not help
- content_too_large — the document exceeds the 20MB size limit for generic documents (PDF and CSV have their own 50MB budgets); not retried in the browser
- invalid_url — malformed URL or SSRF-blocked address
- invalid_redirect_url — redirect target rejected before fetch
- conditional_unsupported — conditional requests (if_none_match / if_modified_since) are supported on the fast path only; this URL requires browser rendering
- selector_not_matched — no elements matching any include_selectors entry remained after exclude_selectors was applied; the error carries unmatched_selectors plus candidate_selectors retry hints (a partial miss is not an error — it's reported on the result's unmatched_selectors)
- selector_unsupported — include_selectors / exclude_selectors sent for a URL that resolves to a direct PDF/CSV download (no HTML to scope)
post/fetch
Request
- Base URL: https://api.fetch.tinyfish.ai
- URL: https://api.fetch.tinyfish.ai/fetch
- Auth: API key in header X-API-Key
Request body
Example request
{
"urls": [
"https://example.com",
"https://example.org"
],
"purpose": "Compare pricing tiers across vendors for a procurement report",
"format": "markdown",
"per_url_timeout_ms": 45000,
"if_none_match": "W/\"abc123\"",
"if_modified_since": "Wed, 21 Oct 2015 07:28:00 GMT",
"include_etag_and_last_modified": true,
"include_selectors": [
"article"
],
"exclude_selectors": [
".comments",
".newsletter-signup"
]
}Response
Fetch completed. Check errors[] for any per-URL failures.
Example response
{
"results": [
{
"url": "https://example.com",
"final_url": "https://www.example.com",
"title": "Example Domain",
"description": "This domain is for use in illustrative examples.",
"language": "en",
"format": "markdown",
"author": "John Doe",
"published_date": "2024-01-15",
"page_metadata": {
"canonical": "https://example.com",
"robots": "max-image-preview:large",
"og": {
"title": "Example Domain",
"image": [
"https://example.com/og.png"
]
},
"twitter": {
"card": "summary_large_image"
}
},
"latency_ms": 1183.4,
"not_modified": true,
"etag": "W/\"abc123\"",
"last_modified": "Wed, 21 Oct 2015 07:28:00 GMT",
"unmatched_selectors": [
"aside.related"
]
}
],
"errors": [
{
"url": "https://invalid.example.com",
"error": "target_http_error",
"status": 404,
"unmatched_selectors": [
"article",
"#content"
],
"candidate_selectors": [
"main",
"nav",
"#content"
]
}
],
"request_id": "8f9dba20-e37b-4749-a919-2269e28b4a2c"
}Changes
No recorded changes to this operation across all 1 revision of this API.