Bing
SERP API Bing查詢參數
使用Thordata的SERP API配置Bing搜索查詢,包括本土化、地理位置和分頁等參數選項。
q
,搜索查詢(必填)
定義用於數據抓取的搜索查詢(默認值:q=pizza
)。支持任何語言的任意關鍵詞。
示例請求:
使用q
:pizza參數的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1\"}"
本土化
cc
,國家(非必填)
此參數用於設定搜尋結果的地區化顯示(採用兩位字母國家代碼),例如:(gl=us
:依美國用戶習慣顯示、gl=ru
:依俄羅斯用戶習慣顯示gl=uk
:依英國用戶習慣顯示)
示例請求:
查询 q
: pizza,cc
:jp的示例結果
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&cc=jp\"}"
地理位置
mkt
,語言(非必填)
此參數用於設定搜尋結果的介面顯示語言,採用標準語言代碼格式:
<語言代碼>-<國家代碼>(例如:en-US
、zh-TW
)
示例請求:
查询 q
: pizza,mkt
:fr-fr的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&mkt=fr-fr\"}"
location
,位置(非必填)
該參數定義了爬取時的起始地理位置,應與 lat
(緯度)和 lon
(經度)參數一起使用。
示例請求:
查询 q
: pizza,location
:Tokyo的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&location=Tokyo\"}"
lat
,緯度(非必填)
此參數用於設定搜尋起始位置的 GPS 緯度座標,需配合以下參數共同使用:
location
:地理位置描述lon
:經度座標(注意:原說明誤植為 lat)
示例請求:
查询q
: pizza,lat
:40.7128的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&lat=40.7128\"}"
lon
,經度(非必填)
此參數用於設定資料擷取的起始位置 GPS 經度,需搭配下列參數共同使用:
location
:地理位置文字描述lat
:緯度座標(修正說明:原內容誤將緯度參數標示為 lon)
示例請求:
查询 q
: pizza,lon
:-74.0060的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&lon=-74.0060\"}"
分頁
first
,結果偏移量(非必填)
參數用於控制自然搜索結果的偏移量,默認值為1(例如:first=10時,系統會將第10條自然搜索結果提升至首位)。
示例請求:
查询 q
: pizza,first
:10的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&first=10\"}"
count
,每頁結果數(非必填)
每頁參數用於控制每頁顯示的搜索結果數量(最小值:1,最大值:50),實際生效值會受到first偏移量參數的影響。
示例請求:
查询 q
: pizza,count
:10的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&count=10\"}"
高級篩選
adlt
,安全(非必填)
此參數用於控制搜尋結果的成人內容過濾設定,可指定下列值:
strict
:嚴格過濾成人內容off
:完全停用過濾功能
示例請求:
查询 q
: pizza,adlt
:strict的示例
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&adlt=strict\"}"
如需進一步幫助,請透過 [email protected] 聯繫我們。
Last updated
Was this helpful?