Examples
Update Settings
Configure the Twitter Followers/Following Scraper settings
The v1 API, for batchesSquids, tasks and runs: many calls on a schedule, delivered where you work. For one call that answers in seconds, use the API v2.
POST
https://api.lobstr.io/v1/squids/{squid_hash}Configure your Twitter Followers/Following Scraper squid settings. Choose whether to scrape followers, following, or both for each target account.
Headers
AuthorizationstringheaderrequiredYour API authentication token. Value: Token YOUR_API_KEY
Content-TypestringheaderrequiredRequest body format. Value: application/json
Scraper Parameters
Set these parameters in the params object:
| Parameter | Type | Default | Description |
|---|---|---|---|
| scrape_followers | boolean | false | If true, collect the account's followers list |
| scrape_following | boolean | false | If true, collect the accounts the user is following |
| max_unique_results_per_run | integer | unlimited | Maximum unique results across all tasks in the run |
Squid Settings
Configure general squid settings:
| Setting | Type | Description |
|---|---|---|
| name | string | Display name for your squid configuration |
| concurrency | integer | Number of parallel scraping threads (default: 1) |
| accounts | array | Array of linked Twitter account hashes (required) |
| export_unique_results | boolean | Export only unique results (deduplicated) |
| to_complete | boolean | Run until all tasks complete |
| no_line_breaks | boolean | Remove line breaks from results |
This scraper requires a synced Twitter/X account. Add your Twitter cookies in the Accounts section before running.
Enable both scrape_followers and scrape_following to get a complete picture of an account's network.
Code Examples
curl -X POST "https://api.lobstr.io/v1/squids/YOUR_SQUID_HASH" \ -H "Authorization: Token YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Twitter Followers/Following Scraper (1)", "concurrency": 1, "export_unique_results": true, "to_complete": false, "no_line_breaks": true, "params": { "scrape_followers": true, "scrape_following": false } }'
Response
201
{ "name": "Twitter Followers/Following Scraper (1)", "concurrency": 1, "export_unique_results": true, "to_complete": false, "no_line_breaks": true, "params": { "scrape_followers": true, "scrape_following": false } }