Skip to main content
skill CX Codex

scraping-google-search-results — Claude Code skill: scrape Google

Pulls Google search results for any query: URLs, titles, snippets, positions and SERP feature types. Handy when you need raw SERP data for SEO or competitor work.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add apidojo-io/apidojo-skills --skill scraping-google-search-results -a claude-code
Open on GitHub

What scraping-google-search-results does

The skill runs the apidojo/google-search-scraper actor on Apify and hands back a table of organic results plus featured snippets, People Also Ask boxes and other SERP elements. Each row carries query, position, url, title, description and type, with sitelinks, rating and reviewsCount when Google returns them.

Input is a list of search terms or ready-made search URLs. You can set countryCode (defaults to US), languageCode, maxItems, maxPagesPerQuery (defaults to 1) and mobileResults. An APIFY_TOKEN must sit in your environment or .env file, otherwise the run fails. The bundled scripts/run_actor.js waits for the actor to finish and saves output as CSV or JSON; with the Apify MCP server installed you can call the same actor through apify:run-actor.

Rankings shift with location and personalisation, so pin countryCode when you want comparable numbers across runs. A query that returns only ads or a knowledge panel gives you no organic rows — worth rewording. If Google keeps blocking, the author suggests shrinking the batch of queries per run.

What it helps with

  • collect Google results for a keyword list into one table
  • export competitor snippets and positions for an SEO report
  • check which SERP features a query triggers: PAA, featured snippet, local pack
  • gather URLs and descriptions on a topic for further reading
  • compare rankings across countries via countryCode

Example prompts for the agent

  • scrape Google results for "best espresso machine" and show me the table
  • export SERPs for these ten keywords in GB to CSV
  • which People Also Ask boxes show up for "best running shoes"?

How to install scraping-google-search-results

1Skills CLI (Vercel)

npx skills add apidojo-io/apidojo-skills --skill scraping-google-search-results -a claude-code

2Manually: put the files in place

~/.claude/skills/scraping-google-search-results/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/scraping-google-search-results/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about scraping-google-search-results

How do I install scraping-google-search-results in Claude?

Run npx skills add apidojo-io/apidojo-skills --skill scraping-google-search-results -a claude-code. The skill lands in ~/.claude/skills/scraping-google-search-results/SKILL.md.

What does scraping-google-search-results do?

It runs the Google Search scraper on Apify and returns url, title, snippet, position and SERP feature type for every result. Works for a single query or a batch of keywords.

What do I need before using it?

An APIFY_TOKEN environment variable. Optionally install the Apify MCP server, then the actor is called through apify:run-actor.

Source text

SKILL.md · Apache-2.0
---
name: scraping-google-search-results
description: >
  Scrapes Google search results for any query using apidojo's Google Search scraper on Apify.
  Triggers when the user asks to: get Google search results for a keyword, scrape SERP data
  for a query, export Google results to a dataset, fetch URLs and snippets from Google for
  a search term, get all results from a Google search, or collect Google SERP data for
  multiple keywords. Returns URL, title, snippet, position, and SERP feature type per result.
  Ideal for SEO analysts, researchers, journalists, and competitive intelligence teams.
license: Apache-2.0
metadata:
  author: apidojo
  version: "1.0"
  apify-actor: apidojo/google-search-scraper
---

# Scraping Google Search Results

Raw SERP dataset for any search query. Returns organic results, featured snippets, People Also Ask boxes, and other SERP features.

## Prerequisites

- `APIFY_TOKEN` environment variable set
- Optional: Apify MCP server installed

## Inputs

| Parameter | Type | Required | Default | Notes |
|-----------|------|----------|---------|-------|
| `startUrls` | array | Optional | `[]` | Google search URLs |
| `searchTerms` | array | Optional | `[]` | Keywords to search on Google |
| `countryCode` | string | Optional | `US` | Country for Google search (e.g. `US`, `GB`, `TR`) |
| `languageCode` | string | Optional | — | Language for results (e.g. `en`) |
| `maxItems` | number | Optional | Unlimited | Maximum results to return across all queries |
| `maxPagesPerQuery` | integer | Optional | `1` | Maximum result pages per query |
| `mobileResults` | boolean | Optional | `false` | Fetch mobile SERP layout |
| `customMapFunction` | string | Optional | — | JavaScript function to transform each output object |

## Workflow

```
Progress:
- [ ] Step 1: Normalize query list
- [ ] Step 2: Run google-search-scraper
- [ ] Step 3: Poll for SUCCEEDED
- [ ] Step 4: Deliver SERP dataset
```

### Step 2: Run the Actor


**Recommended — run_actor.js (handles waiting, output, and file saving automatically):**
```bash
# Quick answer (prints table to chat)
node scripts/run_actor.js \
  --actor "apidojo~google-search-scraper" \
  --input '{"param": "value"}'

# Save as CSV
node scripts/run_actor.js \
  --actor "apidojo~google-search-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.csv --format csv

# Save as JSON
node scripts/run_actor.js \
  --actor "apidojo~google-search-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.json --format json
```
> `APIFY_TOKEN` must be set in environment or `.env` file.

**If Apify MCP is available:**
```
Tool: apify:run-actor
Actor: "apidojo~google-search-scraper"
Input:
{
  "queries": ["query1", "query2"],
  "maxPagesPerQuery": 1,
  "countryCode": "us",
  "languageCode": "en"
}
```

**REST API fallback:**
```bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~google-search-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries": ["query1", "query2"], "maxPagesPerQuery": 1}'
```

Save `id` as `RUN_ID`. Poll until `status = SUCCEEDED`:
```bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'
```

Fetch results:
```bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"
```

### Step 3: Handle Edge Cases

- **0 organic results**: Query may trigger only ads or knowledge panels — note to user.
- **SERP features present (PAA, snippets)**: These are returned as separate result types — include them in output with `type` field.
- **Different results per country**: Specify `countryCode` explicitly when geo-specific results are needed.

## Output Format

```
# Google SERP Dataset: "<query>"
Query: <query> | Country: <cc> | Pages: N | Results: N

| Position | URL | Title | Snippet (truncated) | Type |
|----------|-----|-------|---------------------|------|
| 1        | ... | ...   | ...                 | organic |
| —        | ... | ...   | ...                 | featured_snippet |
| —        | ... | ...   | ...                 | paa |

Available fields: query, position, url, title, description, type (organic/
featured_snippet/paa/local_pack/image/video), sitelinks, rating, reviewsCount
```

## Troubleshooting

**Google CAPTCHA / blocks:** Actor handles this automatically; if persistent, reduce query batch size.
**Inconsistent positions:** SERP positions vary by location and personalization — use `countryCode` for consistency.

© apidojo · Apache-2.0 · apidojo-io/apidojo-skills

Similar skills

All skills for Browser and scraping →

From the same set22

discovering-tiktok-shop-sellers-by-niche Maps TikTok Shop sellers and products in a niche: who promotes what, which items move, where the gaps are. CX Codex +1 770installs tracking-brand-sentiment-across-platforms Pulls brand mentions from Twitter, Reddit and TikTok, scores sentiment per platform, and returns one brand health number from 0 to 100. CX Codex +1 767installs finding-tiktok-creators-by-location Finds TikTok creators and their videos by geographic location through apidojo's scraper on Apify. Useful for local campaigns and regional research. CX Codex +1 766installs tracking-google-serp-rankings A skill that pulls Google results for a keyword list: positions, URLs, titles, snippets and SERP features. Useful for SEO audits and competitor checks. CX Codex +1 763installs benchmarking-instagram-influencer-engagement Pulls recent Instagram posts and turns them into engagement benchmarks: followers, average likes and comments, ER, posting frequency. CX Codex +1 757installs monitoring-instagram-hashtag-trends Pulls Instagram posts per hashtag and works out which tags actually earn engagement. Useful when you need a hashtag set for a post or a brand comparison. CX Codex +1 740installs building-twitter-industry-watchlist Builds a curated list of key voices in an industry on X, with handle, follower count, engagement and an influence score. CX Codex +1 739installs scraping-tiktok-videos-by-hashtag Pulls TikTok videos for any hashtag or keyword through apidojo's scraper on Apify. Returns URL, views, likes, comments, shares and author per video. CX Codex +1 738installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor