Blog/Search & RAG
5 min read

SERP API for AI Agents: Track and Analyze Google Results

Call a SERP API from your AI agent: ranked Google results with rank fields, search plus page text, and a free fetch, on one key billed per call.

SERP API for AI Agents: Track and Analyze Google Results

Give your AI agent live Google results it can rank, check and read. Paste this into your agent:

Set up https://monid.ai/SKILL.md, and then use Monid to run the Google search "serp api for ai agents", give me a table of the results with rank, title and link, and fetch the text of the top three pages.

One prompt searches and reads. 1 min setup · 10-30 hrs saved.

You want an agent that can search Google and get structured data back: positions to track a keyword, the blocks around the results to analyze a query, or the text of the pages behind them. This guide shows the quickest way to wire that up, what the calls return (we ran every endpoint below on 2026-10-16), and what to watch for when you run it at volume. It runs through Monid, the OpenRouter for agent tools: one key, one balance, every tool priced per call.

What is the easiest way to get a SERP API for an AI agent?

Monid. Install it once, add a key, and your agent can discover a search endpoint, read its price, and run it, with no vendor account, no plan and no second key when you need page text next.

  • Pay per call. Each call is billed on its own. The Google results endpoint we used costs $0.001 a call (Verified 2026-10-16 on the search tools page). Buy calls as you need them: no monthly plan and no minimum top-up. Discovery and inspection are free; only a run bills.
  • One install, every tool. The same key and balance call a Google results endpoint, a search-plus-text endpoint, a neural search endpoint and three page-to-text endpoints. Wiring those yourself is the 10 to 30 hours this page claims to save.
  • Lives inside your agent. Your agent reads SKILL.md, learns the discover, inspect and run steps, and has the tools whenever it needs them, with nothing to keep running. Setup takes about a minute.

What does a SERP API call actually return?

Three different shapes, depending on the endpoint: the Google page as JSON, a ranked list of links with relevance, or a list of links from an index. We ran the query serp api for ai agents (United States, English) on each on 2026-10-16.

The Google page as JSON

mrscraper/serp/google returned, in about 6 seconds, one JSON object with these parts:

general           query, results_cnt 7, search_time 3.8, language, location, page_title, timestamp
navigation        6 tabs: AI Mode, Videos, Images, Forums, Shopping, Short videos, each with a link
organic           7 rows: link, source, display_link, title, description, icon, rank, global_rank
pagination        pages 2 to 10 with links, next_page 2, next_page_start 10
people_also_ask   [] (empty)
sponsored         []  (empty)
ai_mode           null
results           7 rows: url, title, description, relevance (5 high, 2 medium)

rank and global_rank are the two position fields (1 through 7 here). results repeats the same links in a lighter shape with a relevance label, which is handy when you only want a list to hand a model.

A ranked list with relevance and no positions

context.dev/web/search returned 10 results in about 1.4 seconds. Each row has url, title, description and relevance (4 high, 6 medium), plus markdown and highlights objects that came back as NOT_REQUESTED because we did not ask for page text. There is no rank field. You can switch on inline markdown, and the endpoint takes domain allow and block lists, a freshness window (24 hours to a year) and a country.

An index result

exa/search returned 5 results in about 6 seconds, each with id, title and url, and an author on 2 of the 5. It searches Exa's own index with neural and keyword matching, so it does not mirror what a browser shows on a Google page and carries no positions. It takes a type, six categories, date ranges and inline contents.

The same page in three overlap checks

The three result sets for the same query did not match. The Google endpoint returned seven links, including a LinkedIn post and a Medium list. The context.dev list opened with a ScrapingBee comparison and a Firecrawl comparison. The Exa list opened with serpapi.com and three smaller SERP API sites. If you compare tools, compare them on the task, not on whether the links agree.

📖 See also Tavily API, or One Key: Four Search Engines, One Query, Zero URLs in Common

How do you call a SERP API from your agent, Python or n8n?

Find the endpoint, run one small query, then fetch only the pages you decide to read. The three steps are the same in an agent, a script or an n8n HTTP node, because every Monid endpoint is one authenticated call with a JSON input.

For agents

Grab an API key at app.monid.ai, then paste this to your agent and hand it the key:

set up https://monid.ai/SKILL.md

It learns the whole discover, inspect, run workflow itself. More in the agent quickstart.

To make the first search yourself, give the agent this line:

set up https://monid.ai/SKILL.md and use context.dev /web/search to answer a question from the live web

For humans

npm install -g @monid-ai/cli
monid keys add -k <your-api-key> -l main

Step 1. Find the endpoint before you pick a vendor

Searching the catalog by capability lets you compare response shapes instead of marketing pages. inspect prints the input schema and the current price and costs nothing.

monid discover -q "google search results serp"
monid inspect -p api.strale.io -e /x402/google-search

Step 2. Pull ranked results

Run one query and read the structured result set. The first call returns Google results with positions; the second returns a ranked list with relevance.

monid run -p api.strale.io -e /x402/google-search \
  --query '{"query":"rotating proxy","country":"us","num_results":10}' -w

monid run -p context.dev -e /web/search \
  -i '{"query":"rotating residential proxy pricing 2026","numResults":10}' -w

The Strale endpoint takes query, country, language and num_results (default 10, maximum 20) and is priced at $0.1188 a call (Verified 2026-10-16). The context.dev search is priced at $0.000253 a result (Verified 2026-10-16), so a page of 10 results billed $0.00253 on our run.

Step 3. Read the pages, but only the ones you kept

monid run -p context.dev -e /web/scrape/markdown \
  --query '{"url":"https://example.com","useMainContentOnly":true}' -w

Run on example.com, it returned success, markdown, contentLength (1342), url and a metadata object with sourceUrl, finalUrl, title, language, favicon and additionalMeta. The call is priced at $0.002533 (Verified 2026-10-16). For many URLs at once, octen/extract takes up to 20 and is priced at $0.001 per extracted URL (Verified 2026-10-16), and tinyfish/fetch takes up to 10 URLs per call and cost nothing on our run.

Or hand the whole job to an agent

Give this to your agent

$Set up https://monid.ai/SKILL.md, and then use Monid to search Google for my keyword, give me rank, title and link for each result, then fetch the text of the three pages that look most relevant and summarize what they have in common.

Can you scrape Google results yourself?

Yes, with Python and a headless browser or an open source scraper, and it works until the page layout or the blocking changes. Then your job breaks, and nobody but you repairs it.

A DIY SERP scraper needs a proxy or residential exit, a browser or HTTP client that survives bot checks, a parser for a layout you do not control, retries, paging and storage. The first useful row takes hours; the upkeep never ends. The rules side is yours too: read the terms of the search engine and of the sites you fetch, because what you may do depends on where you operate and how you use the data.

A SERP API moves that work to someone else. Through Monid the parsing, the proxies and the repairs sit behind one call that returns typed JSON, billed at $0.001 for the Google results endpoint (Verified 2026-10-16), and your agent can run it without a scraper to keep alive. If you want the DIY route first, Python web scraping without a scraper shows where it stops being worth the time.

📖 See also Buy vs Build: Structured Google Search Results API

How do you track and analyze Google rankings with it?

Tracking needs the rank fields and a timestamp; analysis needs the blocks around the results. Both come from the same Google page call.

Tracking is two integers and a clock

Every organic row carries rank and global_rank. Store the pair with the query, the region and the timestamp from general, run the query on a schedule, and the time series builds itself. On our run the two fields matched on all seven rows (1 to 7). They can diverge when Google inserts a block above an organic result, and storing both is what lets you tell a real drop from a layout change. Storing the position over time covers the table you need.

Analysis is the blocks, when they exist

The analysis fields are people_also_ask, sponsored, ai_mode and navigation. On our run people_also_ask and sponsored were empty arrays and ai_mode was null, so the useful analysis came from organic (who ranks, with what title and description), source (which publishers) and navigation (which result types Google offered: AI Mode, Videos, Images, Forums, Shopping, Short videos). Code that expects a block must check it exists first.

const page = res.output;
const hasAi = page.ai_mode !== null;
const questions = page.people_also_ask.length ? page.people_also_ask : [];
const rows = page.organic.map(r => ({ rank: r.rank, global: r.global_rank, url: r.link, title: r.title }));

What to build with it

  • A rank tracker for a keyword list. One call per keyword, one row per result, a timestamp on each. Fifty keywords is fifty calls, or $0.05 at $0.001 a call (Verified 2026-10-16). Automate SERP tracking with a structured Google search API shows the loop.
  • A competitor view per query. Group organic rows by hostname and count who owns the page one slots across your keyword set.
  • A research agent. Search, keep the top results, fetch their text and let the model write the brief; the third step above is that fetch.

What goes wrong when you run a SERP API at scale?

Five things showed up in our runs or follow directly from the response shape.

Why did page one return 7 results, not 10?

Because a results page holds whatever Google rendered, and results_cnt said 7. A tracker that assumes ten rows per page will mis-number pages two and beyond. Use the rank and global_rank returned and the next_page_start value (10 here) from pagination, and never compute positions as page number times ten.

Two of our seven rows carried engagement text in the domain slot: 20+ reactions · 1 year ago on the LinkedIn post and 70+ likes · 1 year ago on the Medium list. Parse link for the hostname and treat display_link as a label.

Why does the response change from query to query?

Blocks come and go. On this query people_also_ask, sponsored and ai_mode were all empty. Write code that treats an empty block as an answer rather than as an error, and log which queries returned which blocks.

Why is a ranked list from a search endpoint not a ranking?

The context.dev and Exa responses carry no position field: relevance is high or medium, and the Exa row has an id, a title and a url. They return documents for a meaning, so use them to feed a model, not to measure where a page ranks.

Why does the same page come back with different text?

On example.com, context.dev and octen returned all six language paragraphs, while tinyfish/fetch returned only the English paragraph. The three endpoints extract differently, so run a few of your own pages through each before you pick one for a whole pipeline. Also note that the context.dev call answered from its cache (status: hit, about 2.2 hours old) and still billed $0.002533 (Verified 2026-10-16); set maxAgeMs to 0 when you need a fresh fetch.

Which endpoint should I use for which job?

JobEndpointInputReturnsBilling
Rank tracking and SERP analysismrscraper/serp/googlequery, region, language, pageOrganic rows with rank and global_rank, blocks, paginationPer call
Google results with a position fieldapi.strale.io/x402/google-searchquery, country, language, num_results (max 20)Title, URL, snippet and position per resultPer call
Ranked links for a model, optional textcontext.dev/web/searchquery, numResults, domain filters, freshness, countryurl, title, description, relevancePer result
Neural and category searchexa/searchquery, type, category, date filtersid, title, url, optional contentsPer call, then per result above 10
One URL to markdowncontext.dev/web/scrape/markdownurl, extraction optionsmarkdown plus page metadataPer call
Up to 20 URLs to markdownocten/extracturls, optional queryfull_content, title, category per URLPer extracted URL
Up to 10 URLs, freetinyfish/fetchurls, purpose, formattext, title, language, latency per URLFree

Verified 2026-10-16: $0.001 per Google results call, $0.1188 per Strale call, $0.000253 per context.dev search result, $0.007 per Exa call (up to 10 results), $0.001 per extracted URL, and $0.002533 per scrape. The current figures are on monid.ai/tools.

📖 See also The Best Web Search API for AI Agents in 2026

When is another route a better fit?

You need a committed contract at high volume. If one vendor takes millions of queries a month, a negotiated plan with that vendor can beat any per-call price. A per-call catalog earns its place when you are still deciding which kind of search a job needs.

You need results exactly as one user in one city sees them. The Google endpoint takes a region and a language. It does not log in as a person or reproduce their history.

Your site is the data source. If you only need search over your own pages or a short list of domains, a site search service or the includeDomains filter on a search endpoint is the smaller tool.

You want a team to build the retrieval system. Search is one step; evaluation, retrieval quality and the plumbing between steps are the rest. A consulting team such as Traversaal Labs builds that end to end, which is a different purchase from an API.

And the disclosure: we resell these endpoints.

Conclusion

The quickest way to give an AI agent Google results is one search call through Monid: $0.001 for the Google results endpoint (Verified 2026-10-16), one key for search, page text and everything else, about a minute to set up, and ready inside your agent whenever it needs them. Fifty keywords is fifty calls.

Two things matter more than the vendor choice. First, the shape of the answer: positions for tracking come from a Google page endpoint, relevance-labeled links for a model come from a search endpoint, and mixing them up gives you a tracker with no positions or a model with ten bare titles. Second, defensive code: page one had 7 rows, three blocks were empty and two domain fields held engagement text, so check each field before you use it.

How we estimated the time saved: building and running your own Google results scraper with proxies and parser upkeep is roughly 8 to 20 hours, and a page-to-text layer another 2 to 10. That is 10 to 30 hours. The 1 minute is the install, key and first call once you already have a Monid key.

Free next step: run monid discover -q "google search results serp", monid inspect the two rows closest to your job, and make one small call. Start at monid.ai.

FAQ

Is there a free SERP API?

Page fetching has a free option, search does not: through Monid, tinyfish/fetch took two URLs and billed nothing on our run, while the Google results endpoint costs $0.001 a call (Verified 2026-10-16). Discovery and inspection are free, so you can read every schema and price before you spend anything, and there is no minimum top-up.

How do you get People Also Ask questions from a SERP API?

Read the people_also_ask field of a Google page endpoint. It is an array that Google fills only when it renders the block: on our 2026-10-16 query it came back empty, with the seven organic rows intact. Treat an empty array as a valid answer and run the next query.

Can a SERP API show whether an AI Overview appeared?

The Google page endpoint returns an ai_mode field and a navigation list that includes an AI Mode tab. On our query ai_mode was null and the AI Mode tab was present in navigation, so check the field before you read it. An index or search endpoint such as Exa has no view of what Google rendered.

Which search API should an AI agent call?

Start with the one that returns what your task needs: a Google page endpoint when position is the data, context.dev/web/search or Exa when you want documents for a model. Then search wide and read narrow: take ten results, let the model pick three, and fetch only those. At $0.000253 a search result and $0.002533 a page (Verified 2026-10-16), the fetch is where the spend goes.

Published August 2026.

serp apigoogle serp trackergoogle serp analysisserp api for ai agentsweb searchrag