Panduan Search Console API

cara pull dan manage Google Search Console data dengan code — Search Analytics, pemeriksaan URL, Sitemaps, dan situs APIs, OAuth, quotas, dan when untuk gunakan BigQuery instead.

Pertama kali diterbitkan: 23 Jun 2026 · Terakhir diperbarui: 3 Agu 2026 · Advanced
Bahasa

untuk situs web properties, Google Search Console API exposes Search Analytics, pemeriksaan URL, Sitemaps, dan situs resources melalui OAuth 2,0. Search Analytics mengembalikan up untuk 25 000 top rows per permintaan; pemeriksaan URL adalah capped di 2 000 kueri/day dan 600/minute per property. Search Console now juga memiliki Instagram, TikTok, X, dan YouTube platform properties, tetapi Google's saat ini platform documentation melakukan not specify legacy API identifiers atau endpoint mendukung, so ini guide melakukan not claim API compatibility untuk them.

TL;DR — Search Console API adalah four REST APIs di bawah webmaster-tools/v1 — Search Analytics, pemeriksaan URL, Sitemaps, situs — semua OAuth 2,0, semua scoped untuk verified properties hanya. Search Analytics mengembalikan 1–25 000 rows per permintaan (default 1 000) tetapi “does not guarantee to return all data rows but rather top ones,” (terjemahan) “melakukan not guarantee untuk kembalikan semua data rows tetapi rather top ones,” so untuk completeness di scale Anda graduate untuk BigQuery bulk data export. pemeriksaan URL adalah hard-capped di 2 000 QPD / 600 QPM per situs — itu arithmetic adalah what gates besar-scale indeks monitoring.

Evidence for this claim The Search Console API exposes Search Analytics, Sitemaps, Sites, and URL Inspection operations. Scope: Current Search Console API surface. Confidence: high · Verified: Google Developers: Search Console API Evidence for this claim Search Analytics results are bounded by API quotas and may omit some rows; the API does not guarantee every data row. Scope: Current Search Analytics query behavior and quotas. Confidence: high · Verified: Search Console API: Search Analytics query

ini API guide adalah scoped untuk situs web properties. melakukan not assume situs, Search Analytics, pemeriksaan URL, atau Sitemaps endpoints mendukung Instagram, TikTok, X, atau YouTube platform properties until Google documents identifier dan endpoint contract.

four APIs di sebuah glance

Google’s own framing dari what API melakukan: ini lets Anda “view, add, or remove properties and sitemaps, run advanced queries for Google Search results data for the properties that you manage in Search Console, and test individual pages.” (terjemahan) “view, tambahkan, atau hapus properties dan sitemaps, run advanced kueri untuk Google hasil pencarian data untuk properties itu Anda manage di Search Console, dan test individual halaman.” itu maps cleanly onto four resources, semua di bawah webmaster-tools/v1:

  • Search Analytics API — performa report, programmatically: clicks, impressions, CTR, position oleh dimension (kueri, halaman, country, device, search appearance, date, hour).
  • pemeriksaan URL API — indeks status dari sebuah single URL, programmatic sibling dari pemeriksaan URL alat.
  • Sitemaps API — list, get, submit, dan delete sitemaps.
  • situs API — list, tambahkan, dan hapus verified properties.
Evidence for this claim The Search Console API exposes Search Analytics, Sitemaps, Sites, and URL Inspection operations. Scope: Current Search Console API surface. Confidence: high · Verified: Google Developers: Search Console API

ini exposes much dari what Anda sudah gunakan di interface — performa report dan pemeriksaan URL alat — sebagai endpoints Anda dapat script terhadap. ini isn’t sebuah 1:1 mirror, though: API doesn’t guarantee full UI parity (URL Inspection’s live test, misalnya, adalah UI-hanya — see below), dan neither API access nor automation pada -nya own guarantees pengindeksan, rankings, traffic diagnosis, atau AI-search visibilitas.

Auth: OAuth 2,0, two scopes, verified properties hanya

There’s no API key. setiap panggil adalah OAuth 2,0 — Google adalah explicit itu “all requests to the Google Search Console API must be authorized by an authenticated user.” (terjemahan) “semua permintaan untuk Google Search Console API harus menjadi authorized oleh sebuah authenticated pengguna.” Anda register sebuah app di Google Cloud, permintaan sebuah scope, dan get sebuah pendek-lived access token. Two scopes exist:

  • https://www.googleapis.com/auth/webmasters — read/write.
  • https://www.googleapis.com/auth/webmasters.readonly — read-hanya.

untuk server-untuk-server automation (sebuah nightly reporting job, sebuah indeks monitor) Anda grant sebuah service account access untuk property dan skip interactive consent flow.

untuk situs web properties, two property-identifier formats penting here too: sebuah URL-prefix property adalah passed sebagai sebuah full property URL (Google’s own contoh adalah http://www.example.com/), dan sebuah Domain property menggunakan sc-domain:example.com form — Anda memiliki untuk pass whichever form matches how property adalah verified di Search Console. Either cara, service account (atau pengguna) perlu untuk menjadi granted access untuk itu exact property; ini adalah not sebuah bypass untuk ownership atau sebuah blanket grant di seluruh setiap property pada account.

dan gate itu trips everyone up: “You must have appropriate access (owner, full, read) to any Google Search Console account that you wish to access using the API.” (terjemahan) “Anda harus memiliki appropriate access (owner, full, read) untuk apa pun Google Search Console account itu Anda wish untuk access menggunakan API.” panggil API untuk sebuah property Anda’re not verified pada dan ini mengembalikan nothing — not sebuah error Anda’ll necessarily notice, hanya empty data.

Search Analytics API — performa report, di scale

Start dengan ceiling, not convenience: Google’s own caveat adalah itu “The API is bounded by internal limitations of Search Console and does not guarantee to return all data rows but rather top ones.” (terjemahan) “ API adalah bounded oleh internal limitations dari Search Console dan melakukan not guarantee untuk kembalikan semua data rows tetapi rather top ones.” Pagination extends how far Anda dapat halaman ke itu top-rows list — ini doesn’t hapus ceiling. When Anda perlu setiap row, itu’s cue untuk reach untuk BigQuery bulk export (below), not sebuah bigger rowLimit.

di dalam itu ceiling, ini adalah masih one sebagian besar people come untuk. alasan ini beats interface adalah rowLimit parameter: “[Optional; Valid range is 1–25,000; Default is 1,000].” (terjemahan) “[Optional; Valid range adalah 1–25 000; Default adalah 1 000].” interface export caps near 1 000 rows; API gives Anda up untuk 25 000 per permintaan, dan Anda paginate past itu dengan startRow. pada sebuah situs dengan sebuah panjang tail dari kueri, itu’s difference antara seeing top dari Anda data dan seeing more dari ini — masih not semua dari ini.

Two more things shape what comes back. pertama, dataState controls freshness: final ( default) mengembalikan hanya finalized data, all mencakup fresh, recently collected data, dan hourly_all gives hourly breakdowns itu adalah explicitly partial — respons metadata flags sebuah first_incomplete_date atau first_incomplete_hour, dan Google notes nilai setelah itu poin dapat masih perubahan. kedua, Search Analytics quotas aren’t sebuah single angka: usage limits halaman splits them ke muat limits (sebuah resource-based allowance diukur di 10-minute dan 1-day chunks — wider date ranges, more dimensions, dan heavier filtering semua draw ini down faster) dan QPS/QPM/QPD permintaan-rate limits covered below. Anda dapat hit muat ceiling sebelum Anda hit permintaan-rate ceiling.

pemeriksaan URL API — dan quota itu actually constrains Anda

pemeriksaan URL API “view[s] the indexed, or indexable, status of the provided URL. Presently only the status of the version in the Google index is available; you cannot test the indexability of a live URL.” (terjemahan) “view[s] terindeks, atau dapat diindeks, status dari disediakan URL. Presently hanya status dari versi di Google indeks adalah available; Anda cannot test indexability dari sebuah live URL.” itu last clause adalah sebuah nyata scope limit, not sebuah technicality: interface’s pemeriksaan URL alat dapat run sebuah live test terhadap halaman sebagai ini exists right now; API dapat hanya report pada versi Google sudah memiliki terindeks. gunakan API untuk bangun indeks-coverage monitoring di seluruh banyak URLs — not sebagai sebuah substitute untuk UI’s live test.

Here’s where math penting. Per situs, Anda get 2 000 kueri per day dan 600 per minute. (Per project ceiling adalah far higher — 10 000 000/day dan 15 000/minute — tetapi per-situs cap adalah what bites.) jika Anda ingin monitor indeks status dari sebuah 50 000-URL situs, Anda dapat’t inspect them semua di sebuah day; Anda batch dan schedule di seluruh days, atau Anda prioritize. Few posts melakukan ini arithmetic, dan ini adalah single biggest planning constraint pada besar-scale indeks monitoring.

oleh contrast, Search Analytics adalah generous — 1 200 QPM per situs dan per pengguna — dan lainnya resources (Sitemaps, situs) sit di 20 QPS / 200 QPM per pengguna. URL Inspection adalah tight one.

Sitemaps dan situs APIs

Sitemaps API adalah management layer untuk Anda sitemaps: ini “submits a sitemap for a site,” (terjemahan) “submits sebuah sitemap untuk sebuah situs,” “deletes a sitemap from this site,” (terjemahan) “deletes sebuah sitemap dari ini situs,” “retrieves information about a specific sitemap,” (terjemahan) “retrieves informasi tentang sebuah spesifik sitemap,” dan “lists the sitemaps-entries submitted for this site, or included in the sitemap index file.” (terjemahan) “lists sitemaps-entries submitted untuk ini situs, atau disertakan di sitemap indeks file.” sitemap resource ini mengembalikan mencakup fields like path, lastSubmitted, isPending, isSitemapsIndex, lastDownloaded, warnings, errors, dan sebuah contents array — handy untuk auditing sitemap health di scale.

situs API lists, menambahkan, dan menghapus verified properties — berguna jika Anda manage banyak properties dan ingin untuk provision atau audit them programmatically.

When untuk gunakan BigQuery bulk export instead

untuk besar situs, API’s 25 000-rows-per-permintaan, top-rows-hanya model becomes sebuah ceiling. Google’s jawaban isn’t sebuah fifth API resource itu mengembalikan yang sama shape dari data — ini adalah sebuah separate, scheduled export pipeline: bulk data export untuk BigQuery. Think dari choice sebagai pull vs. scheduled push, not “API A vs. API B.” (terjemahan) “API sebuah vs. API B.” Google’s own framing: “Schedule a daily export of your Search Console performance data to BigQuery, where you can run complex queries over your data or export it to an external storage service. Using the bulk data export feature, you’ll see all the performance data available to Search Console for your property, with the exception of anonymized queries.” (terjemahan) “Schedule sebuah daily export dari Anda Search Console performa data untuk BigQuery, where Anda dapat run kompleks kueri di atas Anda data atau export ini untuk sebuah external storage service. menggunakan bulk data export fitur, Anda’ll see semua performa data available untuk Search Console untuk Anda property, dengan exception dari anonymized kueri.”

itu’s decision aturan:

  • Interface export — ~1 000 rows, quick one-off look.
  • Search Analytics API — up untuk 25 000 rows/permintaan, paginate, scriptable; great untuk moderate pada-demand pulls dan dashboards.
  • BigQuery bulk export — semua available performa data, daily, no row cap; right alat setelah Anda’ve got tens dari thousands dari halaman atau kueri.

one thing none dari them give Anda adalah anonymized kueri — istilah Google hides untuk privacy. itu’s sebuah nyata gap, not sebuah bug Anda dapat berfungsi sekitar. I know scale dari ini firsthand: sebagai Ahrefs’ Brand Ambassador I helped surface sebuah study where kami pulled semua data available dari API di seluruh sebuah very besar sample dari situs dan ditemukan Google hides keyword istilah pada sebuah besar share dari clicks. kami later dibangun itu ke Ahrefs peringkat Tracker — full history dari Anda GSC data, percent dari clicks going untuk anonymized kueri, dan sebuah custom CTR curve dibangun dari Anda own angka. When someone tells Anda API mengembalikan “all your data,” (terjemahan) “semua Anda data,” itu anonymized slice adalah honest asterisk.

umum gunakan cases

  • Automated reporting — scheduled pulls ke Sheets atau sebuah warehouse.
  • BI dashboards — Looker Studio atau BigQuery pada top dari performa data.
  • besar-scale indeks/coverage monitoring — pemeriksaan URL, batched di dalam 2 000/day quota.
  • CTR curve membangun — model expected CTR oleh position dari Anda own data.
  • Anomaly alerting — flag click/impression drops automatically.

ini adalah juga how ketiga-party alat berfungsi: when Ahrefs atau sebuah Looker Studio connector “integrates Search Console,” (terjemahan) “integrates Search Console,” mereka’re calling ini sama APIs (dan increasingly, BigQuery export) pada Anda behalf.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.