An open API service indexing awesome lists of open source software.

https://github.com/al3rez/indexpusher-cli

A command-line tool to automatically submit website URLs to Google's Indexing API and Bing's IndexNow API. The tool scans your website's sitemap.xml and submits all URLs for indexing to both search engines.
https://github.com/al3rez/indexpusher-cli

Last synced: 10 months ago
JSON representation

A command-line tool to automatically submit website URLs to Google's Indexing API and Bing's IndexNow API. The tool scans your website's sitemap.xml and submits all URLs for indexing to both search engines.

Awesome Lists containing this project

README

          

# Index Pusher

A command-line tool to automatically submit website URLs to Google's Indexing API and Bing's IndexNow API. The tool scans your website's sitemap.xml and submits all URLs for indexing to both search engines.

## Features

- Add and manage multiple websites
- Automatically scan sitemap.xml files
- Submit URLs to Google's Indexing API
- Submit URLs to Bing's IndexNow API
- Schedule daily automatic submissions
- Beautiful terminal interface with progress tracking
- Service account authentication for Google (no user interaction required)
- Simple key-based authentication for Bing

## Prerequisites

1. Python 3.7 or higher
2. For Google: Google Cloud Project with Indexing API enabled + Service Account credentials
3. For Bing: IndexNow API key (generated and hosted on your website)

## Installation

1. Clone the repository:
```bash
git clone https://github.com/yourusername/indexpusher.git
cd indexpusher
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

3. **Google Setup (Optional)**: Download your Service Account credentials from Google Cloud Console and save as `credentials.json` in the project directory.

4. **Bing Setup (Optional)**: Generate a Bing IndexNow key and configure it with the tool.

## Usage

### Add a website
```bash
python index_pusher.py add https://example.com
```

### Configure Bing IndexNow (one-time setup)
```bash
python index_pusher.py set-bing-key your-indexnow-key-here
```

### Verify Bing key file setup
```bash
python index_pusher.py verify-bing-key
```

### Show current configuration
```bash
python index_pusher.py show-config
```

### List monitored websites
```bash
python index_pusher.py list
```

### Submit URLs to Google and Bing
```bash
python index_pusher.py submit
```

### Remove a website
```bash
python index_pusher.py remove https://example.com
```

### Schedule daily submissions
```bash
python index_pusher.py schedule
```

## Setting up Google Cloud Service Account

1. Go to [Google Cloud Console](https://console.cloud.google.com)
2. Create a new project or select an existing one
3. Enable the Indexing API
4. Go to IAM & Admin > Service Accounts
5. Create a new service account
6. Download the JSON key file and save as `credentials.json` in the project directory
7. Grant the service account the "Indexing API User" role

## Setting up Bing IndexNow

1. Generate an IndexNow key using [Bing's online tool](https://www.bing.com/indexnow/getstarted) or use any 8-128 character hexadecimal string
2. Configure the key in the tool:
```bash
python index_pusher.py set-bing-key your-key-here
```
3. **Important**: Create a text file named `{your-key}.txt` in the root of your website containing only your key
- Example: If your key is `abc123def456`, create `https://yourwebsite.com/abc123def456.txt`
- The file content should be exactly: `abc123def456`
4. Verify setup:
```bash
python index_pusher.py verify-bing-key
```

## Commands

- `add ` - Add a website to monitor (checks for sitemap.xml)
- `set-bing-key ` - Configure Bing IndexNow API key
- `verify-bing-key` - Check if Bing key files are properly hosted
- `show-config` - Display current configuration
- `list` - Show all monitored websites
- `submit` - Submit all URLs from all monitored websites to Google and Bing
- `remove ` - Remove a website from monitoring
- `schedule` - Set up daily automatic submissions at 2:00 AM

## Notes

- **Google**: Uses service account authentication (no browser interaction required)
- **Bing**: Uses key-based authentication (requires hosting key file on your website)
- URLs are submitted with the 'URL_UPDATED' type for Google
- The tool works with either service configured independently or both together
- The scheduler uses crontab for daily execution at 2:00 AM
- Make sure your website has a valid sitemap.xml file
- Rate limiting is handled automatically for both services
- Bing IndexNow allows up to 10,000 URLs per submission