SocialData.Tools: API Documentation
  • Getting Started
  • Authentication
  • Pricing
  • SDKs and Code Examples
  • Twitter: Tweets
    • Retrieve tweet details
    • Retrieve thread
    • Retrieve article details
    • Retrieve all users who retweeted a tweet
    • Retrieve search results by keyword
    • Retrieve all users who liked a tweet
  • Twitter: Users
    • Retrieve user profile details
    • Retrieve profile's affiliated users
    • Retrieve tweets and replies made by a specific user
    • Retrieve likes made by a specific user
    • Retrieve user's articles
    • Retrieve user's highlighted tweets
    • Retrieve user's followers
    • Retrieve user's following
    • Retrieve user's lists
    • Check if a user is following another user
    • Check if a user retweeted a specific tweet
    • Check if a user commented on a specific tweet
    • Check if a user liked a specific tweet
    • Retrieve users search results by screenname
  • Twitter: Lists
    • Retrieve list details
    • Retrieve list members
  • Twitter: Spaces
    • Retrieve Twitter spaces stream details
  • Twitter / X: Communities
    • Retrieve community tweets timeline
    • Retrieve community members
Powered by GitBook
On this page
  • Endpoint
  • Endpoint parameters
  • Response codes
  • Example response
  • Example job status response
  1. Twitter / X: Async Endpoints

Retrieve large number of search results

Returns array of tweets provided by Twitter search page. Although Twitter returns ~20 search results per page, this endpoint will attempt to retrieve more results by sending additional requests until max_count is reached.

Endpoint

POST https://api.socialdata.tools/twitter/search/asyncJob

Endpoint parameters

Name
Description
Example

query (Required)

A UTF-8, URL-encoded search query , including any operators supported by Twitter website search.

from:elon_musk since_id:123 max_id:345

type (optional)

Search type (Latest for recent tweets or Top for popular tweets)

Default: Latest

Latest

since_id (optional)

Job will stop execution once this Tweet ID is reached

166251761328391335

max_id (optional)

Tweet ID to start scraping from. This will be appended to your search query as max_id:[ID]

176251765328391335

max_count (optional)

Maximum number of tweets to be returned. Use this to control your costs Default: 20

100

compress (optional)

Indicates whether dataset should be compressed to zip before uploading to S3

Default: false

false

output_format (optional)

Preferred output file format. Supported values: csv, json, xlsx. Json recommended due to more detailed output Default: json

json

Response codes

  • HTTP 200 OK - succeeded

  • HTTP 402 Payment Required - not enough credits to perform this request

  • HTTP 422 Unprocessable Content - validation failed (e.g. one of the required parameters was not provided)

  • HTTP 500 Internal Server Error - other error (highly unlikely)

Example response

// If succeeded: 
{
    "status": "success",
    "job_id": 42
}

Example job status response

Once a job is processed, the following response will be provided by GET /jobs/[job_id] endpoint or by webhook event:

{
    "job_id": 42
    "status": "success",
    "result": {
        "is_compressed": false,
        "datafile_url": "https://s3.amazonaws.com/..."
    }
}

Last updated 11 months ago