Method: index.inspect

查看所提供網址的已建立索引或可建立索引狀態。目前只有 Google 索引中的版本狀態可供使用,您無法測試線上網址的可索引性。

HTTP 要求

POST https://searchconsole.googleapis.com/v1/urlInspection/index:inspect

這個網址使用 gRPC 轉碼語法。

要求主體

要求主體的資料會採用以下結構:

JSON 表示法
{
  "inspectionUrl": string,
  "siteUrl": string,
  "languageCode": string
}
欄位
inspectionUrl

string

必要欄位。要檢查的完整網址。必須位於「siteUrl」中指定的屬性下方。

siteUrl

string

必要欄位。Search Console 中定義的資源網址。請注意,網址前置字元資源必須包含結尾的 / 符號。 示例: https://www.example.com/ 適用於網址前置字元資源,如果是網域資源,則為 sc-domain:example.com

languageCode

string

選用設定。IETF BCP-47 語言代碼,代表已翻譯問題訊息的要求語言,例如「en-US」、「de-CH」。預設值為「en-US」。

回應主體

如果成功,回應主體即會包含具有以下結構的資料:

索引狀態檢查回應。

JSON 表示法
{
  "inspectionResult": {
    object (UrlInspectionResult)
  }
}
欄位
inspectionResult

object (UrlInspectionResult)

網址檢查結果。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/webmasters
  • https://www.googleapis.com/auth/webmasters.readonly

詳情請參閱 OAuth 2.0 總覽