-
Notifications
You must be signed in to change notification settings - Fork 3
Info: Available Fields and Expansions
The V2 Twitter API has some changes to the structure of their requests for data. Specifically, now included are fields
for specific data objects. To get specific information, you must now request each data object field explicitly.
- Tweet
- User
- Media
- Poll
- Place
- created_at
- description
- entities
- id
- location
- name
- pinned_tweet_id
- profile_image_url
- protected
- public_metrics
- url
- username
- verified
- withheld
- Reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user
- attachments
- author_id
- context_annotations
- conversation_id
- created_at
- entities
- geo
- id
- in_reply_to_user_id
- lang
- non_public_metrics
- organic_metrics
- possiby_sensitive
- promoted_metrics
- public_metrics
- referenced_tweets
- reply_settings
- source
- text
- withheld"
- Reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
- duration_ms
- height
- media_key
- non_public_metrics
- organic_metrics
- preview_image_url
- promoted_metrics
- public_metrics
- type
- width
- Reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/media
- duration_minutes
- end_datetime
- id
- options
- voting_status
- Reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/poll
- contained_within
- country
- country_code
- full_name
- geo
- id
- name
- place_type
- Reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/place
From Twitter...
With expansions, developers can expand objects referenced in the payload. Objects available for expansion are referenced by ID. For example, the referenced_tweets.id and author_id fields returned in the Tweets lookup payload can be expanded into complete objects. If you would like to request fields related to the user that posted that Tweet, or the media, poll, or place that was included in that Tweet, you will need to pass the related expansion query parameter in your request to receive that data in your response.
Expansion | Description |
---|---|
author_id | Returns a user object representing the Tweet’s author |
referenced_tweets.id | Returns a Tweet object that this Tweet is referencing (either as a Retweet, Quoted Tweet, or reply) |
in_reply_to_user_id | Returns a user object representing the Tweet author this requested Tweet is a reply of |
attachments.media_keys | Returns a media object representing the images, videos, GIFs included in the Tweet |
attachments.poll_ids | Returns a poll object containing metadata for the poll included in the Tweet |
geo.place_id | Returns a place object containing metadata for the location tagged in the Tweet |
entities.mentions.username | Returns a user object for the user mentioned in the Tweet |
referenced_tweets.id.author_id | Returns a user object for the author of the referenced Tweet |
Expansion | Description |
---|---|
pinned_tweet_id | Returns a Tweet object representing the Tweet pinned to the top of the user’s profile |