google-browser-scraper
Self-hosted Google search scraper for Python. Scrape Google SERP results with a real Chrome browser and your own residential proxy. Self-hosted SERP API alternative with JSON output, an HTTP API and an MCP server for AI agents.
Install / Use
claude mcp add nodemaven -- npx -y github:nodemaven/google-browser-scraperIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Our assessment of google-browser-scraper
google-browser-scraper scores 86/100 on our quality scale, 1851st of 2,900 Automation skills we index.
Its MCP Server is 10 KB long, well organised into 16 sections with 11 code examples: a thorough specification that gives an agent plenty to work with.
It has 45 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated today, so google-browser-scraper is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 97/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
google-browser-scraper compared with similar skills
All 4 of these similar skills score higher than google-browser-scraper; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| google-browser-scraper (this skill)by nodemaven | 86 | 45 | today | MCP Server |
| Agent-Reachby Panniantong | 100 | 99.4k | 4d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 76.0k | 2d ago | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.5k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 88.6k | today | MCP Server |
Frequently asked questions
- How do I install google-browser-scraper?
- Run
claude mcp add nodemaven -- npx -y github:nodemaven/google-browser-scraper. The install tabs above show the steps for each supported agent. - Which AI agents does google-browser-scraper work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is google-browser-scraper safe to use?
- It is MIT-licensed and scores 97/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is google-browser-scraper still maintained?
- The repository was last updated today, so google-browser-scraper is actively maintained.
Skill content
View source on GitHubgoogle-browser-scraper
Self-hosted Google search scraper for Python. Scrape Google search results (SERP) with a real Chrome browser and your own residential proxy, and get clean JSON back. Use it as a CLI, a Python library, a local HTTP API, or an MCP server that gives AI agents live Google search.
Plain HTTP is no longer a reliable way to scrape Google: it often expects a browser that runs JavaScript, and a fresh browser on a fresh proxy exit can be refused quickly. This tool takes a browser path instead. It warms a sticky proxy session with ordinary browsing, opens Google's results page for each query in that browser, checks whether Google served results or refused, and writes one JSON record per results page. Captchas, blocks and failures are reported as such, never as "no results".
google-browser-scraper doctor shows what your machine looks like to a website.
Features
- Real browser scraping: real Chrome via Patchright, with a warm-up before every new identity
- Bring your own proxy: any residential proxy with sticky sessions, built-in NodeMaven support
- Self-hosted SERP API alternative with JSON:
organic_results,ads,related_questions,related_searches,pagination - Honest failures: captchas and blocks come back labeled, not as empty results
- Cost tracking: bytes per page and cost per 1000 pages in every run summary
- Four ways to run it: CLI, Python library, HTTP API, MCP server for AI agents
- Docker image for self-hosted deployment
Use cases
- SEO rank tracking and SERP monitoring for your own keywords
- Keyword and competitor research from live Google results
- Web search for AI agents and LLM apps through MCP
- A self-hosted alternative to paid Google search APIs when you already pay for proxies
Install
pip install google-browser-scraper
patchright install chromium
Quickstart
You need a residential proxy with sticky sessions. Put {session} where
your provider expects a session id in the username:
google-browser-scraper search "best running shoes" \
--proxy "http://USER-session-{session}:PASS@gate.example.com:7000" \
-o results.jsonl
Success is a results.jsonl with one JSON object per results page:
{
"search_metadata": {"status": "Success", "page_verdict": "ok"},
"search_parameters": {"engine": "google", "q": "best running shoes", "page": 1},
"organic_results": [
{"position": 1, "title": "...", "link": "https://...", "snippet": "..."}
],
"related_questions": [{"question": "..."}],
"exit": {"session": "...", "queries_on_exit": 1, "bytes": "..."}
}
The first query takes a few minutes, because a new exit is warmed up first, and the warm-up costs noticeably more traffic than a search. Later queries on the same exit take seconds. A summary of pages served and traffic used, with the hosts that took most of it, is printed at the end of every run.
With NodeMaven, the session id is handled for you and the credentials come from the environment:
pip install "google-browser-scraper[nodemaven]"
export NODEMAVEN_LOGIN=... NODEMAVEN_PASSWORD=...
google-browser-scraper search -f queries.txt --nodemaven --country us -o results.jsonl
To try it without a proxy, use your own connection:
google-browser-scraper search "best running shoes" --no-proxy
Google then sees one address for every query, so it starts answering with
captchas sooner than it would across a pool of exits. Those pages come back as
captcha in page_verdict, not as empty results.
From Python:
from google_browser_scraper import ProxyTemplate, Scraper, Settings
proxy = ProxyTemplate("http://USER-session-{session}:PASS@gate.example.com:7000")
for page in Scraper(proxy, Settings(pages=2)).run(["best running shoes"]):
for result in page.get("organic_results", []):
print(result["position"], result["title"], result["link"])
What you get
The schema is intentionally SerpApi-like: organic_results, ads,
related_questions, related_searches, pagination and search_metadata, so
simple consumers can often switch with minimal mapping. Knowledge panels,
shopping, images and other special blocks are not parsed.
Each record also has an exit block: which proxy session answered and how many
bytes the page cost. search_metadata.timings says where the page's time went,
in seconds per step (type, load, ready, read, parse, and links, which
overlaps the next query and is not part of total_time_taken). A query
that failed is a record too, with an error.
--format csv writes the organic results as a table, and --price-per-gb adds
the cost per 1000 pages to the summary.
How it works
- New identity: a sticky proxy session and a fresh browser profile.
- Warm-up: a few ordinary pages.
- Search: each query opens Google's results page directly, which is
faster than the search box and skips the autocomplete traffic of typing.
--direct follow-upssends an exit's first query through the box and--direct noneevery query;--inputsets how a query goes into the box (typekey by key,insertall at once,wordsword by word). - Check before parsing: the page is classified first, so a captcha or a block is reported as one and never parsed as an empty result.
- Keep or drop: an exit Google answers is reused for the next queries; an exit it refuses is dropped and the query is retried on a new one. If exit after exit is refused, the run stops instead of spending more traffic.
A served exit is kept for up to 50 queries (--max-per-exit). Every new exit
pays for a warm-up, so a short cap mostly buys more warm-up traffic. A browser
error on a search is retried once on the same exit (through Google's front page
when queries go through the search box) before the exit is dropped; a network
error drops it at once.
--workers N searches on N exits at once, one browser each, sharing one list
of queries. Each browser needs memory and CPU of its own. The run stops when
exit after exit is refused or unreachable with no worker served in between.
The command line copies the cookies of the first exit Google serves and
starts up to 10 new exits from that copy (--clone N, --clone 0 turns it
off), on new sticky sessions, instead of warming each one; all workers share
the copy. Google's acceptance follows the cookies more than the address, so a
copy usually starts out served, and costs a few MB instead of a full warm-up.
A copy refused on its first query ends the copying; the copied cookies are
used for three hours at most (--clone-max-age). A copy waits 40-60 seconds
after its browser starts before the first search.
--spare 1 warms the next exit in the background once the current one is
served, so a retired exit is replaced without waiting for a warm-up. A spare
costs a warm-up's traffic whether it is used or not.
Google wraps result links in encrypted /goto redirects. Each one is resolved
with a small request through a separate short-lived proxy session, a few at a
time, so link resolution does not touch the warmed browser session. It runs in
the background while the browser goes on to the next query; records still come
out in the order each browser searched them. --no-resolve-links skips it.
Traffic goes through a small local relay that counts bytes and blocks a large model download Chrome otherwise makes on every fresh profile.
The defaults come from measurements in proxy-benchmark.
Proxies
Any provider with sticky sessions works through --proxy and a {session}
placeholder. A proxy without one is accepted with a warning: if the exit changes
on every request, warming it does nothing. SOCKS5 needs an IP-whitelisted
endpoint, because Chrome cannot send a SOCKS5 username and password.
Run it as an API
google-browser-scraper serve --nodemaven --country us --prewarm
curl "http://127.0.0.1:8000/search.json?q=best+running+shoes"
Same record format as above. Requests run one at a time on one held identity.
Set GBS_API_KEY to require a key; without one the server only listens on
localhost.
Use it from an AI agent (MCP)
{
"mcpServers": {
"google-search": {
"command": "google-browser-scraper",
"args": ["mcp", "--nodemaven", "--country", "us", "--prewarm"],
"env": {"NODEMAVEN_LOGIN": "...", "NODEMAVEN_PASSWORD": "..."}
}
}
}
It exposes one tool, google_search(query, pages).
Docker
docker build -t google-browser-scraper .
docker run --rm google-browser-scraper doctor
docker run --rm -p 8000:8000 -e GBS_API_KEY=change-me \
-e GBS_PROXY='http://USER-session-{session}:PASS@gate.example.com:7000' \
google-browser-scraper serve --host 0.0.0.0
Check your machine
google-browser-scraper doctor
Starts the browser on a blank page, sends nothing, and reports what a website would see: whether the browser looks headless, whether WebGL works, the screen size. Google answers some machines much less than others, so run this first.
What this is not
Not a free Google Search API, and not a guarantee that every proxy exit will work. It is a browser-based collector that makes failures explicit, drops exits Google refuses, and tells you what each page cost.
Status
Early. The cloak engine (--engine cloak) is experimental; patchright is
the default.
Google changes its pages often. If results come back empty or wrong, run with
--save-html DIR and open an issue with what you see.
You are responsible for using this within Google's terms and the law where you run it.
Adding an engine
An engine joins this tool only after it has been measured on proxy-benchmark: add it there, run the warm-up ladder against Google -
python scripts/run_ladder.py --engines your-engine
- and open a pull request here with the run file. The ladder runs identities with and without the warm-up in the same hours, so the result shows whether the engine actually gets served, not whether it got lucky once.
License
MIT
Related Skills
Agent-Reach
99.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
76.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.5kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
88.6k🕷️ A Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
