PagePry
Web Scraping

API Reference

Complete request and response schema for the Web Scraping API.

POST /scrape

Scrape a web page and return the fully rendered HTML content.

Endpoint

POST https://api.pagepry.com/v1/scrape

Headers

HeaderRequiredDescription
x-api-keyYesYour PagePry API key
Content-TypeYesMust be application/json

Request body

ParameterTypeDefaultDescription
urlstringrequiredThe URL to scrape. Must be a valid URL.
waitForstring"auto"Page readiness strategy. One of: "auto", "networkidle", "domcontentloaded". See Wait Strategies.
timeoutMsnumber30000Maximum wait time in ms (1,000–120,000).
proxystring"none"Proxy type: "none", "datacenter", "residential". See Proxies.
headersobjectCustom HTTP headers as key-value pairs.
cookiesarrayCookies to set before navigation. Each entry: {name, value, domain}. See Cookies & Headers.
cachebooleantrueUse cached results if available. Cached responses cost 0 credits.

Example request

curl -X POST https://api.pagepry.com/v1/scrape \
  -H "x-api-key: pp_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "waitFor": "auto",
    "proxy": "datacenter",
    "cache": true
  }'

Success response (200)

{
  "success": true,
  "html": "<!DOCTYPE html><html>...</html>",
  "metadata": {
    "statusCode": 200,
    "url": "https://example.com",
    "resolvedUrl": "https://example.com/",
    "contentType": "text/html; charset=utf-8",
    "renderStrategy": "ssr-early-return",
    "loadTimeMs": 847,
    "fromCache": false
  }
}
FieldTypeDescription
successbooleanAlways true for successful responses.
htmlstringThe fully rendered HTML content of the page.
metadata.statusCodenumberHTTP status code of the target page.
metadata.urlstringThe original requested URL.
metadata.resolvedUrlstringThe final URL after any redirects.
metadata.contentTypestringContent-Type header of the response.
metadata.renderStrategystringThe readiness strategy used (e.g., ssr-early-return, network-idle).
metadata.loadTimeMsnumberTime in milliseconds to load and render the page.
metadata.fromCachebooleanWhether this result was served from cache.

Error response

{
  "success": false,
  "error": "Human-readable error message"
}

See Errors for the full list of error codes and HTTP status codes.