Twitter 抓取參數
Web Scraper API Twitter 抓取參數
使用 Thordata 的 Web Scraper API 配置 Twitter 抓取參數,包括URL、用戶名、開始日期、結束日期等参数。
唯一標識:
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_name=x.com" ^
-d "spider_id=twitter_profiles_by-url" ^
-d "spider_parameters=[{\"url\": \"https://x.com/fabrizioromano\",\"max_number_of_posts\": \"10\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
一、產品 - 抓取 Twitter 個人資料信息:
1. Twitter - 通過 URL 抓取個人資料信息
spider_id
,所屬抓取工具(必填)
它定義了要使用的抓取工具。
請求示例:
spider_id=twitter_profiles_by-url
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_profiles_by-url" ^
-d "spider_parameters=[{\"url\": \"https://x.com/fabrizioromano\",\"max_number_of_posts\": \"10\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
url
,Profile URL(必填)
該參數用於指定待抓取的 Twitter 個人資料 URL。
請求示例:
"url": "https://x.com/fabrizioromano"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_profiles_by-url" ^
-d "spider_parameters=[{\"url\": \"https://x.com/fabrizioromano\",\"max_number_of_posts\": \"10\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
max_number_of_posts
,最大帖子數(可選)
該參數用於指定抓取帖子的最大數量。
请求示例:
"max_number_of_posts": "10"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_profiles_by-url" ^
-d "spider_parameters=[{\"url\": \"https://x.com/fabrizioromano\",\"max_number_of_posts\": \"10\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
2. Twitter -通過用户名抓取個人資料信息
spider_id
,所屬抓取工具(必填)
它定義了要使用的抓取工具。
請求示例:
spider_id=twitter_profiles_by-username
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_profiles_by-username" ^
-d "spider_parameters=[{\"user_name\": \"elonmusk\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
user_name
,Twitter 用户名(必填)
該參數用於指定待抓取的 Twitter 的個人資料用戶名。
請求示例:
"user_name": "elonmusk"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_profiles_by-username" ^
-d "spider_parameters=[{\"user_name\": \"elonmusk\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
二、产品-抓取 Twitter 帖子信息:
1. Twitter - -通過 URL 抓取帖子信息
spider_id
,所屬抓取工具(必填)
它定義了要使用的抓取工具。
請求示例:
spider_id=twitter_by-posturl_by-url
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_by-posturl_by-url" ^
-d "spider_parameters=[{\"url\": \"https://x.com/FabrizioRomano/status/1683559267524136962\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
url
,URL(必填)
該參數用於指定待抓取的 Twitter 帖子的 URL。
請求示例:
"url": "https://x.com/FabrizioRomano/status/1683559267524136962"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_by-posturl_by-url" ^
-d "spider_parameters=[{\"url\": \"https://x.com/FabrizioRomano/status/1683559267524136962\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
2. Twitter - 通過個人資料 URL 抓取帖子信息
spider_id
,所屬抓取工具(必填)
它定義了要使用的抓取工具。
請求示例:
spider_id=twitter_by-posturl_by-profileurl
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_by-posturl_by-profileurl" ^
-d "spider_parameters=[{\"url\": \"https://x.com/elonmusk\",\"start_date\": \"2023-01-15T16:31:04.000Z\",\"end_date\": \"2024-01-01\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
url
,Profile URL(必填)
該參數用於指定抓取 Twitter 帖子信息的個人資料的 URL。
請求示例:
"url": "https://x.com/elonmusk"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_by-posturl_by-profileurl" ^
-d "spider_parameters=[{\"url\": \"https://x.com/elonmusk\",\"start_date\": \"2023-01-15T16:31:04.000Z\",\"end_date\": \"2024-01-01\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
start_date
,開始日期(可選)
該參數用於指定帖子髮佈的開始時間,格式:dd-mm-yyyy,yyyy-mm-dd,應低於“end_date”。
請求示例:
"start_date": "2023-01-15T16:31:04.000Z"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_by-posturl_by-profileurl" ^
-d "spider_parameters=[{\"url\": \"https://x.com/elonmusk\",\"start_date\": \"2023-01-15T16:31:04.000Z\",\"end_date\": \"2024-01-01\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
end_date
,結束日期(可選)
該參數用於指定帖子髮佈的結束時間,格式:dd-mm-yyyy,yyyy-mm-dd,應大於“start_date”。
請求示例:
"end_date": "2024-01-01"
curl -X POST "https://scraperapi.thordata.com/builder" ^
-H "Authorization: Bearer Token-ID" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
-d "spider_name=x.com" ^
-d "spider_id=twitter_by-posturl_by-profileurl" ^
-d "spider_parameters=[{\"url\": \"https://x.com/elonmusk\",\"start_date\": \"2023-01-15T16:31:04.000Z\",\"end_date\": \"2024-01-01\"}]" ^
-d "spider_errors=true" ^
-d "file_name={{TasksID}}"
如果您需要進一步的幫助,請通過電子郵件聯繫 [email protected]。
Last updated
Was this helpful?