Skip to content

About

Google Shopping scraper in Python and Node.js: search Google Shopping, export products, prices, merchants to CSV/JSON

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Shopping Scraper (Python and Node.js)

Search Google Shopping from the command line and export every product to CSV or JSON: title, price, old price, merchant, rating, review count, delivery and the Google Shopping product_id. Give it one query or a file of queries, pick a country, filter titles by keyword, and get a spreadsheet-ready file. Python (one dependency, requests) and Node.js 18+ (no dependencies) versions are included.

Uses the CrawlerData API — you need an API key (free trial credits available at https://app.crawlerdata.com/register). Each search costs 1 credit.

Features

  • Google Shopping search results as clean rows: position, product_id, title, price, currency, old_price, merchant, rating, reviews, delivery, link
  • One query, many queries, or a text file of queries
  • 31 countries (us, gb, de, fr, ca, au, in, jp, ...) and any language
  • Keyword filters (--include, --exclude) and price filters (--min-price, --max-price, Python)
  • CSV or JSON output; --raw keeps the full API response (Python)
  • Retries on rate limits and failed jobs (failed jobs are not charged)
  • product_id in every row, ready for the sellers scraper or price tracker

Quickstart (Python)

git clone https://github.com/CrawlerData/google-shopping-scraper.git
cd google-shopping-scraper/python
pip install -r requirements.txt

export CRAWLERDATA_API_KEY="your_api_key"        # PowerShell: $env:CRAWLERDATA_API_KEY="your_api_key"

python google_shopping_scraper.py "wireless earbuds"
python google_shopping_scraper.py --input ../examples/queries.txt --country us -o products.csv
python google_shopping_scraper.py "espresso machine" --exclude "pods,descaler" --format json -o products.json

Quickstart (Node.js 18+)

cd google-shopping-scraper/node
export CRAWLERDATA_API_KEY="your_api_key"

node google-shopping-scraper.mjs "wireless earbuds" --exclude case,cover -o products.json
node google-shopping-scraper.mjs --input ../examples/queries.txt -o products.csv

No npm install needed: the script only uses Node's built-in fetch.

Sample output

Real run on 13 October 2026 with examples/queries.txt (wireless earbuds, espresso machine), country us:

$ python google_shopping_scraper.py --input ../examples/queries.txt -o products.csv
'wireless earbuds' (us): 22 products, 22 kept
'espresso machine' (us): 55 products, 55 kept
Wrote 77 products to products.csv. Credits used: 2
query position title price old_price merchant rating reviews
wireless earbuds 1 Bose QuietComfort Ultra Wireless Noise Cancelling Earbuds 299 Lenovo 4.7 3100
wireless earbuds 2 Samsung Galaxy Buds3 FE 117.29 150 Best Buy 3.1 25000
wireless earbuds 4 Jlab Go Pop+ True Wireless Earbuds Bluetooth 19.99 27 Lowe's 5 4300
espresso machine 1 Jura E6 Automatic Coffee Machine 1898.95 CooksWarehouse.com 4.6 1500
espresso machine 2 Philips Cafe Aromis 8000 Series Fully Automatic Coffee Machine 1999.95 Sur La Table 4.6 274

The first rows of the CSV are in examples/sample-products.csv. JSON output is an array of the same objects:

{
  "query": "wireless earbuds",
  "country": "us",
  "position": 2,
  "product_id": "7580511071886337697",
  "title": "Samsung Galaxy Buds3 FE",
  "price": 117.29,
  "currency": "USD",
  "old_price": 150,
  "merchant": "Best Buy",
  "rating": 3.1,
  "reviews": 25000,
  "delivery": "Free delivery",
  "link": "https://www.google.com/search?ibp=oshop&q=gid:7580511071886337697&prds=..."
}

How many products come back depends on the query and on Google (22 and 55 in the run above). Google Shopping loads more results by scrolling, not by pages, so there is one request (and one page) per query.

Cost per run

1 credit per query, whatever the number of products returned. The sample run above used 2 credits. 1,000 queries cost 1,000 credits, which is $1.00 on the smallest pack and down to $0.30 on the largest (pricing). Failed jobs are free.

Options

Option Default Description
queries One or more search terms
-i, --input FILE Text file, one query per line (# lines are skipped)
-c, --country us 2-letter country code: us, gb, ca, au, de, fr, nl, it, es, pt, be, at, ch, se, no, dk, fi, ie, pl, cz, il, ae, in, jp, kr, sg, mx, br, nz, za, tr
-l, --language en 2-letter language code
-o, --output products.csv Output file; .json writes JSON
-f, --format from extension csv or json (Python)
--include Comma-separated words every title must contain
--exclude Comma-separated words that drop a product (e.g. case,refurbished)
--min-price, --max-price Price range filter (Python)
--raw off JSON only: full API result per query, including base64 thumbnails (Python)

Tips

  • Search by brand and model, not by barcode. Searching Google Shopping for a bare GTIN/UPC often returns unrelated products. "sony wh-1000xm5" works much better than "027242923782".
  • Use --include / --exclude. Shopping results mix in accessories, other sizes and bundles. --include xm5 --exclude case,cushion keeps only what you want.
  • Next step: each row has a product_id. Pass it to the sellers scraper to get every seller's price, shipping and total for that product.

Calling the API directly

curl -X POST https://api.crawlerdata.com/v1/jobs \
  -H "Authorization: Bearer $CRAWLERDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"endpoint":"google-shopping-search","params":{"query":"wireless earbuds","country":"us"},"queue":"live"}'

The live queue returns {job, result} in the same response. For large batches use "queue": "fast" or "regular" and poll GET /v1/jobs/{id} (or pass a postbackUrl); crawlerdata_client.py has submit() and wait() helpers. All queues cost the same.

Troubleshooting

Problem Fix
HTTP 401 The API key is missing or wrong. Check echo $CRAWLERDATA_API_KEY (or $env:CRAWLERDATA_API_KEY in PowerShell) and create a key under API Access in the dashboard.
HTTP 402 You are out of credits. Buy a credit pack in the dashboard (from $1.00 down to $0.30 per 1,000 credits, see pricing).
HTTP 429 Rate limit: 100 requests per minute and 20 per second per key. The client waits until X-RateLimit-Reset and retries automatically; for big batches, spread requests out.
Timeouts Live requests return when Google has been fetched: a few seconds for search, 30 to 120 seconds for Google Shopping sellers. The client uses a 200 second timeout.
job ... failed The HTTP call worked but the job did not (for example Google blocked that attempt). Failed jobs cost 0 credits and the client retries them twice before giving up.

Links

More CrawlerData examples

Repo What it does
google-shopping-scraper Search Google Shopping, export products to CSV/JSON (Python + Node.js)
google-shopping-sellers-scraper Every seller and price for one product, as a comparison table
google-shopping-price-tracker Scheduled price history in SQLite, CSV export and an HTML chart
competitor-price-monitoring Your catalog vs Google Shopping sellers, with undercut alerts
map-violation-monitor Flag sellers below MAP with timestamped evidence
google-search-scraper Google SERP to JSON/CSV: organic, ads, People Also Ask, AI Overview (Python + Node.js)
google-rank-tracker Daily keyword positions by country and device, with a change report
google-local-business-leads Google Local results to a lead list CSV
google-news-scraper Brand and keyword news monitoring to CSV and JSON Feed
google-search-mcp-server Connect Claude, Cursor or n8n to the CrawlerData MCP server
crawlerdata-examples Python, Node.js and curl snippets for every endpoint

License

MIT. See LICENSE. Google Shopping is a trademark of Google LLC; this project is not affiliated with Google.

About

Google Shopping scraper in Python and Node.js: search Google Shopping, export products, prices, merchants to CSV/JSON

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages