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}}"
urlProfile 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_nameTwitter 用户名(必填)

该参数用于指定待抓取的 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-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_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}}"
urlURL(必填)

该参数用于指定抓取 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}}"
urlProfile 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?