Skip to content

Info: Available Fields and Expansions

Matthew R. DeVerna edited this page Feb 16, 2021 · 1 revision

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.

Contents


Data Objects

  • Tweet
  • User
  • Media
  • Poll
  • Place

Fields

User Object Fields:

Tweet Object Fields:

Media Object Fields:

Poll Object Fields

Place Object Fields

Expansions

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.

Tweet Object Expansions

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

User Object Expansions

Expansion Description
pinned_tweet_id Returns a Tweet object representing the Tweet pinned to the top of the user’s profile