# Google Search Results Scraper (`flashdata/google-search`) Actor

Scrape Google Search results as structured JSON with titles, URLs, snippets and rankings. Customize country, language, location and time filters. Requires a FlashData API key and Credits; Apify usage is billed separately.

- **URL**: https://apify.com/flashdata/google-search.md
- **Developed by:** [FlashData](https://apify.com/flashdata) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Search Results Scraper

Turn a Google search query into a dataset you can review, export or use in your workflow. Find relevant pages for web research, competitor analysis and market research, with controls for where and when to search.

### Key features

- **Structured results:** titles, URLs, snippets and search positions, with one organic result per dataset row.
- **Localized searches:** set the country, interface language and geographic location.
- **Time filters and pagination:** narrow the time range, choose a results page and request up to 100 results. Availability depends on the search response.
- **Export and integration:** download JSON or CSV, or start runs and retrieve results through the Apify API.

### Example output

The **Organic search results** dataset contains rows in this format. This is an illustrative example, not a live search result:

```json
{
  "query": "battery recycling research",
  "position": 1,
  "title": "Example battery recycling research",
  "link": "https://example.com/battery-recycling",
  "snippet": "An illustrative summary of a research page.",
  "request_id": "req_example"
}
```

**Complete search response** contains the full response, including additional SERP fields such as related searches and People Also Ask when available.

### Quick start

1. Get a [FlashData API key](https://flashdata.dev/app/api-keys) with `google_search` access and available Credits.
2. Enter your **Search query** and key in the encrypted **FlashData API key** field. Adjust optional settings if needed.
3. Click **Start**, then open **Organic search results** to view or export the data.

Example input for one search:

```json
{
  "flashdataApiKey": "YOUR_FLASHDATA_API_KEY",
  "query": "battery recycling research",
  "num": 10,
  "gl": "us",
  "hl": "en"
}
```

### Input parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `query` | Yes | One search query, 1–2,000 characters. |
| `flashdataApiKey` | Yes | Your FlashData API key, stored as encrypted input. |
| `num` | No | Requested result count: 1–100. Default: 10. |
| `page` | No | Results page: 1–100. Default: 1. |
| `gl` | No | Two-letter country code, e.g. `us`, `gb` or `sg`. |
| `hl` | No | Google interface language, e.g. `en` or `zh-cn`. |
| `location` | No | Geographic location, e.g. `Singapore` or `New York`. |
| `tbs` | No | Time or other Google filter, e.g. `qdr:d` (past day), `qdr:w` (week) or `qdr:m` (month). |
| `autocorrect` | No | Allow spelling correction. Omit to use the provider's behavior. |

Each run handles one query and one page. Use separate runs for additional queries or pages.

### Pricing

Searches use Credits from your FlashData account at your applicable [FlashData rate](https://flashdata.dev/pricing). This Actor adds no service fee. **Apify compute, storage and other platform usage are billed separately** under your Apify plan.

Clicking **Start** performs the search directly. A new run is a new request; additional queries and pages incur separate usage.

### FAQ

**Why did I receive fewer results than requested?**

`num` is a requested count, not a guarantee. The response may contain fewer organic results or none. Check **Complete search response** for the full result.

**Does this return full articles?**

It returns search results and snippets. Fetching the full text of linked pages requires a separate tool.

**Are related searches and People Also Ask included?**

When the provider returns them, they are preserved in **Complete search response**. The dataset table contains organic results only.

**What should I do if a run fails?**

For authentication errors, check that your key is active, has `google_search` access and sufficient Credits. After a timeout or interrupted run, check the saved response and FlashData Jobs/usage before starting again: the request may already have been charged. Restarting the same run does not automatically repeat an attempted search; starting a new run can create another charge.

### Support

For help, open an issue on this Actor or email <support@flashdata.dev> with the run URL or request ID. Keep API keys out of support messages and shared run data.

[API documentation](https://flashdata.dev/docs/sources/google_search) · [Terms](https://flashdata.dev/legal/terms) · [Privacy](https://flashdata.dev/legal/privacy)

This is an independent FlashData integration, not an official Google product.

# Actor input Schema

## `query` (type: `string`):

One search query, e.g. AI agent tools or site:github.com MCP server.

## `flashdataApiKey` (type: `string`):

Requires google_search access. Get your key: https://flashdata.dev/app/api-keys

## `num` (type: `integer`):

Maximum results to request (1–100). Actual count may be lower.

## `page` (type: `integer`):

Results page number, starting at 1.

## `gl` (type: `string`):

Two-letter country code, e.g. us, gb or sg.

## `hl` (type: `string`):

Google interface language, e.g. en or zh-cn.

## `location` (type: `string`):

Search location, e.g. Singapore or New York.

## `tbs` (type: `string`):

Google filter, e.g. qdr:d (past day), qdr:w (week), qdr:m (month).

## `autocorrect` (type: `boolean`):

Allow Google to correct spelling.

## Actor input object example

```json
{
  "num": 10,
  "page": 1
}
```

# Actor output Schema

## `results` (type: `string`):

Organic search results, exportable as JSON or CSV.

## `response` (type: `string`):

Complete search response, query, request ID and usage when returned.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("flashdata/google-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("flashdata/google-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call flashdata/google-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,flashdata/google-search"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Z2M705IR2oQj98zfZ/builds/CfX0O4KfxcUKWfhCa/openapi.json
