Facebook 擷取參數
Web Scraper API Facebook 抓取參數
使用 Thordata 的 Web Scraper API 配置 Facebook 抓取參數,包括抓取關鍵字、最近貼文、年份、抓取條數等參數。
產品:
prodect_id
,所屬抓取工具(必填)
定義了使用哪個抓取工具。
請求示例:
"spider_id":"facebook_post_by-keywords"
curl -X POST "https://scraperapi.thordata.com/builder" \
-H "Authorization: Bearer Token-ID" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "spider_info={\"spider_errors\":true,\"spider_id\":\"facebook_post_by-keywords\",\"spider_parameters\":[{\"keyword\": \"Dog\",\"recent_posts\": \"true\",\"date\": \"2025\",\"number\": \"10\"}]}" \
-d "spider_name=facebook.com" \
-d "custom_naming={{TasksID}}"
唯一標識:
token
,訪問令牌(必填)
該參數用於確保爬取請求合法性的 API 訪問令牌。
請求示例:
"Authorization: Bearer ********************************"
curl -X POST "https://scraperapi.thordata.com/builder" \
-H "Authorization: Bearer *********************************" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "spider_info={\"spider_errors\":true,\"spider_id\":\"facebook_post_by-keywords\",\"spider_parameters\":[{\"keyword\": \"Dog\",\"recent_posts\": \"true\",\"date\": \"2025\",\"number\": \"10\"}]}" \
-d "spider_name=facebook.com" \
-d "custom_naming={{TasksID}}"
關鍵字:
keyword
,關鍵詞(必填)
此參數用於指定抓取 Facebook 貼文時使用的搜尋關鍵字。
請求示例:
curl -X POST "https://scraperapi.thordata.com/builder" \
-H "Authorization: Bearer Token-ID" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "spider_info={\"spider_errors\":true,\"spider_id\":\"facebook_post_by-keywords\",\"spider_parameters\":[{\"keyword\": \"Dog\",\"recent_posts\": \"true\",\"date\": \"2025\",\"number\": \"10\"}]}" \
-d "spider_name=facebook.com" \
-d "custom_naming={{TasksID}}"
最近貼文:
recent_posts
,最近貼文(可選)
此參數用於指定是否抓取最新發布的貼文。
參數值:
true
false
請求示例:
"recent_posts": "true"
curl -X POST "https://scraperapi.thordata.com/builder" \
-H "Authorization: Bearer Token-ID" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "spider_info={\"spider_errors\":true,\"spider_id\":\"facebook_post_by-keywords\",\"spider_parameters\":[{\"keyword\": \"Dog\",\"recent_posts\": \"true\",\"date\": \"2025\",\"number\": \"10\"}]}" \
-d "spider_name=facebook.com" \
-d "custom_naming={{TasksID}}"
年份:
date
,年份(可選)
此參數用於設置抓取結果的時間範圍。預設不傳值,抓取結果為所有時間的資訊。
參數值:
2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
請求示例:
"date": "2025"
curl -X POST "https://scraperapi.thordata.com/builder" \
-H "Authorization: Bearer Token-ID" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "spider_info={\"spider_errors\":true,\"spider_id\":\"facebook_post_by-keywords\",\"spider_parameters\":[{\"keyword\": \"Dog\",\"recent_posts\": \"true\",\"date\": \"2025\",\"number\": \"10\"}]}" \
-d "spider_name=facebook.com" \
-d "custom_naming={{TasksID}}"
條數:
number
,條數(可選)
此參數用於設置抓取結果的最大數量,實際返回結果可能少於該值,具體視可獲取的數據而定。最大支持 200 條。
請求示例:
"number": "10"
curl -X POST "https://scraperapi.thordata.com/builder" \
-H "Authorization: Bearer Token-ID" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "spider_info={\"spider_errors\":true,\"spider_id\":\"facebook_post_by-keywords\",\"spider_parameters\":[{\"keyword\": \"Dog\",\"recent_posts\": \"true\",\"date\": \"2025\",\"number\": \"10\"}]}" \
-d "spider_name=facebook.com" \
-d "custom_naming={{TasksID}}"
如果您需要更多幫助,請通過電子郵件 [email protected] 聯繫我們。
Last updated
Was this helpful?