semust logo

API Platform

SERP API

Retrieve Google search results in structured JSON or raw HTML format.

Retrieve Google search results in structured JSON or raw HTML format. Supports multi-page queries, mobile/desktop results, and localized searches by language and country.

Product page: SERP API.

Code examples on GitHub

Runnable examples in Python, Node.js, Go, PHP and cURL, with a real sample response: Semust-com/google-serp-scraper.

Requests longer than 60 seconds

This endpoint runs requests as tasks. A request that runs longer than 60 seconds returns 202 with a task_id; collect the result from GET /v1/tasks/{task_id}. Every response, including a normal 200, carries the task id in the X-Task-Id header. Use ?wait= to change how long the request waits, and an Idempotency-Key header to retry safely.

Authentication

All requests require header-based authentication. Include your API credentials in every request.

HeaderTypeDescription
SEMUST-API-USERstringYour API user's username
SEMUST-API-PASSWORDstringYour API user's password

Create API credentials from the API Access page.

SEMUST-API-USER: your_username
SEMUST-API-PASSWORD: your_password

Request Parameters

Send a application/json body with the following parameters:

Body

keywordstringrequired

The search query to look up on Google.

languagestringdefault: en

Language code (ISO 639-1). Controls the language of search results. Examples: "en", "tr", "de", "fr", "es".

countrystringdefault: US

Country code (ISO 3166-1 alpha-2). Geo-targets search results to a specific country. Examples: "US", "TR", "DE", "GB".

formatstringdefault: json

Response format. "json" returns parsed structured data. "raw" returns the full HTML of the search results page.

mobilebooleandefault: false

When true, returns mobile search results instead of desktop.

start_pageintegerdefault: 1

First page of results to fetch. Must be between 1 and 10.

end_pageintegerdefault: 1

Last page of results to fetch. Must be between 1 and 10, and >= start_page.

resolve_redirectsbooleandefault: false

When true, organic links that Google returns as its own redirect (https://google.com/goto?url=…) are followed, and link holds the destination URL. Free, but slow: requests usually take 45–120 seconds, so most return 202. JSON only. See Redirect Links and Poisoned SERPs.

poison_checkbooleandefault: false

When true, the results page is compared with an unaltered version of the same search. If Google served an altered page, the organic results are replaced with the verified ones, each marked restored: true. Charged as one extra page. See Redirect Links and Poisoned SERPs.

Pagination:

Both start_page and end_page must be between 1 and 10. end_page must be >= start_page. You are charged for every page from 1 to end_page (see Multi-Page Requests).

Query

waitintegerdefault: 60

Seconds to wait for the result, 0–80. If the request is still running after that, the response is 202 with a task_id. 0 answers 202 at once.

Headers

Idempotency-Keystring

Optional, up to 128 characters. Sending the same key again returns the same task instead of starting a new one, and it is charged once. The key is reserved until 72 hours after the task finishes.

{
  "keyword": "best seo tools",
  "language": "en",
  "country": "US",
  "format": "json",
  "mobile": false,
  "start_page": 1,
  "end_page": 1,
  "resolve_redirects": false,
  "poison_check": false
}

Code Examples

Complete examples showing how to call the SERP API in different languages.

These examples handle a request that finishes within wait. A longer one returns 202; the call() helper on Tasks & Long-Running Requests polls until the result is ready.

curl -X POST https://data.semust.com/v1/serp \
  -H "Content-Type: application/json" \
  -H "SEMUST-API-USER: your_username" \
  -H "SEMUST-API-PASSWORD: your_password" \
  -d '{
    "keyword": "best seo tools",
    "language": "en",
    "country": "US",
    "format": "json"
  }'

Multi-Page Requests

To fetch multiple pages of search results, set start_page and end_page.

The response is one object with the same fields as a single-page response. organic holds the results of every requested page in order, and global_rank is each result's position counted from the top of page 1.

Credits

Each page is charged at the base price, and pages are always counted from page 1 to end_page: Google results are fetched from the top, so start_page only decides which pages are returned. Pages 1–3 cost 3× the base price, and so do pages 3–3. poison_check adds one page: pages 1–3 with it cost 4×.

import requests

response = requests.post(
    "https://data.semust.com/v1/serp",
    headers={
        "SEMUST-API-USER": "your_username",
        "SEMUST-API-PASSWORD": "your_password",
    },
    json={
        "keyword": "best seo tools",
        "format": "json",
        "start_page": 1,
        "end_page": 3,
    },
)

data = response.json()
for result in data.get("organic", []):
    print(f"  {result['rank']}. {result['title']}")
    print(f"     URL: {result['link']}")
    print(f"     Source: {result.get('source', 'N/A')}")

Two optional checks make organic results more reliable. Both are off by default.

resolve_redirects

Google often returns an organic result as its own redirect link (https://google.com/goto?url=…) instead of the page it points to. That link is opaque: you cannot read the domain from it or fetch the page through it. Even then, display_link and source name the real site. To get the destination URL itself in link, set resolve_redirects: true.

  • It takes time. Requests with resolve_redirects usually take 45–120 seconds. With the default wait of 60, most of them return 202. Send ?wait=80 and collect the rest from Tasks.
  • It is free. The price is the same as without it.
  • JSON only. With "format": "raw" the request is rejected with 400 INVALID_REQUEST, because the HTML is never changed.
  • A link that cannot be resolved is returned as it was, still starting with https://google.com/goto.

poison_check

Sometimes Google serves an altered results page, in which real listings are replaced by unrelated sites. It looks like an ordinary page, so rankings read from it drop for no real reason. With poison_check: true the page is compared with an unaltered version of the same search. If it was altered, the organic results are replaced with the verified ones, and each of them carries "restored": true.

  • One extra page per request, whether or not an altered page is found. Pages 1–3 with poison_check cost 4× the base price.
  • Only organic changes. ai_overview and people_also_ask are returned as they were.
  • If page 1 was altered, the later pages of a multi-page request are collected the same verified way.
  • Works with both json and raw.
  • A response without restored means the results were not replaced. It does not prove the check ran: a page that cannot be verified is returned unchanged.
{
  "keyword": "how to lose weight",
  "language": "en",
  "country": "US",
  "resolve_redirects": true,
  "poison_check": true
}

Response

JSON Format

Returns parsed search result data as one object, for single-page and multi-page requests alike.

Internal metadata fields (general, url, pagination, input) are automatically removed.

Raw Format

Returns the raw HTML content of the search results page as text/html.

{
  "organic": [
    {
      "rank": 1,
      "global_rank": 1,
      "title": "10 Best SEO Tools in 2025",
      "description": "Discover the top SEO tools for improving your website rankings...",
      "link": "https://example.com/best-seo-tools",
      "display_link": "https://example.com › best-seo-tools",
      "source": "Example.com",
      "extensions": [
        {
          "type": "site_link",
          "text": "Free Tools",
          "link": "https://example.com/free-tools",
          "description": "Start with our free SEO tools..."
        }
      ]
    },
    {
      "rank": 2,
      "global_rank": 6,
      "title": "SEO Software & Tools",
      "description": "Get more search traffic with our comprehensive SEO toolkit...",
      "link": "https://www.example.com",
      "display_link": "https://www.example.com",
      "source": "Example"
    }
  ],
  "knowledge": {
    "name": "SEO",
    "subtitle": "Search engine optimization",
    "description": "Search engine optimization is the process of...",
    "description_source": "Wikipedia",
    "facts": [{ "key": "Full name", "value": [{ "text": "Search Engine Optimization" }] }]
  },
  "people_also_ask": [
    {
      "rank": 1,
      "global_rank": 2,
      "question": "What is SEO?",
      "answer_source": "",
      "answers": []
    }
  ],
  "related": [
    { "rank": 1, "global_rank": 10, "text": "SEO tools free", "link": "https://..." }
  ],
  "ai_overview": { "markdown": "...", "references": [...], "texts": [...] },
  "images": [{ "rank": 1, "title": "SEO Diagram", "link": "https://...", "image": "https://..." }],
  "videos": [{ "rank": 1, "title": "SEO in 10 minutes", "link": "https://...", "source": "YouTube", "thumbnail": "https://...", "timestamp": "" }],
  "top_ads": [{ "rank": 1, "title": "SEO Tool", "link": "https://...", "referral_link": "https://..." }],
  "bottom_ads": [...]
}
{
  "organic": [
    { "rank": 1, "global_rank": 1, "title": "Result 1", "link": "https://...", "source": "..." },
    { "rank": 11, "global_rank": 14, "title": "Page 2 Result", "link": "https://...", "source": "..." }
  ],
  "knowledge": { "name": "...", "description": "..." },
  "people_also_ask": [{ "rank": 1, "question": "..." }],
  "related": [{ "rank": 1, "text": "Related search", "link": "https://..." }]
}

Response Fields Reference

Root-Level Fields

The response contains multiple SERP elements. Not all fields are present in every response.

FieldTypeDescription
organicarrayMain organic search results
knowledgeobjectKnowledge panel information (Wikipedia-like data)
people_also_askarray"People also ask" questions. Only the questions: answer_source is empty and answers is []
relatedarrayRelated searches at bottom of SERP
ai_overviewobjectAI-generated overview (Google AI Overviews): markdown, references, texts
imagesarrayImage carousel results
videosarrayVideo carousel results: title, link, source, thumbnail, timestamp
top_adsarraySponsored results at top of page
bottom_adsarraySponsored results at bottom of page

Organic Result Fields

FieldTypeDescription
rankintegerPosition within organic results (1-indexed)
global_rankintegerPosition across all SERP elements
titlestringResult title
descriptionstringResult snippet/description
linkstringDestination URL. Can be a Google redirect (https://google.com/goto?url=…) unless you send resolve_redirects
display_linkstringFormatted URL as displayed in SERP. Names the real site even when link is a redirect
sourcestringWebsite or source name
extensionsarraySite links: type, text, link, description
imagestringThumbnail URL, when the result shows one
durationstringVideo duration (e.g., "19:10"), for video results
restoredbooleanPresent and true only when poison_check replaced an altered page and this result came from the verified one

Error Codes

All errors return a JSON object with a human-readable message and an error code.

HTTPCodeMeaning
202—Not an error: still running after wait seconds. Poll GET /v1/tasks/{task_id} (Tasks)
200EMPTY_SERPGoogle returned no results for this query (not charged)
400INVALID_REQUESTRequest body is malformed or missing required fields, a page is out of range, or resolve_redirects was sent with "format": "raw"
400KEYWORD_REQUIREDThe keyword field is empty or missing
400INVALID_FORMATThe format field is not "json" or "raw"
401INVALID_API_KEYAuthentication failed — invalid username or password
402INSUFFICIENT_CREDITSYour account does not have enough credits
429RATE_LIMIT_EXCEEDEDToo many requests — rate limit exceeded
500INTERNAL_ERRORAn internal server error occurred
503SERP_FAILEDFailed to fetch search results
503TIMEOUTThe task did not finish within its 10-minute deadline (not charged)
{
  "error": "Your account does not have enough credits",
  "code": "INSUFFICIENT_CREDITS"
}

Credits & Rate Limits

Credits

Each request is charged the per-page price for every page from 1 to end_page, plus one page when poison_check is on. resolve_redirects is free, and mobile and desktop cost the same. If your balance is insufficient, the API returns HTTP 402.

Rate Limits

Requests are subject to per-minute and per-day limits based on your plan. Exceeding limits returns HTTP 429.

Last updated: 2026-11-18