Google SERP API
POSThttps://api.01ai.cloud/serp/google
Google 搜尋 API,支援客製化搜尋條件。
請求頭
acceptstring
指定伺服器返回的回應格式。
請選擇
authorizationstring
Bearer token
請求體
typestring
搜索資源類型參數,目前支持六種類型:`search`(網頁搜索)、`images`(圖片)、`news`(新聞)、`maps`(地圖)、`places`(地點)、`videos`(視頻)。默認值為 `search`。
請選擇
querystring必填參數
搜索查询关键词。
countrystring
搜索引擎使用的國家/地區代碼,默認為 `US`(美國)。
languagestring
搜索引擎使用的語言代碼,默認為 `en`(英語)。
image_sizestring
圖片尺寸篩選條件,僅在 `type` 為 `images` 時有效。
請選擇
rangestring
搜索結果的時間範圍篩選,預設不限制時間。
請選擇
numberinteger
返回的搜索結果數量,默認為 10 條。
pageinteger
搜索結果的頁碼,默認為第 1 頁。
響應
成功200
請求成功,返回搜尋結果資料。
響應體
costobject
amountnumber
currencystring
mapsarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
newsarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
imagesarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
placesarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
videosarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
organicarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
answer_boxobject
object <string, unknown>
knowledge_graphobject
object <string, unknown>
people_also_askarray
數組
datestring
linkstring
titlestring
snippetstring
positioninteger
image_urlstring
related_searchesarray
數組
querystring
示例
{
"cost": {
"amount": 0.01,
"currency": "credit"
},
"organic": [
{
"link": "https://www.x402.org/",
"title": "x402 protocol documentation",
"snippet": "Documentation and resources for the x402 payment protocol.",
"position": 1
}
]
}失敗400token_mismatched
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "token_mismatched",
"message": "The specified token is not matched with API."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400api_not_implemented
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "api_not_implemented",
"message": "The API is not implemented."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400disabled
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "disabled",
"message": "Your application has been disabled by Ace Data Cloud due to abnormal usage behavior, please contact our support to get more information."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400bad_request
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "bad_request",
"message": "model is invalid."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗400no_token
請求錯誤,可能是參數缺失或無效。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "no_token",
"message": "No token specified for the request."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401invalid_token
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401token_expired
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "token_expired",
"message": "token expired."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗401token_mismatched
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
示例
{
"error": {
"code": "token_mismatched",
"message": "token and api does not match."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失敗403used_up
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
失敗404no_api
未授權,授權令牌無效或缺失。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
失敗429too_many_requests
請求過多,已超出速率限制。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。
失敗500api_error
伺服器內部錯誤,伺服器端發生異常。
響應體
errorobject
codestring
響應的錯誤碼。
messagestring
響應的錯誤信息。
trace_idstring
本次請求的追蹤 ID。

Integration workbench
Shell
Python
JavaScript
Java
Go
PHP
溫馨提示:對於流式請求,上面的代碼可能不完全適用。請參閱對接文檔以進行更改。
搜索引擎
允许用通用余额
啟用「允許通用餘額」後,專屬餘額不足將自動使用通用餘額。

