Fetch a page.
Give the API a URL and retrieve its current page text.
POST
/v1/fetchRequest parameters
| Parameter | What it controls |
|---|---|
urlstring · required | An absolute HTTP or HTTPS URL, up to 2,048 characters. |
text_charsinteger · 1–262144 · default 20000 | Maximum number of extracted text characters to return. |
Make a request
curl -s https://api.ariselabs-search-api.com/v1/fetch \
-H "Authorization: Bearer $ARISELABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.nvidia.com/en-us/",
"text_chars": 20000
}'import httpx, os
r = httpx.post(
"https://api.ariselabs-search-api.com/v1/fetch",
headers={"Authorization": f"Bearer {os.environ['ARISELABS_API_KEY']}"},
json={
"url": "https://www.nvidia.com/en-us/",
"text_chars": 20000,
},
timeout=40,
)
r.raise_for_status()
doc = r.json()
print(doc["status"], doc.get("title"))
print((doc.get("text") or "")[:400])const r = await fetch("https://api.ariselabs-search-api.com/v1/fetch", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ARISELABS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://www.nvidia.com/en-us/",
"text_chars": 20000
}),
});
if (!r.ok) throw new Error(await r.text());
const doc = await r.json();Fetch reads the page now. It does not retrieve a historical version from the search index. Use Search with a cutoff for point-in-time evidence.
Read the result
Check status even when HTTP returns 200. Only ok means text was extracted. The other statuses are blocked_robots, blocked_edge, no_text, invalid_url, timeout, failed.
{
"object": "fetch_result",
"url": "https://example.com/article",
"final_url": "https://example.com/article",
"status": "ok",
"title": "Example article",
"text": "Extracted article text…",
"elapsed_ms": 820,
"usage": {
"credits": 1
}
}Use a key with the web:fetch scope. If an older key does not have it, create a replacement in API keys.
final_url is the address after redirects. Title and publication time may be unavailable. A robots.txt refusal is respected; paywalled content is not previewed.
Pricing
A successful fetch costs 1 credit. A non-ok result is not billed. Read the actual charge in usage.credits.