Skip to content
6 min read—views—reactions
SEO and promotion

Как подключить Google Search Console по API

Пошаговая настройка Google Search Console API: JSON-ключ, проверка доступа, отправка sitemap, инспекция URL и диагностика индексации.

On this page
Как подключить Google Search Console по API cover

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

  1. Go to https://search.google.com/search-console.
  2. Click "Add property.".
  3. Choose:
    • **URL prefix: https://example.com/ (recommended - more precisely).
    • Or **Domain: sc-domain:example.com.
  4. Confirm ownership rights (HTML tag, DNS, Google Analytics 4, etc.).

2. Connecting APIs through Service Account

Step 1. Create a project in Google Cloud

  1. Go to Google Cloud Console.
  2. Click on “Select Project” → “New Project”.
  3. Call it gsc-api-project. Remember Project ID.

Step 2. Enable Search Console API

  1. In the menu: “API and services” → “Library”.
  2. Find Google Search Console API
  3. Press "Enable.".

Step 3. Create a service account and a JSON key

  1. “API and Services” → “Accounts” → “Create credentials” → Service account.
  2. Name: gsc-api-bot.
  3. Roles can be skipped (or put Viewer).
  4. Press "Ready.".
  5. Open the created account → the Keys tab → Add the key → ** Create a new key** → JSON.
  6. The your-project-id-abcdef123456.json file 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!)

  1. In Search Console ** be sure to select** the desired property in the top left selector (https://example.com/).
  2. Settings (cog) → Users and permissions → Add user.
  3. Insert an email service account.
  4. Role: ** Owner (Owner) is a must!
  5. Wait 3-5 minutes.
  6. Repeat property sc-domain:example.com if 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

sql
“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

sql
“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

sql
“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

javascript
“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

sql
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)

sql
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:
    1. Create a project and key through a VPN (Europe/USA).
    2. Run scripts with VPS outside the Russian Federation.
    3. 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.json file 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.

Reactions

—reactions