Endpoints

Google SERP API with AI Overview

Who ranks on a Google results page, and what the AI Overview says and cites.

The Google SERP API reads a Google results page for a keyword and returns who ranks and what the AI Overview says and cites. Pass your own domain and the answer also says where it ranks and whether the AI Overview cites it, which is what a rank tracker or AI-visibility check needs.

POST /v1/serp

Request

import requestsr = requests.post(    'https://api.snoopscan.com/v1/serp',    headers={'Authorization': 'Bearer sk_YOUR_KEY'},    json={        'keyword': 'web scraping api',        'country': 'us',        'domain': 'example.com',        'depth': 10    },)print(r.json())
const r = await fetch('https://api.snoopscan.com/v1/serp', {  method: 'POST',  headers: { Authorization: 'Bearer sk_YOUR_KEY', 'Content-Type': 'application/json' },  body: JSON.stringify({      "keyword": "web scraping api",      "country": "us",      "domain": "example.com",      "depth": 10  }),});console.log(await r.json());
curl -X POST https://api.snoopscan.com/v1/serp \  -H 'Authorization: Bearer sk_YOUR_KEY' \  -H 'Content-Type: application/json' \  -d '{    "keyword": "web scraping api",    "country": "us",    "domain": "example.com",    "depth": 10}'
Where example.com ranks for the keyword in the US, and whether the AI Overview cites it.

Parameters

FieldTypeDefaultWhat it does
keyword required string — The search to look up, as it would be typed into Google.
aiOverview boolean true Include Google's AI Overview and the pages it cites. On by default.
country string us Two-letter code of the country whose results you want, e.g. gb.
depth integer 10 How many results to read, 1 to 100.
device desktop · mobile desktop desktop or mobile.
domain string — Your site. When given, the answer says where it ranks and whether the AI Overview cites it.
language string en The language code of the results, e.g. en.
locationCode integer — Google's own geographic target ID, for somewhere finer than a country. Overrides country.

Response

{    "success": true,    "data": {        "keyword": "web scraping api",        "country": "us",        "device": "desktop",        "organic": [            {                "position": 1,                "rank": 1,                "url": "https://example.com/web-scraping-api",                "domain": "example.com",                "title": "Web Scraping API",                "description": "A page that ranks first."            }        ],        "aiOverview": {            "present": true,            "text": "The text of the AI Overview.",            "references": [                {                    "url": "https://example.com/web-scraping-api",                    "domain": "example.com",                    "title": "Web Scraping API",                    "source": "example.com"                }            ]        },        "domain": {            "domain": "example.com",            "position": 1,            "url": "https://example.com/web-scraping-api",            "citedInAiOverview": true,            "citations": [                {                    "url": "https://example.com/web-scraping-api"                }            ]        }    }}
The results, the AI Overview, and, with a domain, where it stands. The pages here are made up.
  • organic lists the results in order, with position, url, title and description.
  • aiOverview.present says whether Google showed an AI Overview. When it did, text holds it and references lists the pages it cites.
  • domain appears only when you sent one: your position (null when you are not in the results) and citedInAiOverview.

The AI Overview can be read only where the results source supports it. When it cannot be read, the answer is the organic list and a note saying so, and you are not charged for an Overview.

MCP tools

The same lookup is the googleSerp tool on the MCP server. It takes keyword, country, domain, depth (up to 30 there) and aiOverview, and answers in markdown.

Prompt Use SnoopScan to check where example.com ranks on Google for web scraping api in the US, and whether the AI Overview cites it.

Billing

A search is billed per call, and nothing is charged when no results come back. A search that reads an AI Overview costs more than one that does not. Every response carries a cost object, and Credits explains how to read it.

Replacing the Google Custom Search API? It ends on January 1, 2027. The parameter map shows how q, num, gl and lr become keyword, depth, country and language here.
Only need links and snippets? Search returns web results, with each page's content if you ask, and usually costs less per call. Use the SERP API when you need Google's own ranking order or the AI Overview.

Related