# Gemini Scraper - Gemini Search Answers, Citations & Sources (`s-r/gemini-search`) Actor

Ask Google Gemini your questions and get the full Markdown answer plus every cited URL and domain as dataset rows. Track brand mentions and AI visibility in Gemini by question, country and language. Empty and refused answers are free.

- **URL**: https://apify.com/s-r/gemini-search.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** AI, SEO tools, Marketing
- **Stats:** 10 total users, 9 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 gemini answers

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 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

## Gemini Scraper: Gemini Search Answers and Citations

This Gemini scraper asks Google Gemini your questions as an anonymous visitor and returns the full Markdown answer together with every page Gemini cites through Google Search. Use it to monitor brand mentions, cited domains and AI visibility in Gemini by question, country and language.

### What the Gemini scraper delivers

Each question produces one answer row. That row contains the complete answer text, a nested list of unique source URLs, the anonymous model name, and the location reported by Gemini. When enabled, a separate citation row follows for each source. Both row types share the question and response identifier, making them straightforward to join in a spreadsheet, database, or reporting workflow.

This is useful for SEO teams and generative engine optimisation research: you can see whether Gemini mentions a brand, which competing domains receive citations, and which articles support a particular recommendation. Keep question wording and country consistent when comparing observations over time. A single answer is one observation of a variable service; repeated runs provide a more useful picture than treating one result as a permanent ranking.

### How to use the Gemini scraper

1. Enter your questions in `queries`, one per line. Write them the way a customer would ask Gemini, for example "best running shoes for flat feet" or "which CRM is best for a small agency".
2. Pick the visitor `country` and interface `language`.
3. Leave `citation_rows` on when you want one row per cited page, or switch it off for one row per question.
4. Start the run and download the dataset as JSON, CSV or Excel, or read it through the Apify API. Schedule the same run daily or weekly to build a history.

### Input

`queries` is required. Supply an array of question strings, or a string containing one question per line. Leading and trailing whitespace is removed and blank entries are ignored. Duplicate questions are retained, allowing repeated observations of the same wording. Each question can contain up to 2,000 characters, and a run can contain up to 10,000 questions.

`country` defaults to `us`. Use a two-letter country code such as `nl`, `gb`, or `de` to select the visitor country. Countries where Gemini is unavailable can produce a row without an answer. The `location` field records what Gemini itself reports; it can be more specific than the requested country. Explicitly conflicting country names are retried, although an unrecognised city name cannot establish the country independently.

`language` defaults to `en`. It controls Gemini's interface language, using values such as `nl` or `en-US`. Gemini also considers the language of the question when writing its answer, so this setting does not guarantee the answer language. Read `answer_language` for the language reported on the returned answer.

`citation_rows` defaults to `true`. Keep it enabled when you want a separate row per cited page. Set it to `false` when one row per question is more convenient. The answer's nested `citations` list remains available in either case. Free runs always omit the separate source rows so their row allowance can cover ten questions.

| field | type | default | meaning |
|---|---|---|---|
| `queries` | array or text | required | Questions to ask Gemini, up to 10,000 per run |
| `country` | string | `us` | Visitor country, two-letter code |
| `language` | string | `en` | Gemini interface language |
| `citation_rows` | boolean | `true` | Add one row per cited source |

The following input was used for a real observation:

```json
{
  "queries": ["best running shoes for flat feet"],
  "country": "us",
  "language": "en"
}
```

### Output

Rows carry `_type` and `record_type`. An answer has `_type: "ai_answer"` and `record_type: "answer"`; a source has `_type: "ai_citation"` and `record_type: "citation"`. Every row includes `source: "gemini-search"`, `engine: "gemini"`, `query`, `country`, `language`, and a UTC `fetched_at` timestamp.

Answer rows contain `answer_shown`, `answer_text`, `citations`, and `citation_count`. The answer retains Markdown headings, lists, emphasis, links, and tables. Interface placeholders and code execution transcripts are removed. Optional `products` contain shopping cards when Gemini returns them, including product title, price, currency, rating, review count, brand, merchant, and Google Shopping URL where available. Shopping cards are additional observations; they are not promised for every country or question.

Each citation includes `url`, `domain`, `title`, `position`, and `section`. Inline sources support answer text and can include that fragment in `block`, a site name, and an excerpt. Sources marked `searched` were consulted through Google Search and may not support a particular text fragment. URLs are deduplicated after removing their fragments. Inline sources come first, ordered by their first supported fragment, followed by additional searched sources.

`answer_shown` is false when no text was delivered; `answer_text` then remains an empty string. `error` identifies a missing answer or failed request. A recognised model refusal remains visible in the dataset with `refused: true` and `billable: false`, so you can distinguish refusal from an empty response without paying for that recognised refusal.

#### Example answer row

This is the real answer row from the input above. `answer_text` is shortened to its first two sentences (the full Markdown answer is 3,471 characters) and `citations` to the first of its seven sources.

```json
{
  "source": "gemini-search",
  "engine": "gemini",
  "query": "best running shoes for flat feet",
  "country": "us",
  "language": "en",
  "fetched_at": "2026-10-04T22:55:46.935Z",
  "answer_text": "When you have flat feet, your arches tend to collapse inward when you walk or run—a motion known as **overpronation**. To keep your feet, ankles, and knees comfortable and injury-free, you generally want to look for **stability running shoes**.",
  "citations": [
    {
      "url": "https://www.marathonsports.com/blog/best-stability-running-shoes",
      "title": "Best Stability Running Shoes of 2026 - Marathon Sports",
      "domain": "marathonsports.com",
      "position": 1,
      "section": "inline",
      "block": "To keep your feet, ankles, and knees comfortable and injury-free, you generally want to look for **stability running shoes**.",
      "site_name": "Marathon Sports",
      "snippet": "Designed with long runs in mind, the New Balance Fresh Foam 860 v15 is \nperfect for anyone who is going to spend a lot of time on their feet in \ntheir running sho..."
    }
  ],
  "products": [],
  "answer_language": "en",
  "model": "3.5 Flash-Lite",
  "location": "New York, USA",
  "conversation_id": "c_79d1cd1f77aabdb0",
  "response_id": "r_dabd2bd50eefa454",
  "error": null,
  "_type": "ai_answer",
  "record_type": "answer",
  "answer_shown": true,
  "citation_count": 7,
  "refused": false,
  "billable": true
}
```

The seven cited domains of that answer, in order: marathonsports.com and runweekly.com (inline), then flawlessshoereviews.com, fleetfeet.com, alastairrunning.com, runtothefinish.com and prevention.com (searched).

#### Example citation row

```json
{
  "source": "gemini-search",
  "engine": "gemini",
  "query": "best running shoes for flat feet",
  "country": "us",
  "language": "en",
  "fetched_at": "2026-10-04T22:55:46.935Z",
  "url": "https://www.marathonsports.com/blog/best-stability-running-shoes",
  "title": "Best Stability Running Shoes of 2026 - Marathon Sports",
  "domain": "marathonsports.com",
  "position": 1,
  "section": "inline",
  "block": "To keep your feet, ankles, and knees comfortable and injury-free, you generally want to look for **stability running shoes**.",
  "site_name": "Marathon Sports",
  "snippet": "Designed with long runs in mind, the New Balance Fresh Foam 860 v15 is \nperfect for anyone who is going to spend a lot of time on their feet in \ntheir running sho...",
  "_type": "ai_citation",
  "record_type": "citation",
  "response_id": "r_dabd2bd50eefa454"
}
```

A question asked from a country where Gemini is unavailable returns an answer row with `answer_shown: false`, an empty `answer_text`, `error: "unsupported_region"` and `billable: false`.

### Use cases

#### Gemini brand visibility and AI visibility tracking

Run the questions your customers ask ("best project management tool for agencies", "is brand X reliable") on a schedule and count how often your brand appears in `answer_text` and how often your domain appears in `citations`. Compare countries by running the same questions with a different `country`.

#### Gemini citations for SEO and GEO

The citation rows show which pages Gemini relies on, split into sources that support a specific sentence (`inline`) and pages it consulted during Google Search (`searched`). That tells content teams which competitor articles earn citations and which of their own pages are missing.

#### Research and content

Collect Gemini answers for a list of topics to see how the answer is structured, which products it recommends, and which shopping cards it shows for commercial questions.

### Gemini scraper compared with the alternatives

| option | what you get |
|---|---|
| This Gemini scraper | The answer an anonymous visitor sees on gemini.google.com, with cited URLs and domains as dataset rows, per country |
| Gemini API with Google Search grounding | A developer API answer from a model you choose, with its own grounding sources; it is not the consumer Gemini answer and needs your own key and code |
| AI visibility tracking platforms | Dashboards across several AI assistants on a monthly subscription; less control over questions, countries and raw data |
| Other Gemini scrapers in the Apify Store | Similar answer and source data; compare the per-answer price and whether empty or refused answers are charged |

### Pricing

The primary event is `ai_response`: one event for each delivered, non-empty answer with `billable: true`. Separate citation rows, empty answers, and recognised refusals do not add events. There is no scraper start event. The current event price is shown in the Apify Store pricing panel; the dataset fields make the counted result explicit.

A free run is capped at ten questions and ten answer rows. Each answer still contains its nested sources. Paying runs can include all requested questions and the separate citation rows. Asking for more sources does not multiply the answer event count. A failed request can retain an empty answer row for reporting while producing zero answer events.

### Limits and interpretation

The scraper observes anonymous Gemini, which currently reports a Flash-Lite model. It does not select a paid model or reproduce a signed-in account's personal context. Sources and recommendations can change between runs. Country, question wording, answer language, and retrieval time should all be considered when comparing results. The scraper preserves Gemini's claims; it does not verify the factual accuracy of the generated text.

Refusal recognition is conservative and depends on explicit wording at the beginning of the answer. The captured English refusal is covered by regression tests. English, Dutch, German, French, Spanish, and Portuguese phrases are recognised, but unseen phrasing or other languages may require additional coverage. Consult `refused` and `billable` when auditing the result.

### FAQ

#### Do I need a Google account?

No. Results are collected from the anonymous Gemini experience, without account-specific history or preferences.

#### Is this the same as the Gemini API?

No. The Gemini API answers developers through a model they select. This Gemini scraper returns what the public Gemini chat shows an anonymous visitor, which is the answer your customers see.

#### Why are some answers missing citations?

Gemini does not search the web for every question. Arithmetic or general knowledge answers can contain text while returning an empty citations list.

#### Can I export one row per question?

Yes. Set `citation_rows` to false. The nested sources remain on each answer. When source rows are enabled, filter `record_type` to `answer` for the same question-level view.

#### Are refusals and unsuccessful questions charged?

Empty results and recognised refusals produce zero answer events. The refusal text is retained for analysis. Recognition depends on explicit wording, as described above.

#### Which countries and languages are supported?

Any country where Gemini is available, by two-letter code. In countries where Gemini is not offered, the row reports `unsupported_region` and is free. The answer language mostly follows the language of the question.

#### Can I compare brand visibility over time?

Yes. Run a consistent set of questions and countries at regular intervals, then compare answer text and cited domains using the retrieval timestamp. Repeat observations to account for ordinary variation in Gemini's output.

# Actor input Schema

## `queries` (type: `array`):

Questions, as a list or one question per line. Blank entries are ignored; duplicate questions are retained.

## `country` (type: `string`):

Two-letter country code selecting the country of the visitor. Gemini must support the selected country.

## `language` (type: `string`):

Gemini interface language (hl), such as en or nl-NL. Answer language also depends on the question.

## `citation_rows` (type: `boolean`):

Include one separate row per source, in addition to nested citations. Free runs retain nested citations but omit separate source rows.

## `cursor` (type: `string`):

Position in the normalized question list. Send next_cursor from the previous response to continue.

## Actor input object example

```json
{
  "queries": [
    "best running shoes for flat feet"
  ],
  "country": "us",
  "language": "en",
  "citation_rows": true
}
```

# Actor output Schema

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

Gemini answer and source rows.

## `output` (type: `string`):

Counts and run status.

# 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 = {
    "queries": [
        "best running shoes for flat feet"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/gemini-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 = { "queries": ["best running shoes for flat feet"] }

# Run the Actor and wait for it to finish
run = client.actor("s-r/gemini-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 '{
  "queries": [
    "best running shoes for flat feet"
  ]
}' |
apify call s-r/gemini-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/gemini-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/Lsud1RgEXseS2kO7K/builds/T1ZluDDq4ShIsuSC6/openapi.json
