Context for AI
Read a page
Give your model live web context. Hand the API a URL and get back clean, LLM-ready markdown. Hardened sites that block bots are handled automatically, and you are billed whenever a fetch is dispatched, whether or not it returns usable content.
Scrape a URL
Fetches a single page, strips navigation and boilerplate, and returns the main content as markdown, HTML, or plain text.
/v1/scrapeParameters
urlstringrequiredThe absolute http(s) URL to fetch. Private, loopback, and internal addresses are rejected.
formatstringOutput format: markdown (default), html, or text.
stealthboolean | "auto"Controls the anti-bot rail. false (default) uses the fast standard rail only. "auto" starts standard and automatically escalates to the stealth rail if the site blocks the request or returns no content. true goes straight to stealth.
timeout_msintegerStandard-rail timeout in milliseconds (1000–60000, default 30000). Stealth unlocking is allowed longer since it renders the full page.
Request
curl https://api.apexapi.dev/v1/scrape \
-H "Authorization: Bearer ak-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/pricing",
"format": "markdown",
"stealth": "auto"
}'Response
{
"url": "https://example.com/pricing",
"final_url": "https://example.com/pricing",
"status": 200,
"format": "markdown",
"content": "# Pricing\n\nSimple pricing for every team...",
"metadata": {
"title": "Pricing - Example",
"description": "Simple pricing for every team.",
"language": "en"
},
"tier": "standard",
"cost": 0.002
}The tier field tells you which rail served the page and therefore what you were charged. The response also carries X-ApexApi-Cost and X-ApexApi-Credits-Remaining headers.
Pricing
Billed at the price of whichever rail actually served (or attempted) the fetch. Only requests rejected before any fetch is dispatched, an invalid or disallowed URL, are free.
| Tier | When | Price / page |
|---|---|---|
| Standard | Plain fetch, most sites | $0.002 |
| Stealth | Anti-bot / JS render, hardened sites | $0.008 |
With stealth: "auto" you pay the standard price whenever the fast rail succeeds, and only pay the stealth price on pages that actually required unlocking.
Billing on failures
A request is billed whenever the fetch is dispatched to a rail, even if that fetch does not succeed. That includes a page that blocks the request, a target that is unreachable, and a page that returns HTTP 200 with no readable content to extract. Each of these reached the vendor and is billed at that rail's price.
Requests rejected before dispatch, such as an invalid, private, or disallowed URL, never reach a rail and are not billed.
Notes & limits
- • Requests to private, loopback, or internal network addresses are rejected with a
400. - • The API respects each site's
robots.txtby default; disallowed URLs return a403. - • Use of this endpoint is subject to our Acceptable Use Policy. You are responsible for the URLs you submit and how you use the results.
- • Need a whole site instead of one page? Use
/v1/crawlto crawl a domain into markdown asynchronously.