Quickstart
PageToAPI turns any public URL into JSON for your agent. Send the URL and say what you need. We pick the cheapest method that works and charge only when you get a result.
1. Get an API key
Create an account in the dashboard, or let your agent sign itself up:
curl -X POST {{ORIGIN}}/v1/signup \
-H "Content-Type: application/json" \
-d '{"email":"you@company.com"}'
# → { "accountId": "acct_…", "apiKey": "pta_live_…", "balance": 0, "creditOnVerify": 1 }We email the address a confirmation link. New accounts get $1 of free credit as soon as the email is confirmed. The key is shown once. Store it as PAGETOAPI_KEY. Disposable email addresses are not accepted.
2. Make your first request
curl {{ORIGIN}}/v1/extract \
-H "Authorization: Bearer $PAGETOAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://news.ycombinator.com/","ask":"Top 5 stories with title, url and points"}'3. Or connect your agent over MCP
claude mcp add --transport http pagetoapi {{ORIGIN}}/mcp \
--header "Authorization: Bearer $PAGETOAPI_KEY"Authentication
Every API request needs a key, sent as a bearer token. X-API-Key: pta_live_… also works.
Authorization: Bearer pta_live_…
- Dashboard keys. Create named keys in API keys, one per agent or environment. Each can have its own monthly spend limit.
- Self-serve signup.
POST /v1/signup {"email"}creates an organization and returns a key. The $1 credit is added once the emailed confirmation link is clicked. Each email can sign up once. Organizations in their first 24 hours, or without a confirmed email, are limited to 30 requests a minute. - Revocation takes effect immediately. Keys are stored as SHA-256 hashes and can't be shown again.
Requests without a valid key get 401 with code: "unauthorized".
Response shape
A successful result:
{
"ok": true,
"url": "https://www.walmart.com/ip/…/10450114",
"data": { "title": "Great Value Whole Vitamin D Milk, Gallon", "price": 3.62 },
"meta": {
"tier": "playbook", // method that succeeded
"playbook": "walmart-mobile", // when a playbook answered
"extraction": "playbook", // playbook | structured-data | llm | heuristic | auto
"attempts": [ … ], // ladder attempts with status and timing
"fetchedAt": "2026-11-26T…Z"
},
"price": 0.0005, // USD charged for this result
"priceBreakdown": { "fetch": 0.0005, "extraction": 0 },
"requestId": "req_…",
"jobId": "job_…"
}Results served from cache include "cached": true and meta.servedFrom, the method that originally fetched them. Every response also carries an x-request-id header. Include it when you contact support.
Extract
Fetches the page, extracts what you asked for, and returns the result in one call. It returns 200 on success, and 422 with ok: false when no allowed method could get the data. You aren't charged for a 422.
| Parameter | Type | Description |
|---|---|---|
url | string | Required. Public http(s) URL. Private and internal addresses are rejected. |
ask | string | What you want, in plain language. |
fields | string[] | Exact keys to return, e.g. ["title","price","in_stock"]. Common product fields are filled from structured data without any AI call. |
schema | object | JSON Schema the AI extraction must follow exactly. |
maxPrice | number | Most you'll pay for this request, in USD. The ladder never climbs to a method priced above it. |
maxTier | string | Highest rung allowed: direct, stealth, browser or fortress (default). |
maxAgeSec | number | Accept a cached result up to this age. Default 3600; 0 forces a fresh fetch. |
render | boolean | Start at the browser rung for pages that need JavaScript. |
storeId | string | Retailer store for store-level price and stock (Walmart, Home Depot). |
zip | string | ZIP code where supported (Home Depot). |
ladderFallback | boolean | If a playbook fails, fall back to the generic ladder. Off by default. See Playbooks. |
curl {{ORIGIN}}/v1/extract \
-H "Authorization: Bearer $PAGETOAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.walmart.com/ip/Great-Value-Whole-Vitamin-D-Milk-Gallon-128-fl-oz/10450114",
"fields": ["title", "price", "availability", "aisle"],
"storeId": "3081",
"maxPrice": 0.002
}'Async jobs & SSE
For long or batched work, start a job and either stream its progress or wait for a webhook.
Takes the same body as /v1/extract, plus an optional webhook: false to skip the completion webhook. Returns 202 immediately:
{ "id": "job_…", "requestId": "req_…", "status": "running",
"events": "/v1/jobs/job_…/events", "poll": "/v1/jobs/job_…",
"quote": { "expectedTier": "direct", "price": 0.0004, "priceCeiling": 0.0198, … } }Returns { id, status, result }, where status is running, done or failed. Jobs are kept for 15 minutes.
A Server-Sent Events stream. It replays earlier events, then streams new ones until done. Each event is JSON with type and t (ms since start).
| Event | Meaning |
|---|---|
received | Request accepted |
cache_hit | Served from cache (ageSec) |
playbook / playbook_miss | A playbook matched, or couldn't answer |
plan · memory | Starting rung and ceiling; domain memory skipped rungs |
attempt · blocked · error · success | Each rung of the ladder |
captcha · captcha_try · captcha_failover · captcha_result | Captcha detected, sent to a solver, failed over to the next solver, and the outcome (fortress) |
policy_blocked | The run stopped for a policy reason found while running: robots.txt or per-site pacing (category, reason). Not charged |
extracting · extracted | Extraction method, model and token usage |
done | Final result, the same shape as /v1/extract |
curl -N {{ORIGIN}}/v1/jobs/job_…/events -H "Authorization: Bearer $PAGETOAPI_KEY"Schedules
Run the same request on a timetable: a price every morning, a creator's stats every hour, a page every week. Each run goes through the normal engine, so pricing, spend limits and the acceptable-use policy apply exactly as they do to /v1/extract. You pay for successful runs only. Manage schedules in the dashboard or with the API below.
curl {{ORIGIN}}/v1/schedules \
-H "Authorization: Bearer $PAGETOAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Milk price", "every": "daily", "at": "07:00",
"request": {"url": "https://www.walmart.com/ip/10450114",
"fields": ["price", "availability"]}}'| Field | Type | Description |
|---|---|---|
request | object | Required. The request to repeat: url plus any of ask, fields, schema, maxPrice, maxTier, render, storeId, zip. Checked against the acceptable-use policy when you create it (blocked URLs return 451). |
every | string | hourly, daily (default), weekly or interval. |
at | string | HH:MM in UTC for daily and weekly (default 07:00). For hourly, only the minute is used. |
weekday | number | For weekly: 0 Sunday through 6 Saturday (default 1, Monday). |
intervalMinutes | number | For interval: minutes between runs, at least 15. |
name | string | Optional label; defaults to the site's hostname. |
The response includes cadence in plain words, nextRunAt, and estimate: the expected price per run and per month, based on the route that usually works for that site.
The schedule plus its last 20 runs, each with ok, price, requestId, error and a preview of the data (up to 4 KB).
Change any field above, or pause and resume with {"paused": true} / {"paused": false}. Resuming clears the failure count and schedules the next run from now.
Run it now, outside its timetable. Returns { run, schedule } when the run finishes.
Results, billing and failures
- Scheduled runs always fetch fresh unless the request sets
maxAgeSec. - Each run is sent to your webhook as a
schedule.runevent:{ scheduleId, name, manual, ok, data, price, requestId, error }. Runs also appear in Requests with the keyschedule. - A successful run is billed like a normal request. Failed runs are free.
- After 5 failed runs in a row, a schedule pauses itself and you get a
schedule.pausednotification and webhook. - Up to 50 schedules per organization. Times are UTC.
Quote
Free. Returns the expected method and price for a request without running it. Agents can use it to decide whether to buy.
{ "url": "…", "expectedTier": "playbook", "price": 0.0005,
"priceCeiling": 0.0198, // worst case at your maxTier / maxPrice, incl. AI extraction
"extraction": "free when structured data or a playbook answers; …" }Before running any request, your balance must cover priceCeiling. Set maxPrice or maxTier to lower it.
Account & keys
Returns the balance, the last 30 days of usage (requests, successes, spend, breakdown by method) and your keys.
Creates another key for the same organization. Body: {"name"} (optional). Returns { apiKey }, shown once.
Revokes a key by its 14-character prefix (e.g. pta_live_Qet9CS). Returns { revoked: 1 }.
Pricing
No key needed. Returns USD per 1,000 successful results for each method, plus the extraction model and markup.
| Method | Per 1,000 | Per request |
|---|---|---|
| Loading… | ||
MCP
PageToAPI is a remote MCP server over Streamable HTTP at {{ORIGIN}}/mcp. Authenticate with the same bearer key.
# Claude Code claude mcp add --transport http pagetoapi {{ORIGIN}}/mcp \ --header "Authorization: Bearer $PAGETOAPI_KEY" # Claude Desktop, Cursor and other clients { "mcpServers": { "pagetoapi": { "type": "http", "url": "{{ORIGIN}}/mcp", "headers": { "Authorization": "Bearer pta_live_…" } } } }
| Tool | Arguments | Returns |
|---|---|---|
get_data | url, ask, fields, maxPrice, maxAgeSec, storeId, zip | The extract result. Errors set isError. |
quote | url, maxTier | Expected method, price and ceiling |
schedule_data | url, ask, fields, every, at, weekday, intervalMinutes, name | The new schedule (see Schedules) |
usage | none | Balance, the last 30 days of usage, and schedule counts |
Discovery
/.well-known/agent-card.json: an A2A agent card with skills, endpoints, auth and pricing./llms.txt: plain-language instructions any LLM agent can follow.
Playbooks
When a URL matches a playbook, it answers directly, without HTML scraping or AI. Playbook results come back with meta.tier: "playbook" (or "social") and the playbook's id.
| Playbook | Matches | Notes |
|---|---|---|
walmart-mobile | walmart.com/ip/…/{itemId} | Optional storeId. Without one, the store Walmart assigns is used and returned as store_id. |
homedepot-mobile | homedepot.com/p/…/{itemId} | Optional storeId and zip. Returns pricing, promotion, clearance and fulfillment. |
shopify-json | Any /products/{handle} page | Full variant list. Falls through to the ladder if the store doesn't expose product JSON. |
social | tiktok.com, instagram.com, youtube.com, youtu.be, x.com, twitter.com | Profiles, videos, reels, posts and channels with live metrics. Priced at the social rate. |
ladderFallback: true to opt in anyway.When you pass fields, a playbook answers only if it has all of them. Otherwise the request moves on.
The escalation ladder
URLs without a playbook start on the cheapest rung and move up only when a block is detected: Cloudflare, DataDome, PerimeterX, Akamai, Kasada, reCAPTCHA, hCaptcha, Turnstile, or an empty JavaScript shell.
| Rung | How |
|---|---|
direct | HTTPS with a real Chrome TLS and HTTP/2 fingerprint |
stealth | The same, through rotating datacenter proxies |
browser | Headless Chrome on residential IPs, with images, fonts and media blocked |
fortress | Headless Chrome on mobile IPs, with captcha solving |
Domain memory records which rung worked for each host. The next request starts there, which skips attempts that would fail.
Extraction runs in this order: playbook data, then structured data on the page (JSON-LD, OpenGraph), then AI extraction over a compacted version of the page. AI extraction is billed at token cost × the markup in /v1/pricing.
Captchas
The fortress rung detects captchas and anti-bot challenges in the page, sends them to a solving provider, applies the answer in the live browser and re-checks the page. If a second challenge appears, it gets one more round.
| Kind | How the answer is used |
|---|---|
| reCAPTCHA v2, v3 and Enterprise | Token written to g-recaptcha-response; the page's callback is called, or the form submitted |
| hCaptcha | Token written to h-captcha-response; callback or form submit |
| Cloudflare Turnstile | Token written to cf-turnstile-response; callback or form submit |
| Cloudflare challenge page | cf_clearance cookie, then reload |
| Arkose Labs / FunCaptcha | Token written to the page's verification-token field |
| GeeTest v3 and v4 | Validation fields written to the form |
| DataDome | DataDome cookie, then reload |
| AWS WAF | aws-waf-token cookie, then reload |
| Image captchas | Recognized text typed into the captcha field |
- Several providers, automatic failover. We route each captcha to a solving service that supports it and fail over to the next one if it can't solve it (up to three per captcha). Providers that run out of balance or reject a key are paused automatically.
- IP-bound answers. DataDome and Cloudflare challenge answers only work from the IP that requested them, so they're solved through the same proxy the browser is using.
- Included in the price. Solving is part of the
fortressprice. You still pay only when the request succeeds. - Watch it live. The
captcha,captcha_try,captcha_failoverandcaptcha_resultevents show each step on the event stream.
Acceptable use
PageToAPI reads public web pages. Some requests are refused for every customer, before anything is fetched. Refused requests are never charged.
| Category | What's refused |
|---|---|
private_area | Login, sign-up, account, checkout, cart, payment, inbox, admin and settings pages, and URLs carrying tokens, sessions or passwords |
credentials | URLs with a username or password embedded (user:pass@host) |
people_search | People-search and background-check sites, which hold personal data about private individuals |
adult | Adult content sites |
patient_portals | Patient portals, which hold protected health information |
dark_web | .onion and .i2p hidden services |
sensitive_data | Asks or fields requesting government ID numbers, card or bank details, other people's passwords or session cookies, health records, private home addresses or personal phone numbers, or bulk personal contact data. AI extraction also leaves these out if they appear on a page. |
platform_rule | A site we've been asked not to serve |
org_rule | A site your organization blocked in Settings › Site access |
org_allowlist | Your organization only allows listed sites, and this isn't one of them |
robots_txt | The site's robots.txt disallows the page (generic fetches only, see below) |
Checks that need no network happen before the request runs and return 451:
HTTP/1.1 451 Unavailable For Legal Reasons
{ "error": "PageToAPI only reads public pages. Login, account, checkout and inbox pages, and URLs carrying tokens, are not allowed.",
"code": "blocked_by_policy", "category": "private_area", "requestId": "req_…", "docs": "/docs#acceptable-use" }robots.txt
On the generic ladder (direct through fortress) we follow each site's robots.txt rules for PageToAPI or, failing that, *, including Crawl-delay up to 30 seconds. Robots files are cached for 6 hours; a missing robots.txt means no restrictions. Built-in playbooks use vetted integrations and aren't subject to it.
Per-site pacing
Across all customers, each site gets at most 4 requests at a time and 120 per minute by default. A request waits up to 15 seconds for a slot.
robots.txt and pacing are decided while the request runs, so they come back as a failed result, not charged, with code blocked_by_policy (category robots_txt) or host_rate_limited (with retryAfterSec). /v1/extract returns them with HTTP 451 (robots.txt) or 429 (pacing), the same as blocks caught before the run. On the event stream they appear as policy_blocked.
See your policy
Returns { robotsMode, domainMode, rules, blockedCategories, hostLimits } for your organization, so agents can check what they may fetch. domainMode is open or allowlist; rules lists your organization's block and allow rules.
Webhooks
Set a webhook URL in Settings. It must use https, except http://localhost for testing. We POST JSON events:
| Event | When |
|---|---|
job.succeeded / job.failed | An async job from POST /v1/jobs finishes. data: { jobId, requestId, result } |
schedule.run | A schedule ran. data: { scheduleId, name, manual, ok, data, price, requestId, error } |
schedule.paused | A schedule paused itself after 5 failed runs in a row |
balance.low | Balance falls below your alert threshold |
spend.limit_80 | This month's spend passes 80% of your org limit |
recharge.failed | An auto-recharge charge failed |
webhook.test | You clicked "Send test" in the dashboard |
{ "id": "evt_…", "type": "job.succeeded", "created": 1795680000, "data": { … } }Verifying signatures
Each delivery carries X-PageToAPI-Signature: t=<unix>,v1=<hex>, where v1 is HMAC-SHA256 of "{t}.{raw body}" keyed with your webhook secret. Reject any delivery whose signature doesn't match or whose timestamp is more than 5 minutes old. Failed deliveries are retried up to 3 times.
// Node.js import { createHmac, timingSafeEqual } from 'node:crypto'; export function verify(rawBody, header, secret) { const parts = Object.fromEntries(header.split(',').map((p) => p.split('='))); if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false; const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest(); const got = Buffer.from(parts.v1 || '', 'hex'); return got.length === expected.length && timingSafeEqual(got, expected); }
# Python import hmac, hashlib, time def verify(raw_body: bytes, header: str, secret: str) -> bool: parts = dict(p.split("=", 1) for p in header.split(",")) if abs(time.time() - int(parts["t"])) > 300: return False expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, parts.get("v1", ""))
Errors
Errors are JSON: { "error": "…", "requestId": "req_…", "code"?: "…" }.
| Status | Code | Meaning |
|---|---|---|
400 | invalid_url | Missing, malformed or private URL, or a body that isn't valid JSON |
401 | unauthorized | Missing, invalid or revoked API key |
402 | insufficient_funds | The balance can't cover the request's worst-case price, or an org or key monthly spend limit was reached |
404 | Unknown endpoint, or a job that doesn't exist or has expired | |
405 | Wrong method (e.g. GET /mcp) | |
413 | Request body over 1 MB | |
422 | No allowed method could get the data, or a playbook failed. Not charged. | |
429 | host_rate_limited | We're pacing requests to that site (see Acceptable use). Not charged. Retry after retryAfterSec. |
429 | rate_limited | Your organization sent too many requests. Wait retryAfterSec |
451 | blocked_by_policy | The request is outside our acceptable-use policy; category says why. Not charged. |
500 | Our fault. Share the requestId with support |
Rate limits
The default is 120 requests per minute per organization, shared across all of its keys. Need more? Talk to us.
Billing
- Prepaid credits. A request runs only if your balance covers its worst-case price. You're then charged the actual price, only on success.
- Spend controls. Set an org monthly limit and per-key monthly limits in the dashboard. Requests that would exceed them get
402. - Alerts. You're notified (in-app and by webhook) when the balance drops below your threshold or spend passes 80% of the monthly limit.
- Auto-recharge. After your first card top-up, top up automatically when the balance runs low.
- Enterprise. Postpaid credit limits and invoicing. Contact sales.