Skip to main content
Use POST /spa-extract to pull specific, typed fields out of single-page applications and other JavaScript-heavy sites. You can target elements directly with CSS selectors, intercept live network responses to capture API payloads, or apply a pre-built template for popular sites like SimilarWeb and Google Trends — without writing or maintaining a scraper.

Two extraction modes

The mode field controls what the endpoint does:

Discover fields with inspect mode

Run inspect first when you’re working with an unfamiliar page. The response shows you which DOM elements and network responses are available, and generates a suggestedPlan you can paste directly into an extract request.
The response looks like this:

Extract custom fields

Define a fields object in your request body, where each key is the output field name and its value describes where and how to read it.

DOM fields

A DOM field reads from a rendered element. Set source: "dom", point to an element with selector, and choose a parse type to coerce the value.

Network fields

A network field intercepts a JSON response from the page’s own API calls. Set source: "network", use urlIncludes to match the request URL, and supply a path using JSONPath syntax to reach the value inside the response.

Field options reference

"dom" | "network"
required
Data source for the field.
string
CSS selector (DOM fields only).
"text" | "html" | "attribute"
DOM read mode. Defaults to "text". Use "attribute" together with the attribute field.
string
Substring to match a network response URL (network fields only).
string
JSONPath expression into the matched response, e.g. $.data.metrics[0].value.
"string" | "number" | "integer" | "boolean" | "json"
Coerce the extracted value to this type.
boolean
Return all matching elements as an array (DOM fields only).
string
Apply a regular expression. When a capture group is present, group 1 is returned.
boolean
Missing required fields cause a 422 SPA_REQUIRED_FIELDS_MISSING response.

Use pre-built templates

AdsCrawl ships three maintained templates for sites that are difficult to scrape reliably. Pass template instead of fields.

similarweb-overview

Website traffic, engagement, and ranking metrics from SimilarWeb.

google-trends-explore

Interest-over-time and average values for up to five search terms.

chrome-web-store-app-info

Extension metadata including ratings, user counts, and categories.
List templates and see their full output schemas at any time:

SimilarWeb example

Pass the full SimilarWeb URL and a countryCode for proxy routing. The template handles authentication, scroll timing, and field extraction automatically.
Supply a comma-separated list of keywords via the keyword field (recommended). The API builds the canonical Trends URL for you. You can compare up to five unique terms.
Do not pass cookies to a Google Trends request. Any non-empty cookies array returns 400 INVALID_TRENDS_COOKIES.

Run actions before extraction

Use the actions array to interact with the page — click buttons, fill forms, scroll, or wait — before fields are extracted. Actions execute in order and each step is capped at 30 seconds.
Available action types:

Full extract response

A successful extract response always contains mode, page, data, and missingFields:
missingFields lists any field names that were defined but could not be resolved. Fields marked required: true that are missing will instead return a 422 error.