{"openapi":"3.1.0","info":{"title":"WebExtract API","version":"1.5.0","contact":{"email":"duckbeijing518@gmail.com","url":"https://webextract.dev"},"x-guidance":"GET /v1/extract?url=<page> returns clean Markdown plus fixed-schema JSON (product/price, tables, article metadata). GET /v1/markdown?url=<page> returns Markdown only and is cheaper. POST with {\"url\": ...} also works. Pay per call with x402 (USDC on Base (recommended), Polygon, Arbitrum One, World Chain, Monad, Avalanche C-Chain or OP Mainnet) or use a prepaid Bearer key. Without a key, payment or X-Billing: free the API answers 402 (reason x402_required). Free tier: send X-Billing: free (or ?free=1), 50 calls/day per IP. Free test integration: X-Billing: x402-testnet or /sandbox/v1/* (Base Sepolia test USDC only). MCP: POST /mcp (50 free calls/day per IP, no header).","description":"Web page to clean Markdown + fixed-schema structured JSON for AI agents. robots.txt respected. Free tier is opt-in: send X-Billing: free (or ?free=1) for 50 calls/day per IP. Requests with no key, no payment and no opt-in get HTTP 402 Payment Required (reason x402_required); X-Billing: x402 does the same explicitly. MCP (/mcp) keeps 50 free calls/day per IP without a header. Credits never expire. No charge on failed fetches (404, timeout, blocked, robots.txt disallowed). Structured JSON at no extra cost: /v1/extract = 1 credit, /v1/markdown = 0.4 credit. If structured fields come back empty, you're only charged the Markdown rate. Prepaid packs $5=1000 calls, $20=5000 calls, $50=15000 calls via https://webextract.dev/#pricing (Authorization: Bearer <key>). Or pay per call without an account via x402 v2: /v1/extract $0.005, /v1/markdown $0.002 in USDC on Base (recommended), Polygon, Arbitrum One, World Chain, Monad, Avalanche C-Chain or OP Mainnet (eip155:8453, eip155:137, eip155:42161, eip155:43114, eip155:10, eip155:480, eip155:143); send the signed payload in the PAYMENT-SIGNATURE header; x402 settles at the quoted price and only when the request succeeds. Sandbox for testing x402 clients: same endpoints under /sandbox/v1/* or with X-Billing: x402-testnet, Base Sepolia (eip155:84532) test USDC only, free test money, rate limited."},"servers":[{"url":"https://api.webextract.dev"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"security":[{"bearer":[]},{}],"paths":{"/v1/extract":{"get":{"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}]},"x-payment":{"protocol":"x402","scheme":"exact","price":"$0.005","network":"eip155:8453","networks":["eip155:8453","eip155:137","eip155:42161","eip155:43114","eip155:10","eip155:480","eip155:143"],"asset":"USDC"},"operationId":"extractUrl","summary":"URL → clean Markdown + structured JSON","parameters":[{"name":"url","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Public http(s) URL. Required on GET; on POST it may be sent in the body instead."},{"name":"X-Billing","in":"header","required":false,"schema":{"type":"string","enum":["free","x402","x402-testnet"]},"description":"free: opt into the free tier (50 calls/day per IP; X-Free-Remaining header); without it, requests with no key and no payment get 402 x402_required. x402: answer 402 with x402 requirements (reason x402_requested). Any other value: 400 invalid_billing_mode. A payment header wins over free; a Bearer key wins over both. x402-testnet: sandbox — same endpoint, but only Base Sepolia test USDC (eip155:84532) is accepted, settled by the x402.org testnet facilitator; free test money only, nothing is charged, rate limited per IP. Equivalent to calling /sandbox/v1/extract or /sandbox/v1/markdown."},{"name":"free","in":"query","required":false,"schema":{"type":"boolean"},"description":"Same as X-Billing: free (1 or true). Read from the API query string, so URL-encode the target url (curl --data-urlencode) or prefer the header."}],"responses":{"200":{"description":"Extraction result (X-Credits-Remaining with a key; X-Free-Remaining only in free mode)","headers":{"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1)"}},"content":{"application/json":{"schema":{"type":"object","required":["url","final_url","fetched_at","schema_version","markdown","metadata","product","tables"],"properties":{"url":{"type":"string"},"final_url":{"type":"string"},"fetched_at":{"type":"string"},"schema_version":{"type":"string"},"markdown":{"type":"string"},"markdown_truncated":{"type":"boolean"},"word_count":{"type":"integer"},"metadata":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"authors":{"type":"array","items":{"type":"string"}},"published_at":{"type":["string","null"]},"modified_at":{"type":["string","null"]},"site_name":{"type":["string","null"]},"language":{"type":["string","null"]},"canonical_url":{"type":["string","null"]},"image":{"type":["string","null"]},"type":{"type":["string","null"]}}},"product":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"brand":{"type":["string","null"]},"sku":{"type":["string","null"]},"gtin":{"type":["string","null"]},"description":{"type":["string","null"]},"image":{"type":["string","null"]},"price":{"type":["number","null"]},"price_high":{"type":["number","null"]},"currency":{"type":["string","null"]},"availability":{"type":["string","null"]},"rating":{"type":["object","null"]},"source":{"type":["string","null"],"enum":["json-ld","opengraph","microdata","heuristic",null],"description":"Extraction method for the flat fields (not the content source; see content_source)"},"price_detail":{"type":"object","required":["status","prices"],"description":"Preferred price field. Never contains 0. status=unresolved always comes with unresolved.reason.","properties":{"status":{"type":"string","enum":["resolved","partial","unresolved"]},"currency":{"type":["string","null"]},"currency_basis":{"type":["string","null"],"enum":["declared","symbol",null]},"prices":{"type":"array","items":{"type":"object","required":["type","amount","currency"],"properties":{"type":{"type":"string","enum":["list","sale","installment","current"],"description":"current = the only price shown, no discount information; sale = current price with a higher list price on the page"},"amount":{"type":"number","exclusiveMinimum":0},"amount_high":{"type":["number","null"]},"currency":{"type":["string","null"]},"variant":{"type":["object","null"],"properties":{"id":{"type":["string","null"]},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"attributes":{"type":["object","null"]},"url":{"type":["string","null"]},"match":{"type":"string","enum":["offer_url","offer_sku","shopify_variant_id","url_param+dom_selected","dom_selected"]}}},"installment":{"type":["object","null"]},"method":{"type":"string","enum":["json-ld","opengraph","microdata","heuristic","dom","shopify_meta"]},"evidence":{"type":["string","null"]}}}},"range":{"type":["object","null"],"properties":{"low":{"type":"number"},"high":{"type":["number","null"]},"currency":{"type":["string","null"]},"basis":{"type":"string","enum":["aggregate_offer","offers","product_group_variants"]},"offer_count":{"type":["integer","null"]}}},"selected_variant":{"type":["object","null"],"properties":{"id":{"type":["string","null"]},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"attributes":{"type":["object","null"]},"url":{"type":["string","null"]},"match":{"type":"string","enum":["offer_url","offer_sku","shopify_variant_id","url_param+dom_selected","dom_selected"]}}},"variants":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":["string","null"]},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"attributes":{"type":["object","null"]},"url":{"type":["string","null"]},"amount":{"type":["number","null"]},"currency":{"type":["string","null"]},"availability":{"type":["string","null"]},"source":{"type":["string","null"]},"evidence":{"type":["string","null"]}}}},"unresolved":{"type":["object","null"],"required":["reason"],"properties":{"reason":{"type":"string","enum":["no_offer_in_structured_data","price_not_numeric","zero_price","js_rendered_suspected","template_placeholder","no_price_found","variant_not_matched","listing_page","no_product_markup","not_html"]},"detail":{"type":["string","null"]}}},"warnings":{"type":"array","items":{"type":"string"}}}}}},"tables":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"caption":{"type":["string","null"]},"headers":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"checks":{"type":"object","properties":{"row_count":{"type":"integer"},"column_count":{"type":"integer"},"consistent_width":{"type":"boolean"}}}}}},"content_source":{"type":"string","enum":["raw_html","rendered"],"description":"Where the content came from: raw_html = the HTTP response body, no JavaScript executed (current behaviour); rendered = after headless rendering (not offered yet)"},"product_unresolved":{"type":["object","null"],"required":["reason"],"properties":{"reason":{"type":"string","enum":["no_offer_in_structured_data","price_not_numeric","zero_price","js_rendered_suspected","template_placeholder","no_price_found","variant_not_matched","listing_page","no_product_markup","not_html"]},"detail":{"type":["string","null"]}},"description":"Only when product is null: why no product was extracted (e.g. listing_page)"}}},"example":{"url":"https://example.com/product/123","final_url":"https://example.com/product/123","fetched_at":"2026-10-20T12:00:00.000Z","schema_version":"1.0","markdown":"# Example Product\n\nDescription...","markdown_truncated":false,"word_count":120,"metadata":{"title":"Example Product","description":"…","authors":[],"published_at":null,"modified_at":null,"site_name":"Example","language":"en","canonical_url":"https://example.com/product/123","image":null,"type":"product"},"product":{"name":"Example Product","brand":"Acme","sku":"A-123","gtin":null,"description":"…","image":null,"price":19.99,"price_high":null,"currency":"USD","availability":"InStock","rating":{"value":4.5,"count":210},"source":"json-ld","price_detail":{"status":"resolved","currency":"USD","currency_basis":"declared","prices":[{"type":"current","amount":19.99,"amount_high":null,"currency":"USD","variant":null,"installment":null,"method":"json-ld","evidence":"offers[0].price"}],"range":null,"selected_variant":null,"variants":[],"unresolved":null,"warnings":[]}},"tables":[{"index":0,"caption":null,"headers":["Spec","Value"],"rows":[["Weight","1.2 kg"]],"checks":{"row_count":1,"column_count":2,"consistent_width":true}}],"content_source":"raw_html"}}}},"400":{"description":"Missing or invalid url, forbidden host, or unknown X-Billing value (invalid_billing_mode) (JSON error, not charged)"},"401":{"description":"Invalid API key"},"402":{"description":"Payment required. Body: {error:\"payment_required\", reason, message, x402, stripe}; reason is one of x402_required (no key, no payment and no free opt-in), x402_requested (X-Billing: x402 sent), free_limit_reached (opted into free with X-Billing: free or ?free=1, daily calls used up; X-Free-Remaining: 0), invalid_payment (payment rejected), unsupported_network, settlement_failed (payment verified but settlement did not complete; not charged; retry with a new payment). Same reason in the X-Payment-Reason header. x402 v2 requirements in the PAYMENT-REQUIRED header. With a Bearer key: {error:\"no_credits\"}.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"base64 JSON x402 v2 PaymentRequired"},"X-Payment-Reason":{"schema":{"type":"string","enum":["x402_required","x402_requested","free_limit_reached","invalid_payment","unsupported_network","settlement_failed"]}},"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1): 0 when the free quota is used up"}}},"413":{"description":"Page larger than 3 MB (not charged)"},"415":{"description":"Unsupported content type (not charged)"},"422":{"description":"Target site blocked or errored (not charged)"},"451":{"description":"Disallowed by robots.txt (not charged)"}}},"post":{"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}]},"x-payment":{"protocol":"x402","scheme":"exact","price":"$0.005","network":"eip155:8453","networks":["eip155:8453","eip155:137","eip155:42161","eip155:43114","eip155:10","eip155:480","eip155:143"],"asset":"USDC"},"operationId":"extractUrlPost","summary":"URL → clean Markdown + structured JSON (POST alias: url in JSON or form body)","parameters":[{"name":"url","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Public http(s) URL. Required on GET; on POST it may be sent in the body instead."},{"name":"X-Billing","in":"header","required":false,"schema":{"type":"string","enum":["free","x402","x402-testnet"]},"description":"free: opt into the free tier (50 calls/day per IP; X-Free-Remaining header); without it, requests with no key and no payment get 402 x402_required. x402: answer 402 with x402 requirements (reason x402_requested). Any other value: 400 invalid_billing_mode. A payment header wins over free; a Bearer key wins over both. x402-testnet: sandbox — same endpoint, but only Base Sepolia test USDC (eip155:84532) is accepted, settled by the x402.org testnet facilitator; free test money only, nothing is charged, rate limited per IP. Equivalent to calling /sandbox/v1/extract or /sandbox/v1/markdown."},{"name":"free","in":"query","required":false,"schema":{"type":"boolean"},"description":"Same as X-Billing: free (1 or true). Read from the API query string, so URL-encode the target url (curl --data-urlencode) or prefer the header."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"responses":{"200":{"description":"Extraction result (X-Credits-Remaining with a key; X-Free-Remaining only in free mode)","headers":{"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1)"}},"content":{"application/json":{"schema":{"type":"object","required":["url","final_url","fetched_at","schema_version","markdown","metadata","product","tables"],"properties":{"url":{"type":"string"},"final_url":{"type":"string"},"fetched_at":{"type":"string"},"schema_version":{"type":"string"},"markdown":{"type":"string"},"markdown_truncated":{"type":"boolean"},"word_count":{"type":"integer"},"metadata":{"type":"object","properties":{"title":{"type":["string","null"]},"description":{"type":["string","null"]},"authors":{"type":"array","items":{"type":"string"}},"published_at":{"type":["string","null"]},"modified_at":{"type":["string","null"]},"site_name":{"type":["string","null"]},"language":{"type":["string","null"]},"canonical_url":{"type":["string","null"]},"image":{"type":["string","null"]},"type":{"type":["string","null"]}}},"product":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"brand":{"type":["string","null"]},"sku":{"type":["string","null"]},"gtin":{"type":["string","null"]},"description":{"type":["string","null"]},"image":{"type":["string","null"]},"price":{"type":["number","null"]},"price_high":{"type":["number","null"]},"currency":{"type":["string","null"]},"availability":{"type":["string","null"]},"rating":{"type":["object","null"]},"source":{"type":["string","null"],"enum":["json-ld","opengraph","microdata","heuristic",null],"description":"Extraction method for the flat fields (not the content source; see content_source)"},"price_detail":{"type":"object","required":["status","prices"],"description":"Preferred price field. Never contains 0. status=unresolved always comes with unresolved.reason.","properties":{"status":{"type":"string","enum":["resolved","partial","unresolved"]},"currency":{"type":["string","null"]},"currency_basis":{"type":["string","null"],"enum":["declared","symbol",null]},"prices":{"type":"array","items":{"type":"object","required":["type","amount","currency"],"properties":{"type":{"type":"string","enum":["list","sale","installment","current"],"description":"current = the only price shown, no discount information; sale = current price with a higher list price on the page"},"amount":{"type":"number","exclusiveMinimum":0},"amount_high":{"type":["number","null"]},"currency":{"type":["string","null"]},"variant":{"type":["object","null"],"properties":{"id":{"type":["string","null"]},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"attributes":{"type":["object","null"]},"url":{"type":["string","null"]},"match":{"type":"string","enum":["offer_url","offer_sku","shopify_variant_id","url_param+dom_selected","dom_selected"]}}},"installment":{"type":["object","null"]},"method":{"type":"string","enum":["json-ld","opengraph","microdata","heuristic","dom","shopify_meta"]},"evidence":{"type":["string","null"]}}}},"range":{"type":["object","null"],"properties":{"low":{"type":"number"},"high":{"type":["number","null"]},"currency":{"type":["string","null"]},"basis":{"type":"string","enum":["aggregate_offer","offers","product_group_variants"]},"offer_count":{"type":["integer","null"]}}},"selected_variant":{"type":["object","null"],"properties":{"id":{"type":["string","null"]},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"attributes":{"type":["object","null"]},"url":{"type":["string","null"]},"match":{"type":"string","enum":["offer_url","offer_sku","shopify_variant_id","url_param+dom_selected","dom_selected"]}}},"variants":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":["string","null"]},"sku":{"type":["string","null"]},"name":{"type":["string","null"]},"attributes":{"type":["object","null"]},"url":{"type":["string","null"]},"amount":{"type":["number","null"]},"currency":{"type":["string","null"]},"availability":{"type":["string","null"]},"source":{"type":["string","null"]},"evidence":{"type":["string","null"]}}}},"unresolved":{"type":["object","null"],"required":["reason"],"properties":{"reason":{"type":"string","enum":["no_offer_in_structured_data","price_not_numeric","zero_price","js_rendered_suspected","template_placeholder","no_price_found","variant_not_matched","listing_page","no_product_markup","not_html"]},"detail":{"type":["string","null"]}}},"warnings":{"type":"array","items":{"type":"string"}}}}}},"tables":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"caption":{"type":["string","null"]},"headers":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"checks":{"type":"object","properties":{"row_count":{"type":"integer"},"column_count":{"type":"integer"},"consistent_width":{"type":"boolean"}}}}}},"content_source":{"type":"string","enum":["raw_html","rendered"],"description":"Where the content came from: raw_html = the HTTP response body, no JavaScript executed (current behaviour); rendered = after headless rendering (not offered yet)"},"product_unresolved":{"type":["object","null"],"required":["reason"],"properties":{"reason":{"type":"string","enum":["no_offer_in_structured_data","price_not_numeric","zero_price","js_rendered_suspected","template_placeholder","no_price_found","variant_not_matched","listing_page","no_product_markup","not_html"]},"detail":{"type":["string","null"]}},"description":"Only when product is null: why no product was extracted (e.g. listing_page)"}}},"example":{"url":"https://example.com/product/123","final_url":"https://example.com/product/123","fetched_at":"2026-10-20T12:00:00.000Z","schema_version":"1.0","markdown":"# Example Product\n\nDescription...","markdown_truncated":false,"word_count":120,"metadata":{"title":"Example Product","description":"…","authors":[],"published_at":null,"modified_at":null,"site_name":"Example","language":"en","canonical_url":"https://example.com/product/123","image":null,"type":"product"},"product":{"name":"Example Product","brand":"Acme","sku":"A-123","gtin":null,"description":"…","image":null,"price":19.99,"price_high":null,"currency":"USD","availability":"InStock","rating":{"value":4.5,"count":210},"source":"json-ld","price_detail":{"status":"resolved","currency":"USD","currency_basis":"declared","prices":[{"type":"current","amount":19.99,"amount_high":null,"currency":"USD","variant":null,"installment":null,"method":"json-ld","evidence":"offers[0].price"}],"range":null,"selected_variant":null,"variants":[],"unresolved":null,"warnings":[]}},"tables":[{"index":0,"caption":null,"headers":["Spec","Value"],"rows":[["Weight","1.2 kg"]],"checks":{"row_count":1,"column_count":2,"consistent_width":true}}],"content_source":"raw_html"}}}},"400":{"description":"Missing or invalid url, forbidden host, or unknown X-Billing value (invalid_billing_mode) (JSON error, not charged)"},"401":{"description":"Invalid API key"},"402":{"description":"Payment required. Body: {error:\"payment_required\", reason, message, x402, stripe}; reason is one of x402_required (no key, no payment and no free opt-in), x402_requested (X-Billing: x402 sent), free_limit_reached (opted into free with X-Billing: free or ?free=1, daily calls used up; X-Free-Remaining: 0), invalid_payment (payment rejected), unsupported_network, settlement_failed (payment verified but settlement did not complete; not charged; retry with a new payment). Same reason in the X-Payment-Reason header. x402 v2 requirements in the PAYMENT-REQUIRED header. With a Bearer key: {error:\"no_credits\"}.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"base64 JSON x402 v2 PaymentRequired"},"X-Payment-Reason":{"schema":{"type":"string","enum":["x402_required","x402_requested","free_limit_reached","invalid_payment","unsupported_network","settlement_failed"]}},"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1): 0 when the free quota is used up"}}},"413":{"description":"Page larger than 3 MB (not charged)"},"415":{"description":"Unsupported content type (not charged)"},"422":{"description":"Target site blocked or errored (not charged)"},"451":{"description":"Disallowed by robots.txt (not charged)"}}}},"/v1/markdown":{"get":{"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"x-payment":{"protocol":"x402","scheme":"exact","price":"$0.002","network":"eip155:8453","networks":["eip155:8453","eip155:137","eip155:42161","eip155:43114","eip155:10","eip155:480","eip155:143"],"asset":"USDC"},"operationId":"pageMarkdown","summary":"URL → clean Markdown only (0.4 credit / $0.002 x402)","parameters":[{"name":"url","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Public http(s) URL. Required on GET; on POST it may be sent in the body instead."},{"name":"X-Billing","in":"header","required":false,"schema":{"type":"string","enum":["free","x402","x402-testnet"]},"description":"free: opt into the free tier (50 calls/day per IP; X-Free-Remaining header); without it, requests with no key and no payment get 402 x402_required. x402: answer 402 with x402 requirements (reason x402_requested). Any other value: 400 invalid_billing_mode. A payment header wins over free; a Bearer key wins over both. x402-testnet: sandbox — same endpoint, but only Base Sepolia test USDC (eip155:84532) is accepted, settled by the x402.org testnet facilitator; free test money only, nothing is charged, rate limited per IP. Equivalent to calling /sandbox/v1/extract or /sandbox/v1/markdown."},{"name":"free","in":"query","required":false,"schema":{"type":"boolean"},"description":"Same as X-Billing: free (1 or true). Read from the API query string, so URL-encode the target url (curl --data-urlencode) or prefer the header."}],"responses":{"200":{"description":"Markdown result (X-Free-Remaining only in free mode)","headers":{"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1)"}},"content":{"application/json":{"schema":{"type":"object","required":["url","final_url","markdown"],"properties":{"url":{"type":"string"},"final_url":{"type":"string"},"fetched_at":{"type":"string"},"content_source":{"type":"string","enum":["raw_html","rendered"],"description":"Where the content came from: raw_html = the HTTP response body, no JavaScript executed (current behaviour); rendered = after headless rendering (not offered yet)"},"title":{"type":["string","null"]},"markdown":{"type":"string"},"markdown_truncated":{"type":"boolean"},"word_count":{"type":"integer"}}}}}},"400":{"description":"Missing or invalid url, forbidden host, or unknown X-Billing value (invalid_billing_mode) (JSON error, not charged)"},"401":{"description":"Invalid API key"},"402":{"description":"Payment required. Body: {error:\"payment_required\", reason, message, x402, stripe}; reason is one of x402_required (no key, no payment and no free opt-in), x402_requested (X-Billing: x402 sent), free_limit_reached (opted into free with X-Billing: free or ?free=1, daily calls used up; X-Free-Remaining: 0), invalid_payment (payment rejected), unsupported_network, settlement_failed (payment verified but settlement did not complete; not charged; retry with a new payment). Same reason in the X-Payment-Reason header. x402 v2 requirements in the PAYMENT-REQUIRED header. With a Bearer key: {error:\"no_credits\"}.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"base64 JSON x402 v2 PaymentRequired"},"X-Payment-Reason":{"schema":{"type":"string","enum":["x402_required","x402_requested","free_limit_reached","invalid_payment","unsupported_network","settlement_failed"]}},"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1): 0 when the free quota is used up"}}},"413":{"description":"Page larger than 3 MB (not charged)"},"415":{"description":"Unsupported content type (not charged)"},"422":{"description":"Target site blocked or errored (not charged)"},"451":{"description":"Disallowed by robots.txt (not charged)"}}},"post":{"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"x-payment":{"protocol":"x402","scheme":"exact","price":"$0.002","network":"eip155:8453","networks":["eip155:8453","eip155:137","eip155:42161","eip155:43114","eip155:10","eip155:480","eip155:143"],"asset":"USDC"},"operationId":"pageMarkdownPost","summary":"URL → clean Markdown only (0.4 credit / $0.002 x402) (POST alias: url in JSON or form body)","parameters":[{"name":"url","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"Public http(s) URL. Required on GET; on POST it may be sent in the body instead."},{"name":"X-Billing","in":"header","required":false,"schema":{"type":"string","enum":["free","x402","x402-testnet"]},"description":"free: opt into the free tier (50 calls/day per IP; X-Free-Remaining header); without it, requests with no key and no payment get 402 x402_required. x402: answer 402 with x402 requirements (reason x402_requested). Any other value: 400 invalid_billing_mode. A payment header wins over free; a Bearer key wins over both. x402-testnet: sandbox — same endpoint, but only Base Sepolia test USDC (eip155:84532) is accepted, settled by the x402.org testnet facilitator; free test money only, nothing is charged, rate limited per IP. Equivalent to calling /sandbox/v1/extract or /sandbox/v1/markdown."},{"name":"free","in":"query","required":false,"schema":{"type":"boolean"},"description":"Same as X-Billing: free (1 or true). Read from the API query string, so URL-encode the target url (curl --data-urlencode) or prefer the header."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"responses":{"200":{"description":"Markdown result (X-Free-Remaining only in free mode)","headers":{"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1)"}},"content":{"application/json":{"schema":{"type":"object","required":["url","final_url","markdown"],"properties":{"url":{"type":"string"},"final_url":{"type":"string"},"fetched_at":{"type":"string"},"content_source":{"type":"string","enum":["raw_html","rendered"],"description":"Where the content came from: raw_html = the HTTP response body, no JavaScript executed (current behaviour); rendered = after headless rendering (not offered yet)"},"title":{"type":["string","null"]},"markdown":{"type":"string"},"markdown_truncated":{"type":"boolean"},"word_count":{"type":"integer"}}}}}},"400":{"description":"Missing or invalid url, forbidden host, or unknown X-Billing value (invalid_billing_mode) (JSON error, not charged)"},"401":{"description":"Invalid API key"},"402":{"description":"Payment required. Body: {error:\"payment_required\", reason, message, x402, stripe}; reason is one of x402_required (no key, no payment and no free opt-in), x402_requested (X-Billing: x402 sent), free_limit_reached (opted into free with X-Billing: free or ?free=1, daily calls used up; X-Free-Remaining: 0), invalid_payment (payment rejected), unsupported_network, settlement_failed (payment verified but settlement did not complete; not charged; retry with a new payment). Same reason in the X-Payment-Reason header. x402 v2 requirements in the PAYMENT-REQUIRED header. With a Bearer key: {error:\"no_credits\"}.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"base64 JSON x402 v2 PaymentRequired"},"X-Payment-Reason":{"schema":{"type":"string","enum":["x402_required","x402_requested","free_limit_reached","invalid_payment","unsupported_network","settlement_failed"]}},"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Only in free mode (X-Billing: free or ?free=1): 0 when the free quota is used up"}}},"413":{"description":"Page larger than 3 MB (not charged)"},"415":{"description":"Unsupported content type (not charged)"},"422":{"description":"Target site blocked or errored (not charged)"},"451":{"description":"Disallowed by robots.txt (not charged)"}}}},"/v1/balance":{"get":{"security":[],"operationId":"getBalance","summary":"Remaining credits (or free calls today without key)","responses":{"200":{"description":"Balance"}}}}}}