Skip to main content
POST
/
v1
/
tasks
Add Tasks
curl --request POST \
  --url https://api.lobstr.io/v1/tasks \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>'

Documentation Index

Fetch the complete documentation index at: https://docs.lobstr.io/llms.txt

Use this file to discover all available pages before exploring further.

Add Twitter search results to scrape by providing search URLs from X.com (Twitter). The scraper will extract tweets matching your search query.

Headers

Authorization
string
required
Your API authentication token. Value: Token YOUR_API_KEY
Content-Type
string
required
Request body format. Value: application/json

Request Body

FieldTypeRequiredDescription
squidstringYesHash of your squid configured with the Twitter Search Results Scraper
tasksarrayYesArray of task objects, each containing a url field

Task Object

FieldTypeRequiredDescription
urlstringYesTwitter search URL (e.g., https://x.com/search?q=keyword&src=typed_query&f=top)

Search URL Parameters

Twitter search URLs support various filters via query parameters:
ParameterDescription
qSearch query (URL encoded)
f=topShow top results
f=liveShow latest results
f=userShow people results
f=imageShow image results
f=videoShow video results
Perform your search on Twitter/X first, apply filters, then copy the URL to preserve all search parameters.
Use f=live to get the most recent tweets matching your query.
Advanced search operators like from:username, since:2024-01-01, and filter:media are supported in the query.

Code Examples

curl -X POST "https://api.lobstr.io/v1/tasks" \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "squid": "YOUR_SQUID_HASH",
    "tasks": [
      {
        "url": "https://x.com/search?q=artificial%20intelligence&src=typed_query&f=top"
      }
    ]
  }'

Response

200
{
  "duplicated_count": 0,
  "tasks": [
    {
      "id": "9fb224b5e2ce36942a74d1e94dd1cf14",
      "created_at": "2025-07-07T09:53:32.017225",
      "is_active": true,
      "params": {
        "url": "https://x.com/search?q=artificial%20intelligence&src=typed_query&f=top"
      },
      "module": 178,
      "object": "task"
    }
  ]
}