cdpfleet Docs Sign up free

Functions

Scrape

The page in the formats you ask for — HTML, Markdown, text, links, a screenshot, its XHR/fetch calls, cookies, console — after optional clicks and typing, with CSS selectors extracted to JSON. POST https://cdpfleet.com/v1/functions/scrape → application/json.

curl -s https://cdpfleet.com/v1/functions/scrape \
  -H "x-api-key: $CDPFLEET_API_KEY" -H "content-type: application/json" \
  -d '{"url":"https://books.toscrape.com/","formats":["markdown","links"],"extract":{"title":"h1","prices":{"selector":".price_color","all":true}}}' -o page.json -D - | grep -i '^x-call-id'

Fields

FieldTypeDefaultWhat it does
urlstringrequiredThe page to load. A public http or https address: private, loopback, link-local, CGNAT and cloud-metadata addresses, localhost, .local/.internal names and names that resolve to them are refused (400 invalid_url).
countrystring"random"Two-letter country for the exit IP and for the page's locale, timezone, geolocation and Accept-Language (see countries); "random" picks one. Unknown codes: 400 invalid_country.
max_waitnumber20Seconds to wait for the page to load, 1–60 (400 invalid_option otherwise). The whole call returns within about max_wait + 5 s, so a client timeout of max_wait + 10 s is safe. A page that is still loading then comes back partial (below); one that never started: 408 page_timeout.
proxystring or string[]the Community proxyOmit it to use the free Community proxy in country. Or: your own proxy URL (http://, https://, socks5://), a list (one is picked per call), a cdpfleet-plan… token, or a residential cdpfleet-resi… token (tier, country, device OS, sticky session) billed per GB to your residential balance (proxies). proxy_rules isn't supported yet (400 invalid_option).
formatsstring[]["html"]Any of "html", "markdown", "text", "links", "screenshot" (a base64 PNG of the viewport), "requests", "cookies", "console".
wait_forstring or numbernoneAfter the page loads, wait for a CSS selector ("#results") or a number of milliseconds, within max_wait.
actionsobject[][]Up to 20 steps before the capture, one key each: {"click": sel}, {"type": [sel, text]}, {"press": "Enter"}, {"scroll": "bottom"} (or "top", or pixels), {"wait": ms or sel}, {"hover": sel}, {"select": [sel, value]}. A step that fails: 422 action_failed with step and message.
extractobjectnoneNamed CSS selectors returned as JSON: {"title": "h1"} gives the text of the first match; {"links": {"selector": "a", "attr": "href", "all": true}} gives every match's attribute.

Good to know

Billing, errors and countries: Functions.