# Google Indexer & Instant SEO Submitter (`eunit/google-indexing`) Actor

Instantly index your URLs with the Google Indexing API. Automate sitemap submissions, speed up crawling, and boost SEO rankings. Perfect for fresh content, bulk indexing, and removing dead links. Fast, secure, and pay-per-result!

- **URL**: https://apify.com/eunit/google-indexing.md
- **Developed by:** [Emmanuel Uchenna](https://apify.com/eunit) (community)
- **Categories:** Automation, SEO tools, Developer tools
- **Stats:** 36 total users, 4 monthly users, 75.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $99.00 / 1,000 successful url submissions

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Indexer & Instant SEO Submitter

This Apify Actor allows you to automatically submit URLs to the **Google Indexing API** to request crawling or removal of pages designated in your sitemap. It helps notify Google about fresh content on your site, leading to faster indexing and better search visibility.

This Actor is designed to work seamlessly with the [Sitemap Generator](https://apify.com/eunit/sitemap-generator) Actor but can also be used independently with any sitemap URL.

### Why use this Actor?

Traditional indexing can take days or weeks. This Actor forces Google to notice your content immediately.

| Feature | Standard Indexing | Google Indexer Actor |
| --- | --- | --- |
| **Indexing Speed** | 3 to 15 Days | **Minutes to Hours** |
| **Method** | Passive (Waiting for bot) | **Active (Push Notification)** |
| **Bulk Updates** | Slow & Manual | **Automated via Sitemaps** |
| **Content Priority** | Low | **High (Direct API priority)** |
| **Efficiency** | Hit or Miss | **100% submission success** |

### Features

- **Automatic Submission**: Parses XML sitemaps and submits all found URLs.
- **Dataset Integration**: Can read URLs directly from an Apify Dataset (e.g., from Sitemap Generator).
- **Google Indexing API**: Uses the official `googleapis` library for secure interaction.
- **Pay-Per-Event**: You are charged only for successful URL submissions.
- **Test Mode**: Dry-run capability to verify configuration without making API calls.

### Prerequisites

To use this Actor, you must have:

1. **Google Cloud Project**: A project with the **Indexing API** enabled.
2. **Service Account**: A Service Account created in your Google Cloud Project.
3. **JSON Key**: A JSON key file downloaded for your Service Account.
4. **Google Search Console Access**: The email address of your Service Account (e.g., `my-sa@my-project.iam.gserviceaccount.com`) must be added as an **Owner** (or Delegate) property in Google Search Console for the website you are indexing.

#### How to set up Google Service Account

1. Go to the [Google Cloud Console](https://console.cloud.google.com/).
2. Create a new project or select an existing one.
3. Navigate to **APIs & Services > Library** and search for "Web Search Indexing API". Enable it.
4. Navigate to **IAM & Admin > Service Accounts**.
5. Click **Create Service Account**, give it a name, and complete the steps.
6. Click on the newly created service account email.
7. Go to the **Keys** tab, click **Add Key > Create new key**, select **JSON**, and download the file.
8. **Important**: Copy the `client_email` from the JSON file. Go to [Google Search Console](https://search.google.com/search-console), select your property, go to **Settings > Users and permissions**, and add this email as a user with **Owner** permission.

### Input Configuration

The Actor takes the following input:

| Field | Type | Description | Required |
| --- | --- | --- | --- |
| `service_account_json` | String (JSON) | Paste the content of your Service Account JSON key file. | Yes |
| `sitemap_urls` | Array | List of direct URLs to your XML sitemaps (e.g., `https://example.com/sitemap.xml`). | No |
| `dataset_id` | String | ID of an Apify Dataset containing sitemap URLs (e.g., output from Sitemap Generator). | No |
| `action` | String | `URL_UPDATED` (default) to request indexing, or `URL_DELETED` to remove from index. | No |
| `test_mode` | Boolean | If true, simulates the process without calling Google API. Default `false`. | No |

#### Example Input

```json
{
  "service_account_json": "{\"type\": \"service_account\", ...}",
  "sitemap_urls": [
    "https://www.example.com/sitemap.xml"
  ],
  "action": "URL_UPDATED"
}

```

### Pricing

This Actor uses a **Pay-Per-Event** model. You are charged a small fee for each successful URL submission to the Google Indexing API **when the URLs are discovered via the `dataset_id` input** (e.g., from the Sitemap Generator integration). Charging is based on **unique URLs**: if the same URL appears multiple times in the dataset, it is only counted (and charged) once for successful submission. If a URL is present in both `dataset_id` and `sitemap_urls`, it is still treated as a single unique URL and is counted under the `dataset_id` source, not duplicated. URLs discovered from manually provided `sitemap_urls` alone are currently excluded from the pay-per-event charge.

### Output

The Actor pushes a summary of results to the Apify Dataset. Each item in the dataset look like this:

```json
{
  "url": "https://www.example.com/page-1",
  "action": "URL_UPDATED",
  "status": "SUCCESS",
  "error": null
}

```

### Related Actors

#### [Website Screenshotter](https://apify.com/eunit/website-screenshotter)

- **URL:** <https://apify.com/eunit/website-screenshotter>
- **Description:** Capture high-quality website screenshots. Features full-page capture, mobile emulation, custom resolutions, and export to JPG, PNG, or PDF.

#### [Fast Sitemap Generator](https://apify.com/eunit/sitemap-generator)

- **URL:** <https://apify.com/eunit/sitemap-generator>
- **Description:** Boost SEO with this automatic Sitemap Generator. Crawl any site to create XML, HTML, & TXT sitemaps. Fully compatible with this Indexer.

#### [Target Product Reviews Scraper](https://apify.com/eunit/target-reviews-scraper)

- **URL:** <https://apify.com/eunit/target-reviews-scraper>
- **Description:** Scrape product reviews and consumer sentiment from Target.com for retail market research.

### Your feedback

We are always working on improving the performance of our Actors. So if you’ve got any technical feedback or simply found a bug, please create an issue on the [Actor’s Issues tab](https://console.apify.com/actors/56Qit44Pmt67ZceDS/issues) in [Apify Console](https://console.apify.com/actors/56Qit44Pmt67ZceDS).

# Actor input Schema

## `service_account_json` (type: `string`):

Paste your Google Service Account JSON key content here.

## `sitemap_urls` (type: `array`):

List of direct URLs to your XML sitemaps.

## `dataset_id` (type: `string`):

The ID of a dataset containing sitemap URLs in XML format. For example, you can use a dataset produced by a sitemap generator actor such as https://apify.com/eunit/sitemap-generator.

## `action` (type: `string`):

The action to perform on the URLs.

## `test_mode` (type: `boolean`):

If enabled, the Actor will NOT call the Google API but will log what would have happened. Useful for verification without cost/auth.

## Actor input object example

```json
{
  "sitemap_urls": [
    "https://example.com/sitemap.xml"
  ],
  "action": "URL_UPDATED",
  "test_mode": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "sitemap_urls": [
        "https://example.com/sitemap.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("eunit/google-indexing").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 = { "sitemap_urls": ["https://example.com/sitemap.xml"] }

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

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

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

```

## CLI example

```bash
echo '{
  "sitemap_urls": [
    "https://example.com/sitemap.xml"
  ]
}' |
apify call eunit/google-indexing --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=eunit/google-indexing",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/56Qit44Pmt67ZceDS/builds/be8oz37HRJbe1addX/openapi.json
