Dear all
i am a novice in this topic and am trying to get tweets to search for all the information but I get only the basic ones. Using the API v2 calls application, I have generated the following API call that contains what I would like to get out.

query=(collapsed OR earthquake) (-is:retweet) (has:media)&start_time=2022-12-23T00:00:00.000Z&tweet.fields=attachments,created_at&media.fields=alt_text,duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,variants,width

In reality I get only id, text, mediakey, edit history.

Thanks for helping

Twarc may be a good place to start if you just want the data:

You can run it as a python library or in the command line:

twarc2 search "(collapsed OR earthquake) (-is:retweet) (has:media)" --start-time "2022-12-23" results.jsonl

To make it easier to work with you can convert to csv like in the linked post or “flatten” the data ending up with 1 tweet with everything per line:

twarc2 flatten results.jsonl tweets.jsonl

Otherwise, each response has a data portion with tweets and any expansions you specify are inside includes Using fields and expansions | Docs | Twitter Developer Platform

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.