# Twitter People Search Scraper

Scrape user name, user handle, user bio, user type, user profile URL, and user avatar URL from search result "People" page via Twitter advanced search.

- Template page: [https://www.octoparse.com/template/twitter-people-search-scraper](https://www.octoparse.com/template/twitter-people-search-scraper)
- Categories: Social Media
- Status: `PUBLISHED`
- Run mode: `CLOUD`

## Pricing

Current price: **$0.3/1,000 lines**. Billing is based on output rows; an Octoparse subscription may be required.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from search-results pages.

## Output

The current workflow extracts 8 fields, including `Query_Str`, `Query_URL`, `User_URL`, `User_avatar_URL`, `User_bio`, `User_handle`, `User_name`, `User_type`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete All of these words, This exact phrase, Any of these words and start the template in cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

### All of these words

Optional. Posts must contain all of these words, separated by spaces. Constraints: minLength=0; maxLength=10000.

### This exact phrase

Optional. Posts must contain this exact phrase. Constraints: minLength=0; maxLength=10000.

### Any of these words

Optional. Posts contain at least one of these words, separated by spaces. Constraints: minLength=0; maxLength=10000.

### None of these words

Optional. Exclude posts that contain any of these words. Constraints: minLength=0; maxLength=10000.

### These hashtags

Optional. Posts with these hashtags, e.g. #AI #webscraping. Constraints: minLength=0; maxLength=10000.

### From these accounts

Optional. Posts written by these accounts, without @. Constraints: minLength=0; maxLength=1000.

### To these accounts

Optional. 高级搜索功能中的To these accounts Constraints: minLength=0; maxLength=1000.

### Mentioning these accounts

Optional. Posts that mention these accounts, without @. Constraints: minLength=0; maxLength=1000.

### Max Tweets to Extract

Optional. Max_Items Constraints: minimum=1, maximum=999999999.

### Language

Optional. Language Constraints: minLength=1; maxLength=100.

### Scraping mode

Required. The date splitting mode merely serves as a placeholder. Entering any text will not affect the result. Constraints: items.minLength=1; items.maxLength=1000.

## How to Use

# Twitter People Search Scraper

Collects query string, query URL, user name, handle, profile URL, avatar URL, bio, and user type from [X People Search](https://x.com/search-advanced).

## Pricing

**$0.3/1,000 lines** – billed on output lines.

## Output Fields

- `msg_type`
- `content`
- `key`
- `count`
- `fail_count`
- `hash_key`
- `Query_Str`
- `Query_URL`
- `User_name`
- `User_handle`
- `User_URL`
- `User_avatar_URL`
- `User_bio`
- `User_type`

## Input Parameters

Complete these fields:

- **All of these words** (Optional) – words that must all appear.
- **This exact phrase** (Optional) – exact phrase from [https://x.com/search-advanced](https://x.com/search-advanced).
- **Any of these words** (Optional) – at least one word must appear.
- **None of these words** (Optional) – words to exclude.
- **These hashtags** (Optional) – hashtags to include.
- **From these accounts** (Optional) – accounts whose posts should be included.
- **To these accounts** (Optional) – accounts that posts should be directed to.
- **Mentioning these accounts** (Optional) – accounts that posts should mention.
- **Max Tweets to Extract** (Optional) – range 1 to 999999999.
- **Language** (Optional)
- **Scraping mode** (Required) – retained by current configuration; does not change behavior.

## How to Use

1. Open **Twitter People Search Scraper** and click **Try it!**.
2. Fill in **All of these words**, **This exact phrase**, **Any of these words**, and other optional fields as needed.
3. Run in the Octoparse cloud and start the task.
4. Review fields (`User_name`, `Query_URL`, `content`, etc.) and export.

## Tips

- Start with a small set of words before scaling.
- Use `User_name` and `Query_URL` to check duplicates or compare exports.

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [Twitter Advanced Search Scraper](https://www.octoparse.com/template/twitter-scraper-by-keywords)
- [Twitter Advanced Search Comments Scraper](https://www.octoparse.com/template/twitter-advanced-search-comments-scraper)
- [Twitter Scraper (by Account URL)](https://www.octoparse.com/template/twitter-scraper-by-account-url)

## Input Schema

```json
{
  "title": "Twitter People Search Scraper input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "all_of_these_words": {
      "title": "All of these words",
      "description": "Posts must contain all of these words, separated by spaces.",
      "type": "string",
      "minLength": 0,
      "maxLength": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "this_exact_phrase": {
      "title": "This exact phrase",
      "description": "Posts must contain this exact phrase.",
      "type": "string",
      "minLength": 0,
      "maxLength": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "any_of_these_words": {
      "title": "Any of these words",
      "description": "Posts contain at least one of these words, separated by spaces.",
      "type": "string",
      "minLength": 0,
      "maxLength": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "none_of_these_words": {
      "title": "None of these words",
      "description": "Exclude posts that contain any of these words.",
      "type": "string",
      "minLength": 0,
      "maxLength": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "these_hashtags": {
      "title": "These hashtags",
      "description": "Posts with these hashtags, e.g. #AI #webscraping.",
      "type": "string",
      "minLength": 0,
      "maxLength": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "from_these_accounts": {
      "title": "From these accounts",
      "description": "Posts written by these accounts, without @.",
      "type": "string",
      "minLength": 0,
      "maxLength": 1000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "to_these_accounts": {
      "title": "To these accounts",
      "description": "高级搜索功能中的To these accounts",
      "type": "string",
      "minLength": 0,
      "maxLength": 1000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "mentioning_these_accounts": {
      "title": "Mentioning these accounts",
      "description": "Posts that mention these accounts, without @.",
      "type": "string",
      "minLength": 0,
      "maxLength": 1000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "max_Tweets_to_Extract": {
      "title": "Max Tweets to Extract",
      "description": "Max_Items",
      "type": "integer",
      "minimum": 1,
      "maximum": 999999999,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "language": {
      "title": "Language",
      "description": "Language",
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "scraping_mode": {
      "title": "Scraping mode",
      "description": "The date splitting mode merely serves as a placeholder. Entering any text will not affect the result.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
      },
      "x-octoparse": {
        "apiEnabled": true
      }
    }
  },
  "required": [
    "scraping_mode"
  ]
}
```

## Input JSON Example

Example 1

```json
{
  "all_of_these_words": "ペンライト デモ",
  "language": "jp",
  "max_Tweets_to_Extract": 3.0,
  "scraping_mode": [
    "none"
  ]
}
```

Example 2

```json
{
  "all_of_these_words": "OpenAI",
  "max_Tweets_to_Extract": 10.0,
  "scraping_mode": [
    "day"
  ]
}
```

Example 3

```json
{
  "any_of_these_words": "XRPL XRP",
  "max_Tweets_to_Extract": 20,
  "scraping_mode": [
    "day"
  ]
}
```

Example 4

```json
{
  "all_of_these_words": "XRPL XRP",
  "max_Tweets_to_Extract": 15,
  "scraping_mode": [
    "day"
  ]
}
```

Example 5

```json
{
  "all_of_these_words": "XRPL XRP",
  "max_Tweets_to_Extract": 10,
  "scraping_mode": [
    "day"
  ]
}
```


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "Query_Str": {
      "type": "string",
      "description": ""
    },
    "Query_URL": {
      "type": "string",
      "description": ""
    },
    "User_URL": {
      "type": "string",
      "description": ""
    },
    "User_avatar_URL": {
      "type": "string",
      "description": ""
    },
    "User_bio": {
      "type": "string",
      "description": ""
    },
    "User_handle": {
      "type": "string",
      "description": ""
    },
    "User_name": {
      "type": "string",
      "description": ""
    },
    "User_type": {
      "type": "string",
      "description": ""
    }
  },
  "title": "Twitter People Search Scraper output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

Example 1

```json
{
  "Query_Str": "ペンライト デモ",
  "Query_URL": "https://x.com/search?q=ペンライト デモ lang:en&src=typed_query",
  "User_URL": "https://x.com/lanemen",
  "User_avatar_URL": "https://x.com/lanemen/photo",
  "User_bio": "\"You can get everything in life you want if you will just help enough other people get what they want.\" Zig Ziglar",
  "User_handle": "lanemen",
  "User_name": "Lane Mendelsohn",
  "User_type": "not verified"
}
```

Example 2

```json
{
  "Query_Str": "OpenAI",
  "Query_URL": "https://x.com/search?q=OpenAI&src=typed_query",
  "User_URL": "https://x.com/OpenAI",
  "User_avatar_URL": "https://x.com/OpenAI/photo",
  "User_bio": "OpenAI’s mission is to ensure that artificial general intelligence benefits all of humanity. We’re hiring: https://t.co/dJGr6LgzPA",
  "User_handle": "OpenAI",
  "User_name": "OpenAI",
  "User_type": "Gold verified"
}
```

Example 3

```json
{
  "Query_Str": "XRPL OR XRP",
  "Query_URL": "https://x.com/search?q=XRPL OR XRP&src=typed_query",
  "User_URL": "https://x.com/xrplorer",
  "User_avatar_URL": "https://x.com/xrplorer/photo",
  "User_bio": "This account is inactive, follow @silkjaer",
  "User_handle": "xrplorer",
  "User_name": "xrplorer.com",
  "User_type": "not verified"
}
```

Example 4

```json
{
  "Query_Str": "XRPL XRP",
  "Query_URL": "https://x.com/search?q=XRPL XRP&src=typed_query",
  "User_URL": "https://x.com/mizzXRP",
  "User_avatar_URL": "https://x.com/mizzXRP/photo",
  "User_bio": "| #XPUNKS  | #Crypto & #NFT |  #Giveaway | DM for promotions | #XRP #XRPLEDGER #AIRDROP | #XRPL PROJECTS | NEW TRUSTLINE",
  "User_handle": "mizzXRP",
  "User_name": "Mizz XRP | XRPL 🚀",
  "User_type": "not verified"
}
```

Example 5

```json
{
  "Query_Str": "XRPL XRP",
  "Query_URL": "https://x.com/search?q=XRPL XRP&src=typed_query",
  "User_URL": "https://x.com/mizzXRP",
  "User_avatar_URL": "https://x.com/mizzXRP/photo",
  "User_bio": "| #XPUNKS  | #Crypto & #NFT |  #Giveaway | DM for promotions | #XRP #XRPLEDGER #AIRDROP | #XRPL PROJECTS | NEW TRUSTLINE",
  "User_handle": "mizzXRP",
  "User_name": "Mizz XRP | XRPL 🚀",
  "User_type": "not verified"
}
```

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

```json
{
  "templateName": "twitter-people-search-scraper",
  "taskName": "Twitter People Search Scraper",
  "parameters": "{\"all_of_these_words\":\"ペンライト デモ\",\"language\":\"jp\",\"max_Tweets_to_Extract\":3.0,\"scraping_mode\":[\"none\"]}"
}
```

## Python Example

```python
import json
import requests

OPENAPI_BASE = "https://openapi.octoparse.com"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"

parameters = json.loads("{\"all_of_these_words\":\"ペンライト デモ\",\"language\":\"jp\",\"max_Tweets_to_Extract\":3.0,\"scraping_mode\":[\"none\"]}")

response = requests.post(
    f"{OPENAPI_BASE}/api/agentTools/executeTask",
    headers={
        "Authorization": f"Bearer {ACCESS_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "templateName": "twitter-people-search-scraper",
        "taskName": "Twitter People Search Scraper",
        "parameters": json.dumps(parameters, ensure_ascii=False),
    },
    timeout=60,
)
print(response.status_code)
print(response.json())
```

## HTTP/cURL Example

```bash
curl -X POST "https://openapi.octoparse.com/api/agentTools/executeTask" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "templateName": "twitter-people-search-scraper",
  "taskName": "Twitter People Search Scraper",
  "parameters": "{\"all_of_these_words\":\"ペンライト デモ\",\"language\":\"jp\",\"max_Tweets_to_Extract\":3.0,\"scraping_mode\":[\"none\"]}"
}
JSON
```

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `twitter-people-search-scraper`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/twitter-people-search-scraper.json)
- [Manifest](https://www.octoparse.com/templates/twitter-people-search-scraper-manifest.json)
