This script can be run to request a list of Urls to be indexed by Google.
It makes use of the Google API and so an account needs setting up:
- Go to https://console.developers.google.com/flows/enableapi?apiid=indexing.googleapis.com&credential=client_key
- Create a new project
- Enable API access
- Create a service account: https://console.developers.google.com/iam-admin/serviceaccounts
- Select project just created
- Click "+ create service account"
- Copy the service account ID (looks like an email address)
- Manage keys on the service account
- Create new JSON key (Choose the default JSON format)
- Add the service account as an owner on the property in Google Search Console (with Owner permission)
Make sure you have a CSV with the headings;
"Name";"Url";"title";"description";"Status";"DMCA";"Check type";"Creation Date";"Check Date";"Result"
These are the Urls from a GSC export, - not all are required by the script.
Ensure each Url has the protocol and FQDN.
- Enable/create the virtual environment;
python -m venv virtualenv # create
./virtualenv/Scripts/activate # activate on Windows
source virtualenv/bin/activate # activate on Linux
- Update the
URLS_TO_INDEX_FILE
with the path to your CSV file. - Make sure the JSON key file is passed to the FFDServiceAccount initialisation, you can use a variable for this such as
JSON_KEY_FILE_1
. - Run the script;
python ./main.py
The results will be output to the console and written to the CSV file Result
column.