API Reference

POST /api/scrape

The main endpoint for scraping URLs. Send a URL, get back the page content with intelligent strategy escalation.

Endpoint

POST https://payperscrape.com/api/scrape

Request Body

Request body must be valid JSON and must not exceed 10 KB in size. The body should include the url field and optional parameters.

ParameterTypeRequiredDescription
urlstring (URL)YesThe URL to scrape. Must be a valid HTTP or HTTPS URL. Maximum length: 2048 characters.

Request Example

Here's a simple example of how to make a request to the /api/scrape endpoint using the x402 SDK ( For more information, see the x402 documentation).

Node.JStypescript

Response Formats

Success Response (200)

Successjson

Partial Response (200)

Returned when content is incomplete (login wall, geoblocked, etc.) but some content was retrieved.

Partialjson

Error Response (400/502)

Errorjson

Metadata Fields

The metadata object contains detailed information about the scraping process.

FieldTypeDescription
domainstringThe normalized domain (without www) that was scraped.
country"us" | "eu" | nullThe country code used for the request. May be flipped automatically if geoblocked.
attemptsnumberTotal number of scraping attempts made (including escalations).
escalationsnumberNumber of times the scraping strategy was escalated (static → js → premium).
byte_sizenumberSize of the returned HTML content in bytes.
is_partialbooleanWhether the returned content is partial/incomplete. true if login wall detected or content incomplete.
domain_confidencenumberConfidence score (0-1) for the domain strategy. Higher means more reliable strategy.
classification_versionstringVersion of the classification algorithm used (e.g., 'v1.3').
decision_reasonstringReason for the final decision. Common values: 'ok', 'hydration_skeleton', 'antibot_challenge', 'geoblocked', 'missing_semantics', 'too_small', etc.
report_urlstring (optional)URL to report issues with this domain. Only present in partial responses.

Attempts and Escalations

The attempts array shows the sequence of scraping attempts made. Each entry follows the format: mode:reason

Example attempts array:

This indicates: first attempt used static mode and detected hydration_skeleton, then escalated to js mode which succeeded (ok).

Escalation Strategy:

  • static → Basic HTTP request, no JavaScript rendering
  • js → JavaScript rendering enabled for SPAs and dynamic content
  • premium → Premium proxies and anti-bot bypass for protected sites

The system automatically escalates based on detected issues (hydration skeletons, anti-bot challenges, etc.). The escalations count shows how many times the strategy was upgraded.

Decision Reasons

The decision_reason field explains why the scraping succeeded, failed, or required escalation.

ReasonDescription
okContent is complete and valid
hydration_skeletonDetected React/Next.js hydration skeleton - needs JS rendering
antibot_challengeDetected anti-bot protection (Cloudflare, etc.) - needs premium mode
geoblockedContent blocked by geographic restrictions
missing_semanticsMissing title or semantic HTML elements - may need JS rendering
under_baselineContent size significantly below expected baseline
too_smallContent too small (<700 bytes) - likely incomplete
empty_redirectEmpty response with redirect header
empty_no_contentEmpty or very small response (<100 bytes)
empty_response_max_escalationEmpty response even after maximum escalation
http_403HTTP 403 Forbidden response
http_429HTTP 429 Too Many Requests
http_503HTTP 503 Service Unavailable

Response Headers

HeaderDescription
X-Strategy-AttemptsNumber of attempts made during the scraping process.
Content-Typeapplication/json

Pricing

Per-Request Pricing

PayPerScrape uses x402 (Coinbase's payment protocol) for per-request payments. No accounts, no API keys—just pay with your crypto wallet.

Per Request
$0.05
per successful scrape
All scraping strategies included (static, JS rendering, premium proxies)

HTTP Status Codes

CodeStatusDescription
400Bad RequestInvalid URL, malformed request body, or validation error
401UnauthorizedInvalid x402 payment signature (if signature verification is enabled)
402Payment Requiredx402 payment needed to complete request
403ForbiddenDomain is blocked (localhost, private networks) or restricted
413Payload Too LargeRequest body exceeds maximum size of 10 KB
429Too Many RequestsRate limit exceeded. Check Retry-After header for when to retry
500Internal Server ErrorServer configuration error or internal processing failure
502Bad GatewayTarget site unreachable, incomplete content (in strict_mode), or scraping failure
206Partial ContentContent retrieved but marked as partial/incomplete (only in non-strict mode)

How It Works

PayPerScrape uses intelligent strategy escalation to get you the best results at the lowest cost:

  1. Domain Strategy Cache: Each domain's optimal scraping strategy is cached and reused.
  2. Automatic Escalation: If static scraping fails or detects issues (hydration skeleton, anti-bot, etc.), the system automatically escalates to JS rendering or premium mode.
  3. Content Evaluation: The returned HTML is evaluated for completeness. If incomplete, the system tries a more advanced strategy.
  4. Efficiency Optimization: The system always tries the fastest strategy first (static), only escalating when necessary to ensure complete content.

No Platform, Just an Endpoint: Unlike traditional scraping platforms, PayPerScrape is a single API endpoint. No dashboard, no account management, no complex setup. Just send a request with x402 payment and get your content.