返回目录
开源项目其他开源工具类新手

GitHub - goenning/google-indexing-script: Script to get your site indexed on Google in less than 48 hours

Google Indexing Script Use this script to get your entire site indexed on Google in less than 48 hours. No tricks, no hacks, just a simple script and a Google API. Important - This script uses Google Indexing API and it only works on pages with either

0 次阅读2026/09/16 发布
GitHub - goenning/google-indexing-script: Script to get your site indexed on Google in less than 48 hours 来源图片

社区作者 · zZz

它解决什么问题

Google Indexing Script

Use this script to get your entire site indexed on Google in less than 48 hours. No tricks, no hacks, just a simple script and a Google API.

Important

  • This script uses Google Indexing API and it only works on pages with either JobPosting or BroadcastEvent structured data.
  • Indexing != Ranking. This will not help your page rank on Google, it'll just let Google know about the existence of your pages.

Requirements

  • Install Node.js
  • An account on Google Search Console with the verified sites you want to index
  • An account on Google Cloud

Preparation

  • Follow this guide from Google. By the end of it, you should have a project on Google Cloud with the Indexing API enabled, a service account with the Owner permission on your sites.
可复制命令
Make sure you enable both Google Search Console API and Web Search Indexing API on your Google Project ➤ API Services ➤ Enabled API & Services .
  • Download the JSON file with the credentials of your service account and save it in the same folder as the script. The file should be named service_account.json

Installation

Using CLI

Install the cli globally on your machine.

命令
npm i -g google-indexing-script

Using the repository

Clone the repository to your machine.

命令
git clone https://github.com/goenning/google-indexing-script.git
命令
cd google-indexing-script

Install and build the project.

命令
npm install
命令
npm run build
命令
npm i -g .

Note Ensure you are using an up-to-date Node.js version, with a preference for v20 or later. Check your current version with node -v .

Usage

With service_account.json (recommended) Create a .gis directory in your home folder and move the service_account.json file there.

命令
mkdir ~ /.gis
命令
mv service_account.json ~ /.gis

Run the script with the domain or url you want to index.

gis < domain or url >

example

gis seogets.com

Here are some other ways to run the script:

custom path to service_account.json

gis seogets.com --path /path/to/service_account.json

long version command

google-indexing-script seogets.com

cloned repository

命令
npm run index seogets.com

With environment variables Open service_account.json and copy the client_email and private_key values.

Run the script with the domain or url you want to index.

命令
GIS_CLIENT_EMAIL=your-client-email GIS_PRIVATE_KEY=your-private-key gis seogets.com

With arguments (not recommended) Open service_account.json and copy the client_email and private_key values.

Once you have the values, run the script with the domain or url you want to index, the client email and the private key.

gis seogets.com --client-email your-client-email --private-key your-private-key

As a npm module You can also use the script as a npm module in your own project.

命令
npm i google-indexing-script

import { index } from "google-indexing-script" ; import serviceAccount from "./service_account.json" ;

index ( "seogets.com" , { client_email : serviceAccount . client_email , private_key : serviceAccount . private_key , } ) . then ( console . log ) . catch ( console . error ) ;

Read the API documentation for more details.

Here's an example of what you should expect:

Important

  • Your site must have 1 or more sitemaps submitted to Google Search Console. Otherwise, the script will not be able to find the pages to index.
  • You can run the script as many times as you want. It will only index the pages that are not already indexed.
  • Sites with a large number of pages might take a while to index, be patient.

Quota

Depending on your account several quotas are configured for the API (see docs ). By default the script exits as soon as the rate limit is exceeded. You can configure a retry mechanism for the read requests that apply on a per minute time frame.

With environment variables

命令
export GIS_QUOTA_RPM_RETRY=true

As a npm module import { index } from 'google-indexing-script' import serviceAccount from './service_account.json'

index ( 'seogets.com' , { client_email : serviceAccount . client_email , private_key : serviceAccount . private_key quota : { rpmRetry : true } } ) . then ( console . log ) . catch ( console . error )

📄 License

MIT License

💖 Sponsor

This project is sponsored by SEO Gets

— 本文由 AI 根据公开来源辅助整理,命令、版本与许可证请在使用前到原始页面复核。

安装 / 开始使用

Requirements

Preparation

  • Install Node.js
  • An account on Google Search Console with the verified sites you want to index
  • An account on Google Cloud
  • Follow this guide from Google. By the end of it, you should have a project on Google Cloud with the Indexing API enabled, a service account with the Owner permission on your sites.
可复制命令
Make sure you enable both Google Search Console API and Web Search Indexing API on your Google Project ➤ API Services ➤ Enabled API & Services .

Installation Using CLI Install the cli globally on your machine.

  • Download the JSON file with the credentials of your service account and save it in the same folder as the script. The file should be named service_account.json
命令
npm i -g google-indexing-script

Using the repository Clone the repository to your machine.

命令
git clone https://github.com/goenning/google-indexing-script.git
命令
cd google-indexing-script

Install and build the project.

命令
npm install
命令
npm run build
命令
npm i -g .

Note Ensure you are using an up-to-date Node.js version, with a preference for v20 or later. Check your current version with node -v . Usage With service_account.json (recommended) Create a .gis directory in your home folder and move the service_account.json file there.

命令
mkdir ~ /.gis
命令
mv service_account.json ~ /.gis

Run the script with the domain or url you want to index. gis < domain or url >

example

gis seogets.com Here are some other ways to run the script:

custom path to service_account.json

gis seogets.com --path /path/to/service_account.json

long version command

google-indexing-script seogets.com

cloned repository

命令
npm run index seogets.com

With environment variables Open service_account.json and copy the client_email and private_key values. Run the script with the domain or url you want to index.

命令
GIS_CLIENT_EMAIL=your-client-email GIS_PRIVATE_KEY=your-private-key gis seogets.com

With arguments (not recommended) Open service_account.json and copy the client_email and private_key values. Once you have the values, run the script with the domain or url you want to index, the client email and the private key. gis seogets.

com --client-email your-client-email --private-key your-private-key As a npm module You can also use the script as a npm module in your own project.

命令
npm i google-indexing-script

import { index } from "google-indexing-script" ; import serviceAccount from "./service_account.json" ; index ( "seogets.com" , { client_email : serviceAccount . client_email , private_key : serviceAccount . private_key , } ) . then ( console . log ) .

catch ( console . error ) ; Read the API documentation for more details. Here's an example of what you should expect: Important

Quota Depending on your account several quotas are configured for the API (see docs ). By default the script exits as soon as the rate limit is exceeded. You can configure a retry mechanism for the read requests that apply on a per minute time frame. With environment variables

  • Your site must have 1 or more sitemaps submitted to Google Search Console. Otherwise, the script will not be able to find the pages to index.
  • You can run the script as many times as you want. It will only index the pages that are not already indexed.
  • Sites with a large number of pages might take a while to index, be patient.
命令
export GIS_QUOTA_RPM_RETRY=true

As a npm module import { index } from 'google-indexing-script' import serviceAccount from './service_account.json' index ( 'seogets.com' , { client_email : serviceAccount . client_email , private_key : serviceAccount .

private_key quota : { rpmRetry : true } } ) . then ( console . log ) . catch ( console . error ) 📄 License MIT License 💖 Sponsor This project is sponsored by SEO Gets

来源教程配图

教程配图
配图 1 · 教程配图查看原图
教程配图
配图 2 · 教程配图查看原图

适用场景

学习研究
开源项目实践