# Get Google results into a Python script with one POST request

From Python, POST to the RouterGrowth run endpoint with a Bearer key, capability seo.serp and an input of keyword and location. The response holds the results list, the SERP features and whether an AI Overview showed, ready to load into pandas. No SERP vendor SDK or second account is needed.

HTML page: https://www.routergrowth.com/tools/google-search/serp-api-python
Part of: [Google Search tools](https://www.routergrowth.com/tools/google-search.md)

## The call

[`seo.serp`](https://www.routergrowth.com/catalog/seo.serp): Live Google or Bing results for a keyword and location, with SERP features and AI Overview presence.

Price on this network: $0.0035 per results page. The exact quote is shown before every run.

## What a real run returned

Run on 2026-10-19: 9 records in 4.7 s for $0.0035. Personal fields are masked. Google in San Francisco for python web scraping tutorial: nine results, three of them YouTube videos, with tutorial blogs and a course page between them.

| position | domain | title |
|---|---|---|
| 3 | www.scrapingdog.com | Web Scraping with Python: Complete Tutorial ... |
| 4 | www.geeksforgeeks.org | Implementing Web Scraping in Python with BeautifulSoup |
| 6 | medium.com | A (Really) Gentle Introduction to Web Scraping in Python |

## How to do it

1. **Install nothing special.** requests or httpx is enough. Keep the key in an environment variable.
2. **POST the search.** Send capability seo.serp with input keyword, location and optional engine and language to /v1/run.
3. **Read the results.** result.results is a list of dicts with position, title, url, domain and snippet.
4. **Loop and store.** Iterate over a keyword list, write rows to CSV or a DataFrame, and keep run_id for audit.

## Ask it like this

- Write a Python script that checks Google in San Francisco for these 20 keywords and saves the top ten of each to CSV. (`seo.serp`)
- In Python, get keyword volumes for a seed list, then fetch the live results for the five biggest. (`seo.keywords`, `seo.serp`)

## Connect

MCP server: `https://api.routergrowth.com/mcp`

```bash
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
```

```bash
npm install -g routergrowth && routergrowth setup
routergrowth run -c seo.serp -i '{"keyword": "python web scraping tutorial", "location": "San Francisco,California,United States"}'
```

```bash
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "seo.serp", "input": {"keyword": "python web scraping tutorial", "location": "San Francisco,California,United States"}}'
```

## Worth knowing

- **Synchronous for SERP.** A search usually returns in a few seconds, so a simple blocking call works in a loop.
- **Positions are page wide.** Position counts the whole page, so a video or block can take a slot between organic results.
- **Same pattern for every capability.** Change the capability and input to call keywords, backlinks or social data with the same function.

## Questions

### Is there a Python package?

None is required. The API is JSON over HTTPS; the routergrowth CLI is there for shell use.

### How do I pick Bing?

Add engine bing to the input.

### Can I run searches in parallel?

Yes. Send requests concurrently; each is billed as its own search.

### What if a search fails?

The response says why and nothing is charged. Retry or skip that keyword.

## Related

- [Track Google positions with a weekly SERP call and a diff](https://www.routergrowth.com/tools/google-search/serp-tracker-api.md)
- [Scrape the Google results page without proxies, CAPTCHAs or parsers](https://www.routergrowth.com/tools/google-search/serp-scraping-api.md)
- [What a SERP call costs on RouterGrowth and how it is billed](https://www.routergrowth.com/tools/google-search/serp-api-price.md)
- [Give Claude, Cursor or Claude Code live Google results over MCP](https://www.routergrowth.com/tools/google-search/serp-api-mcp.md)
- [Fetch the live Bing results page for any keyword and location](https://www.routergrowth.com/tools/google-search/bing-serp-api.md)
- [A SERP API your agent calls: the live Google results page, as JSON](https://www.routergrowth.com/tools/google-search/serp-api.md)
