apyhub
Back
▣ DATA EXTRACTION · SEO

Get SERP Results API

What it does

The SE Ranking SERP API collects search results for any query, device, and location, then returns them as ranked JSON or the raw HTML page. Send a query array with device, location_id, language_code, and search_engine (for example google), and each query becomes its own task with an id.

Tasks run asynchronously. Poll with task_id until the task completes, or set a pingback_url to get a callback. The advanced results endpoint returns request_metadata, a summary of detected SERP features, and an items array in ranked order, covering organic listings, AI overviews, People Also Ask, and related searches. The HTML dump endpoint returns the original page source. Look up a valid location_id by name or country_code with the locations endpoint.

Teams use this SERP API for rank tracking across cities and devices, competitor monitoring, and SERP feature research. SEO platforms and agencies use the SE Ranking API to feed dashboards with fresh Google SERP data from their own code.

AI agents can call it through ApyHub MCP to check live rankings on request.

Build the query list with the Keyword Research API, size up ranking domains with the Domain Analysis API, and pull titles and descriptions of ranking URLs with the URL Metadata API. Track how brands appear in AI answers with the AI Visibility API.

▣ ENDPOINT 01 / 05
POST
Add task
https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks

QUICKSTART

GUIDE

Quickstart

Create a new classic SERP task with a minimal JSON body. Authenticate using the apy-token request header.

curl -X POST "https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks" \
  -H "Content-Type: application/json" \
  -H "apy-token: $APY_TOKEN" \
  -d '{
    "query": ["seo report"],
    "device": "desktop",
    "location_id": 12998,
    "language_code": "es",
    "search_engine": "google"
  }'

What you'll get back

Returns an array of task objects, one per query submitted, each with an id you can use to poll for status/results. See the Docs tab for the full response shape.

TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
query*
Search queries to submit. One task is created per query in the array.
Device type for the task (e.g. desktop, mobile).
Location identifier.
Language code for the task.
Search engine to use (e.g. google).
Optional user-defined label for the task, used for tracking/organizing tasks on your end. No effect on task execution.

About this endpoint

What it does

Creates one or more SERP Classic tasks based on the search queries submitted in the request body. If multiple queries are provided in the query array, a separate task is created for each one. The response returns an array of task objects, each representing a queued or in-progress task with its own id, echoed request parameters, and current status. An apikey is accepted as a query parameter for authentication.

Note: tasks are asynchronous — a newly created task will typically have is_completed: false and status: null until it finishes processing. Poll the task using its id via the task status/result endpoint to retrieve the final SERP data.

Request Body

ParameterTypeDescription
queryString ArraySearch queries to submit. One task is created per query.
deviceStringDevice type for the task.
location_idIntegerLocation identifier.
language_codeStringLanguage code for the task.
search_engineStringSearch engine to use.
tagStringOptional task tag.

Response

Returns an array of task objects — one per query submitted. Each object includes a server-generated id, the echoed task parameters, and status-tracking fields (is_completed, status, added). See Output Schema below for the full field-level breakdown.

▣ ENDPOINT 02 / 05
GET
List tasks / Get task results
https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks

QUICKSTART

GUIDE

Quickstart

Fetch a SERP classic task by its ID using your API key in the query string.

curl -X GET "https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks?task_id=176899957" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a status object while the task is still processing (e.g. {"status": "processing"}). Once the task completes, a fuller result payload is expected — see the Docs tab, pending confirmation.

TRY ITLIVE · 250 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
The task identifier to fetch the HTML dump for.

About this endpoint

What it does

Lists SERP Classic tasks, or retrieves a specific task's result when a task_id is provided. Input is supplied entirely via query parameters — there is no request body.

Query Parameter(s)

AttributeTypeDescription
task_idIntegerIdentifier of the task to retrieve. If omitted, presumably lists all tasks.
▣ ENDPOINT 03 / 05
GET
Get HTML dump
https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks/html

QUICKSTART

GUIDE

Quickstart

Fetch a SERP classic task's HTML result by its task_id query parameter.

curl -X GET "https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks/html?task_id=123456" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Expected to return the raw HTML content for the task

TRY ITLIVE · 250 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
The task identifier to fetch the HTML dump for.

About this endpoint

What it does

Retrieves the raw HTML dump for a SERP Classic task, identified by its task_id query parameter.

Query Parameter(s)

AttributeTypeDescription
task_idIntegerThe task identifier to fetch the HTML dump for.
▣ ENDPOINT 04 / 05
GET
Get advanced results
https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks/results_advanced

QUICKSTART

GUIDE

Quickstart

Fetch the advanced results for a classic SERP task by passing its task_id as a query parameter.

curl -X GET "https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/tasks/results_advanced?task_id=123456" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a single object containing request_metadata, a summary, and an items array with the full ranked SERP content (AI overview, organic results, people-also-ask, related searches, etc.).

TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Identifier of the task to fetch results for.

About this endpoint

What it does

Retrieves the advanced (detailed) results for a completed SERP Classic task, using the task_id passed as a query parameter. Unlike the basic "Get Task Results" endpoint, this returns the full parsed SERP data — request metadata, a results summary, and a mixed array of SERP item types (AI overview, organic listings, "people also ask", "related searches", etc.) in ranked order.

Query Parameter(s)

AttributeTypeDescription
task_idIntegerIdentifier of the task to fetch results for.

Response

Returns a single object with three top-level sections:

  • request_metadata — echoes back the original task's search parameters plus crawl info (when it was crawled, the actual search URL hit).
  • summary — aggregate counts and a list of which SERP features were detected on the page (e.g. AI overview, videos, reviews).
  • items — an ordered array of the actual SERP content, ranked by position. Each item has a type field that determines which additional fields are present (see Output Schema below for the per-type breakdow).
▣ ENDPOINT 05 / 05
GET
Get locations
https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/locations

QUICKSTART

GUIDE

Quickstart

Fetch the SERP classic locations for a query, with optional filters passed as query parameters.

curl -X GET "https://api.eu.apyhub.com/se-ranking/serp-results-classic/v1/serp/classic/locations?q=new%20york&include=all&country_code=us" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Expected to return a list of matching locations

TRY ITLIVE · 250 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Search term used to look up locations.
Additional locations to include in the results.
Country code used to scope the location lookup.

About this endpoint

What it does

Looks up SERP Classic-supported search locations, filterable by a free-text query, an include list, and/or a country code. Used to resolve valid location_id values before submitting a task (see Add Task endpoint), so you can target location-sensitive search queries correctly.

Query Parameter(s)

AttributeTypeDescription
qStringSearch term used to look up locations.
includeStringAdditional locations to include in the results.
country_codeStringCountry code used to scope the location lookup.

Response

Expected to return a list of matching location objects (each likely including at minimum an id — matching the location_id field used in Add Task — plus a display name and possibly country/region info). Not confirmed from a sample response yet.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.