Retrieve all comments for any tweet

Returns an array of replies that are part of the requested tweet's thread (including direct replies and 2nd level replies). Behind the scenes this method will recursively request the GET /twitter/search endpoint using conversation_id:[tweet_id] search query in order to retrieve all replies.

For convenience of the crypto-focused users of the API, we attempt to parse a blockchain wallet address present in each reply and store it in wallet_address property of the response. For simplicity, any alphanumeric string of 25+ characters is assumed to be an address. If you rely on this property - make sure to implement additional verifications on your side.

Known limitation: occasionally Twitter does not return all replies through the search endpoint, therefore total number of results generated by this async job may be lower than reply_count reported by Twitter under the main tweet. For example, any low-quality or spam replies will be missing.

Endpoint

POST https://api.socialdata.tools/twitter/tweets/[tweet_id]/comments/asyncJob

Endpoint parameters

Name
Description
Example

tweet_id (Required)

The numerical ID of the desired Tweet

1791475934908125269

since_id (optional)

Only fetch replies with id greater than since_id.

Job will stop execution once this Tweet ID is reached

166251761328391335

max_count (optional)

Maximum number of tweets to be returned. Use this to control your costs By default will attempt to fetch all replies

1000

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. You need to have enough balance to retrieve all comments reported by Twitter under tweet_id, unless max_count property is set

  • 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