GET /labs/1/tweets

Returns a variety of information about the Tweet specified by the requested ID or list of IDs.



Authentication and rate limits

Authentication methods supported by this endpoint
OAuth 2.0 Bearer token
OAuth 1.0a User context

This endpoint is rate limited at 900 requests per 15-minute window.



Query parameters

NameTypeDescription
ids
 Required 
stringA comma separated list of Tweet IDs. Up to 100 are allowed in a single request.
formatenum (compact, default, detailed)Format for all the objects returned as part of the response, including those returned in expansions.
tweet.formatenum (compact, default, detailed)Format for all Tweet objects returned in response. Can be used together with other format parameters to expand or reduce Tweet objects only.
user.formatenum (compact, default, detailed)Format for all User objects returned in response. Can be used together with other format parameters to expand or reduce User objects only.
place.formatenum (compact, default, detailed)Format for all Place objects returned in response. Can be used together with other format parameters to expand or reduce Place objects only.
expansionsenum (attachments.poll_ids, attachments.media_keys, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id)Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.


Examples

cURL
  • cURL
  • twurl
curl -X GET -H "Authorization: Bearer $BEARER_TOKEN" "https://api.twitter.com/labs/1/tweets?ids=1067094924124872705"
twurl -X GET "/labs/1/tweets?ids=1067094924124872705"

Response

Default format
  • Default format
  • Compact format
  • Detailed format
{
  "data": [
    {
      "id": "1067094924124872705",
      "created_at": "2018-11-26T16:37:10.000Z",
      "text": "Just getting started with Twitter APIs? Find out what you need in order to build an app. Watch this video! https://t.co/Hg8nkfoizN",
      "author_id": "2244994945",
      "attachments": {
        "media_keys": [
          "13_1064638969197977600"
        ]
      },
      "entities": {
        "urls": [
          {
            "start": 107,
            "end": 130,
            "url": "https://t.co/Hg8nkfoizN"
          }
        ]
      },
      "format": "default"
    }
  ]
}
{
  "data": [
    {
      "id": "1067094924124872705",
      "created_at": "2018-11-26T16:37:10.000Z",
      "text": "Just getting started with Twitter APIs? Find out what you need in order to build an app. Watch this video! https://t.co/Hg8nkfoizN",
      "author_id": "2244994945",
      "attachments": {
        "media_keys": [
          "13_1064638969197977600"
        ]
      },
      "format": "compact"
    }
  ]
}
{
  "data": [
    {
      "id": "1067094924124872705",
      "created_at": "2018-11-26T16:37:10.000Z",
      "text": "Just getting started with Twitter APIs? Find out what you need in order to build an app. Watch this video! https://t.co/Hg8nkfoizN",
      "author_id": "2244994945",
      "attachments": {
        "media_keys": [
          "13_1064638969197977600"
        ]
      },
      "entities": {
        "urls": [
          {
            "start": 107,
            "end": 130,
            "url": "https://t.co/Hg8nkfoizN"
          }
        ]
      },
      "stats": {
        "retweet_count": 185,
        "reply_count": 0,
        "like_count": 1432,
        "quote_count": 29
      },
      "possibly_sensitive": false,
      "lang": "en",
      "source": "Twitter Media Studio",
      "format": "detailed"
    }
  ]
}

Response fields

NameTypeDescription
idstringUnique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.

 default   compact   detailed 
created_atdate (ISO 8601)Creation time of the Tweet.

 default   compact   detailed 
textstringThe content of the Tweet.

 default   compact   detailed 
author_idstringUnique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.

You can obtain the expanded object in includes.users by adding expansions=author_id in the request's query parameter.

 default   compact   detailed 
in_reply_to_user_idstringIf this Tweet is a Reply, indicates the User ID of the parent Tweet's author. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.

You can obtain the expanded object in includes.users by adding expansions=in_reply_to_user_id in the request's query parameter.

 default   compact   detailed 
referenced_tweetsarrayA list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.

 default   compact   detailed 
referenced_tweets.typeenum (retweeted, quoted, replied_to)Indicates the type of relationship between this Tweet and the Tweet returned in the response: retweeted (this Tweet is a Retweet), quoted (a Retweet with comment, also known as Quoted Tweet), or replied_to (this Tweet is a reply).

 default   compact   detailed 
referenced_tweets.idstringThe unique identifier of the referenced Tweet.

You can obtain the expanded object in includes.tweets by adding expansions=referenced_tweets.id in the request's query parameter.

 default   compact   detailed 
referenced_tweets.id.author_idstringThe unique identifier of the author of the referenced Tweet.

You can obtain the expanded object in includes.users by adding expansions=referenced_tweets.id.author_id in the request's query parameter.
attachmentsobjectSpecifies the type of attachments (if any) present in this Tweet.

 default   compact   detailed 
attachments.media_keysarray (string)List of unique identifiers of media attached to this Tweet. These identifiers use the same media key format as those returned by the Media Library.

You can obtain the expanded object in includes.media by adding expansions=attachments.media_keys in the request's query parameter.

 default   compact   detailed 
attachments.poll_idsarray (string)List of unique identifiers of polls present in the Tweets returned. These are returned as a string in order to avoid complications with languages and tools that cannot handle large integers.

You can obtain the expanded object in includes.polls by adding expansions=attachments.polls_ids in the request's query parameter.

 default   compact   detailed 
geoobjectContains details about the location tagged by the user in this Tweet, if they specified one.

 default   detailed 
geo.coordinates.typestringDescribes the type of coordinate. The only value supported at present is Point.

 default   detailed 
geo.coordinates.coordinatesarray (latitude, longitude)A pair of decimal values representing the precise location of the user. This value be null unless the user explicitly shared their precise location.

 default   detailed 
geo.place_idstringThe unique identifier of the place, if this is a point of interest tagged in the Tweet.

You can obtain the expanded object in includes.places by adding expansions=geo.place_id in the request's query parameter.

 default   detailed 
entitiesobjectContains details about text that has a special meaning in a Tweet.

 default   detailed 
entities.urlarrayContains details about text recognized as a URL.
entities.url.startintThe start position (zero-based) of the recognized URL within the Tweet.
entities.url.endintThe end position (zero-based) of the recognized URL within the Tweet.
entities.url.urlstringThe URL in the format tweeted by the user.
entities.url.expanded_urlstringThe fully resolved URL.
entities.url.display_urlstringThe URL as displayed in the Twitter client.
entities.hashtagsarrayContains details about text recognized as a Hashtag.
entities.hashtags.startintThe start position (zero-based) of the recognized Hashtag within the Tweet.
entities.hashtags.endintThe end position (zero-based) of the recognized Hashtag within the Tweet.
entities.hashtags.hashtagstringThe text of the Hashtag.
entities.mentionsarrayContains details about text recognized as a user mention.
entities.mentions.startintThe start position (zero-based) of the recognized user mention within the Tweet.
entities.mentions.endintThe end position (zero-based) of the recognized user mention within the Tweet.
entities.mentions.usernamestringThe part of text recognized as a user mention.

You can obtain the expanded object in includes.users by adding expansions=entities.mentions.username in the request's query parameter.
entities.cashtagsarrayContains details about text recognized as a Cashtag.
entities.cashtags.startintThe start position (zero-based) of the recognized Cashtag within the Tweet.
entities.hashtags.endintThe end position (zero-based) of the recognized Cashtag within the Tweet.
entities.cashtags.cashtagstringThe text of the Cashtag.
withheldobjectContains withholding details for withheld content.

 default   compact   detailed 
withheld.copyrightbooleanIndicates if the content is being withheld for on the basis of copyright infringement.
withheld.country_codesarrayProvides a list of countries where this content is not available.
withheld.scopeenum (tweet, user)Indicates whether the content being withheld is a Tweet or a user.
statsobjectEngagement metrics for the Tweet at the time of the request.

 detailed 
stats.retweet_countintegerNumber of times this Tweet has been Retweeted.
stats.reply_countintegerNumber of Replies of this Tweet.
stats.like_countintegerNumber of Likes of this Tweet.
stats.quote_countintegerNumber of times this Tweet has been Retweeted with a comment (also known as Quote).
possibly_sensitivebooleanIndicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.

 detailed 
langstringLanguage of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.

 detailed 
sourcestringThe name of the app the user Tweeted from.

 detailed 
formatenum (default, compact, detailed)Indicates the format returned for this object, as requested in the format or tweet.format query parameters.

 default   compact   detailed 
includesobjectReturns the requested expansions, if available.

 default   compact   detailed 
includes.tweetsarrayFor referenced Tweets, this is a list of objects with the same structure as the one described in this page.
includes.usersarrayFor referenced users, this is a list of objects with the same structure as the one described by GET /users.
includes.places.idstringThe unique identifier of the place, if this is a point of interest tagged in the Tweet.

 default   compact   detailed 
includes.places.namestringThe short name of this place, for example San Francisco.

 default   compact   detailed 
includes.places.full_namestringA longer-form detailed place name, for example San Francisco, CA.

 default   detailed 
includes.places.place_typeenum (city, unknown, country, admin, neighborhood, poi, zip_code, metro, admin0, admin1)Specified the particular type of information represented by this place information, such as a city name, or a point of interest.

 default   detailed 
includes.places.country_codestringThe ISO Alpha-2 country code this place belongs to.

 default   compact   detailed 
includes.places.countrystringThe full-length name of the country this place belongs to.

 default   detailed 
includes.places.contained_withinarrayReturns the identifiers of known places that contain the referenced place.

 default   detailed 
includes.places.geoobjectContains place details in GeoJSON format.

 detailed 
includes.places.geo.typestringThe type of place described by this object. At present, this API only returns objects of type Feature.
includes.places.geo.bboxarray (latitude_start, longitude_start, latitude_end, longitude_end)The bounding box coordinates for this place.
includes.places.geo.geometryobjectContains GeoJSON point information for this place, if available.
includes.places.geo.coordinates.typestringDescribes the type of coordinate. The only value supported at present is Point.
includes.places.geo.coordinates.coordinatesarray (latitude, longitude)A pair of decimal values representing the precise location of the user. This value be null unless the user explicitly shared their precise location.
includes.places.geo.coordinates.propertiesobjectA dictionary containing additional properties, as defined by the GeoJSON specification. Can be empty.
includes.mediastringFor referenced media attachments, this is a list of objects describing media content.
includes.media.media_keystringUnique identifiers for this expanded media content. This is returned using the same media key format as returned by the Media Library.
includes.media.heightintegerHeight of this content in pixels.
includes.media.widthintegerWidth of this content in pixels.
includes.media.preview_image_urlstringURL to the static placeholder preview of this content.
includes.media.duration_msintegerAvailable when `includes.media.type` is `video`. Duration in milliseconds of the video.
includes.media.typeenum (animated_gif, photo, video)Type of content.
includes.pollsstringFor referenced polls, this is a list of objects describing polls.
includes.polls.idstringUnique identifiers of the expanded poll. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.
includes.polls.optionsarrayContains objects describing each choice in the referenced poll.
includes.polls.options.positionintegerPosition of this choice in the poll.
includes.polls.options.labelstringText of the poll choice.
includes.polls.options.votesintegerNumber of votes this poll choice received.
includes.polls.options.voting_statusenum (open, closed)Indicates if this poll is still active and can receive votes, or if the voting is now closed.
includes.polls.end_datetimedate (ISO 8601)Specifies the end date and time for this poll.
includes.polls.duration_minutesintegerSpecifies the total duration of this poll.
errorsobjectContains details about errors that affected any of the requested Tweets. See Status codes and error messages for more details.

 default   compact   detailed