# Twitter 抓取参数

Web Scraper API Twitter 抓取参数

使用 Thordata 的 Web Scraper API 配置 Twitter 抓取参数，包括URL、用户名、开始日期、结束日期等参数。

唯一标识：  &#x20;

<details>

<summary><code>token</code> ， <strong>访问令牌（必填）</strong></summary>

此参数用作 API 访问令牌，以确保抓取请求的合法性。

**请求示例：**&#x20;

`Authorization: Bearer ********************`

```sh
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}}"
```

</details>

**一、产品-抓取 Twitter 个人资料信息：**

1\. Twitter - 通过 URL 抓取个人资料信息

<details>

<summary><code>spider_id</code> ，<strong>所属抓取工具（必填）</strong></summary>

它定义了要使用的抓取工具。&#x20;

**请求示例：**

`spider_id=twitter_profiles_by-url`

```sh
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}}"
```

</details>

<details>

<summary><code>url</code> ，<strong>Profile URL（必填）</strong></summary>

该参数用于指定抓取 Twitter 个人资料的 URL。

**请求示例：**

`"url": "https://x.com/fabrizioromano"`

```sh
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}}"
```

</details>

<details>

<summary><code>max_number_of_posts</code>  ，<strong>最大帖子数（可选）</strong></summary>

该参数用于指定抓取帖子的最大数量。

**请求示例：**

`"max_number_of_posts": "10"`

```sh
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}}"
```

</details>

2\. Twitter - 通过用户名抓取个人资料信息

<details>

<summary><code>spider_id</code> ，<strong>所属抓取工具（必填）</strong></summary>

它定义了要使用的抓取工具。&#x20;

**请求示例：**

`spider_id=twitter_profiles_by-username`

```sh
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}}"
```

</details>

<details>

<summary><code>user_name</code> ，<strong>Twitter 用户名（必填）</strong></summary>

该参数用于指定待抓取的 Twitter 的个人资料用户名。

**请求示例：**

`"user_name": "elonmusk"`

```sh
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}}"
```

</details>

**二、产品-抓取 Twitter 帖子信息：**

1\. Twitter - 通过 URL 抓取帖子信息

<details>

<summary><code>spider_id</code> ，<strong>所属抓取工具（必填）</strong></summary>

它定义了要使用的抓取工具。&#x20;

**请求示例：**

`spider_id=twitter_by-posturl_by-url`

```sh
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}}"
```

</details>

<details>

<summary><code>url</code> ，<strong>URL（必填）</strong></summary>

该参数用于指定抓取 Twitter 帖子的 URL。

**请求示例：**

`"url": "https://x.com/FabrizioRomano/status/1683559267524136962"`

```sh
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}}"
```

</details>

2\. Twitter - 通过个人资料 URL 抓取帖子信息

<details>

<summary><code>spider_id</code> ，<strong>所属抓取工具（必填）</strong></summary>

它定义了要使用的抓取工具。&#x20;

**请求示例：**

`spider_id=twitter_by-posturl_by-profileurl`

```sh
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}}"
```

</details>

<details>

<summary><code>url</code> ，<strong>Profile URL（必填）</strong></summary>

该参数用于指定抓取 Twitter 帖子信息的个人资料的 URL。

**请求示例：**

`"url": "https://x.com/elonmusk"`

```sh
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}}"
```

</details>

<details>

<summary><code>start_date</code> ，<strong>开始日期（可选）</strong></summary>

该参数用于指定帖子发布的开始时间，格式：dd-mm-yyyy，yyyy-mm-dd，应低于“end\_date”。

**请求示例：**

`"start_date": "2023-01-15T16:31:04.000Z"`

```sh
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}}"
```

</details>

<details>

<summary><code>end_date</code> ，<strong>结束日期（可选）</strong></summary>

该参数用于指定帖子发布的结束时间，格式：dd-mm-yyyy，yyyy-mm-dd，应大于“start\_date”。

**请求示例：**

`"end_date": "2024-01-01"`

```sh
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}}"
```

</details>

如果您需要进一步的帮助，请通过电子邮件联系 <support@thordata.com>。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.thordata.com/doc/zh/web-scraper-api/zhua-qu-can-shu-shuo-ming/twitter-zhua-qu-can-shu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
