Fetch
POST /v1/fetch
Fetch one or more web pages and extract their text content. Served by Exa or Tavily; pin X-Quantized-Provider to choose. Consensus is search-only and cannot serve this endpoint — pinning it returns a 400.
Without X-Quantized-Provider, the router picks among the fetch providers your license can reach, preferring your institution’s own provider keys, then the providers marked as default for your institution, and picks randomly among ties. Pin X-Quantized-Provider when you need a repeatable provider.
Headers
| Header | Required | Description |
|---|---|---|
Authorization |
Yes | Bearer <api-key-or-jwt> |
Content-Type |
Yes | application/json |
X-Quantized-Provider |
No | Pin a provider by slug (exa or tavily), or one specific connection as <provider>/<connection>. The pin narrows the providers your license allows and never widens them. A malformed value or a disallowed provider returns 400. |
X-Quantized-Metadata |
No | A flat JSON object of scalar values, recorded with the request for your own attribution. Invalid JSON or nested values return 400. See Authentication. |
Request body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
urls |
array of strings | Yes | — | List of URLs to fetch. At least one; blank or whitespace-only strings are rejected |
include_text |
boolean | No | true | Whether to include extracted text content |
Unlike /v1/web-search, fetch has no max_characters: text is returned
in full, and a single page can exceed 140,000 characters.
Examples
curl -X POST https://api.quantized.us/v1/fetch \
-H "Authorization: Bearer sk-quantized-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": ["https://docs.python.org/3/whatsnew/3.13.html"],
"include_text": true
}'
import httpx
response = httpx.post(
"https://api.quantized.us/v1/fetch",
headers={"Authorization": "Bearer sk-quantized-YOUR-KEY"},
json={
"urls": [
"https://docs.python.org/3/whatsnew/3.13.html",
"https://example.com/article",
],
"include_text": True,
},
timeout=30,
)
data = response.json()
for result in data["results"]:
print(f"[{result['status']}] {result['url']} {result['title']}")
if result["status"] == "success" and result["text"]:
print(result["text"][:200])
Response
{
"results": [
{
"url": "https://docs.python.org/3/whatsnew/3.13.html",
"title": "What's New in Python 3.13",
"text": "This article explains the new features in Python 3.13...",
"status": "success"
},
{
"url": "https://example.com/article",
"title": "Example Article",
"text": "Article content extracted as clean text...",
"status": "success"
}
],
"usage": {
"credits_used": 80000
}
}
Response fields
| Field | Type | Description |
|---|---|---|
results |
array | One entry per requested URL |
results[].url |
string | The requested URL |
results[].title |
string or null | Page title |
results[].text |
string or null | Extracted text content |
results[].status |
string or null | Fetch status (e.g., "success") |
usage.credits_used |
integer | Micro-credits consumed |
Each URL in the results has its own status. Some URLs may fail (e.g., pages behind paywalls or with anti-bot protection) while others succeed in the same request.
Errors
| Status | Code | Condition |
|---|---|---|
400 |
invalid_request |
Request body failed validation: a missing or invalid field, or an unrecognized field — for example a missing or empty urls, or a blank URL string. param names the field |
400 |
invalid_request |
Malformed X-Quantized-Provider header (param: "X-Quantized-Provider") |
400 |
invalid_metadata_header |
Invalid X-Quantized-Metadata header |
400 |
invalid_request |
The fetch provider rejected the request (the provider’s message is passed through) |
400 |
no_provider_available |
No provider available for the request — including a pin your license doesn’t allow, or X-Quantized-Provider: consensus |
401 |
missing_api_key, invalid_api_key, api_key_expired, license_inactive |
Missing, invalid, or expired API key, or an inactive license |
402 |
budget_exhausted |
Your license is out of budget. metadata names the limit that blocked the request |
403 |
policy_denied |
Your license’s policy does not allow this service or parameter value (param names the parameter) |
403 |
content_policy_violation |
Request blocked by a guardrail |
404 |
model_not_found |
The fetch provider reported the resource as not found |
429 |
rate_limit_exceeded |
The fetch provider rate-limited the request. retry-after is set when the provider sent one |
500 |
internal_error |
Unexpected error, or a budget configuration error |
502 |
provider_error |
The provider returned a 5xx or an invalid response, or the connection dropped |
503 |
provider_misconfigured |
Our credentials for the fetch provider are missing or were rejected, or our plan’s limit with the provider was reached |
503 |
policy_unavailable |
Your license’s policy can’t be evaluated |
504 |
upstream_timeout |
The provider timed out |
Every error uses the standard error body. Branch on the status and code; see the Error reference for each.