Как подключить Google Search Console по API
Пошаговая настройка Google Search Console API: JSON-ключ, проверка доступа, отправка sitemap, инспекция URL и диагностика индексации.
On this page
Manual page checking in search.google.com can no longer cope with large sites. If new articles don’t make it to Google’s index and the Coverage report says “Discovered but not indexed,” it’s time to set up the Search Console API.
This opens up opportunities:
- Automatically send the sitemap.
- Check the status of any page (indexing, canonical, crawling errors).
- Get data on impressions, clicks and queries.
- Delegate all AI diagnostics (Grok, Claude, GPT, etc.).
Important warning right away The Search Console API ** does not forcibly index* regular pages (articles, products, blogs). Google’s Indexing API works ****only for pages with JobPosting or BroadcastEvent markup. For all other sites, the API only provides diagnostics, sitemap and analytics.
1. Adding a website to the Search Console
- Go to https://search.google.com/search-console.
- Click "Add property.".
- Choose:
- **URL prefix:
https://example.com/(recommended - more precisely). - Or **Domain:
sc-domain:example.com.
- **URL prefix:
- Confirm ownership rights (HTML tag, DNS, Google Analytics 4, etc.).
2. Connecting APIs through Service Account
Step 1. Create a project in Google Cloud
- Go to Google Cloud Console.
- Click on “Select Project” → “New Project”.
- Call it
gsc-api-project. Remember Project ID.
Step 2. Enable Search Console API
- In the menu: “API and services” → “Library”.
- Find Google Search Console API
- Press "Enable.".
Step 3. Create a service account and a JSON key
- “API and Services” → “Accounts” → “Create credentials” → Service account.
- Name:
gsc-api-bot. - Roles can be skipped (or put Viewer).
- Press "Ready.".
- Open the created account → the Keys tab → Add the key → ** Create a new key** → JSON.
- The
your-project-id-abcdef123456.jsonfile is downloaded.
Email service account (must copy!):
gsc-api-bot@your-project-id.iam.gserviceaccount.comXX
Step 4. Add rights to Search Console (the most common error!)
- In Search Console ** be sure to select** the desired property in the top left selector (
https://example.com/). - Settings (cog) → Users and permissions → Add user.
- Insert an email service account.
- Role: ** Owner (Owner) is a must!
- Wait 3-5 minutes.
- Repeat property
sc-domain:example.comif you use both options.
3. Put the key on the server
- Put the JSON file out of the public folder (e.g.
/etc/gsc/key.json). - Never pour into Git!
Ready-made copiers
Prompt 1. Connection check
“I have at the root of the project a file called gsc-key.json. This is a service key for the Google Search Console API. Check Full Connection: List all available properties that you can access. If errors (403, NO SITES VISIBLE, insufficient permission, etc.) – explain in detail what you need to fix in Search Console
Prompt 2. Sending sitemap
“Using the gsc-key key. json from the project, send the current sitemap.xml (and sitemap index.xml, if any) to property https://example.com/. After sending, show the result and status
Prompt 3. One-page inspection
“Visit the following page via the Search Console API using the gsc-key.json key:
https://example.com/novaya-statyaXX
Property: https://example.com/
Output the full report: indexation status, cause (if not indexed), canonical, date of last round, problems and recommendations
Prompt No. 4. Mass page inspection
“Inspect these URLs for property https://example.com/ (gsc-key.json key in the project):
- https://example.com/statya-1
- https://example.com/statya-2
- https://example.com/statya-3
For each page, summarize: Indexed / Not indexed + the main reason
**Prompt 5. Diagnosing why the site is not indexed
Do a deep diagnosis of site indexing using the gsc-key.json key.
Property: https://example.com/
Check:
Status of all sitemap
Recent mistakes in Coverage
10-15 new or problematic pages
Common causes (noindex, thin content, canonical conflicts, crawl budget, etc.)
Give a structured report with priorities and precise recommendations for correction
**Prompt 6. The universal “do everything at once” (the most convenient)
You are now my regular assistant on the Google Search Console API.
The key is in the gsc-key file. json at the root of the project.
Main property: https://example.com/
Now do this:
1. Check API availability
2. Send the current sitemap
3. Check the new pages:
4. Give a full report: what prevents indexing, what you need to correct in the template, robots.txt or content.
Take it step by step and make it clear
4. Features for users from Russia
- The Search Console API itself is not blocked in the country.
- Problems can only occur when creating a project (Google sometimes asks for verification).
- Recommendations:
- Create a project and key through a VPN (Europe/USA).
- Run scripts with VPS outside the Russian Federation.
- The service account operates without manual login.
Payment for the card is usually not required.
API limits (current as of February 2026)
- URL Inspection: 2,000 requests per day for property, 600 per minute
- Search Analytics: Up to 50,000 lines of data per request
- Sitemap submit: no hard limits
How to Use Prompts as Effectively as Possible
- Always specify the exact path to the
gsc-key.jsonfile and the exact property. - Keep one long correspondence with the AI – it will remember all previous results.
- After each action, ask for “save state” – so the AI will work faster the next time.
You can now fully automate your site’s indexing and diagnostics without writing a single line of code.
Just throw the key and throw the prompts.