Run a Google search and return structured SERP data.
const url = 'https://api.serp.cheap/v1/search';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"q":"example","gl":"br","hl":"example","tbs":"qdr:h","page":1,"scrape":{"render_js":false,"screenshot":false,"top_n":5,"wait_for":"example","wait_ms":1,"screenshot_width":1920,"screenshot_height":1080}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.serp.cheap/v1/search \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "q": "example", "gl": "br", "hl": "example", "tbs": "qdr:h", "page": 1, "scrape": { "render_js": false, "screenshot": false, "top_n": 5, "wait_for": "example", "wait_ms": 1, "screenshot_width": 1920, "screenshot_height": 1080 } }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
The search query.
UI language (BCP-47-ish, e.g. “en”, “pt-BR”).
Time filter — past hour/day/week.
Opt-in page-content scraping attached to a search. Each result page scraped successfully is billed on top of the search (1 content / 3 render JS / +1 screenshot).
object
Render with a headless browser before extracting (JS-heavy sites).
Capture a screenshot (1920x1080 by default, 48h presigned URL). Implies a browser render.
How many of the top organic results to scrape.
CSS selector to wait for before extracting (render_js only).
Extra settle time after load, in ms (render_js only).
Screenshot width in px (default 1920, max 1920).
Screenshot height in px (default 1080, max 1920).
Responses
Section titled “ Responses ”A parsed SERP.
object
object
object
object
object
Scraped page content as markdown (present when scrape was requested and succeeded).
Screenshot (1920x1080 by default), 48h presigned URL (present when scrape.screenshot was requested).
Why this page couldn’t be scraped (not billed). Mutually exclusive with content.
object
“top” or “bottom”
object
object
object
Credits remaining after this search.
Credits charged (6 fresh / 3 cache hit).
Example generated
{ "search": "example", "page": 1, "knowledgeGraph": { "title": "example", "imageUrl": "example", "description": "example", "descriptionSource": "example", "descriptionLink": "example", "attributes": { "additionalProperty": "example" } }, "organic": [ { "position": 1, "title": "example", "link": "example", "snippet": "example", "date": "example", "sitelinks": [ { "title": "example", "link": "example" } ], "content": "example", "screenshot_url": "example", "scrape_error": "example" } ], "ads": [ { "position": 1, "title": "example", "link": "example", "displayedLink": "example", "snippet": "example", "block": "example", "sitelinks": [ { "title": "example", "link": "example" } ] } ], "peopleAlsoAsk": [ "example" ], "relatedSearches": [ { "query": "example", "link": "example" } ], "stats": { "balance": 1, "cost": 1, "cached": true }}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}A typed error.
object
Machine code: invalid_request, missing_api_key, unknown_api_key, inactive_api_key, account_blocked, insufficient_credits, rate_limited, request_in_progress, too_many_concurrent_requests, service_temporarily_unavailable, result_timeout.
Example generated
{ "error": "example", "message": "example", "details": "example", "retry_after_ms": 1, "required": 1, "balance": 1}