Over the past decade, the Tweet has evolved from a simple 140-character text message to a rich canvas for creative expression featuring photos, videos, links, hashtags, and more. In 2016, we announced a set of changes where (auto-populated) @replies and attachments (photos, GIFs, videos, and polls, Quote Tweets) would no longer count toward the Tweet character limit.

More recently, we announced an experiment to allow users more characters to express themselves on Twitter. As a result, we have provided additional developer guidance below to reiterate the importance of building your app for flexible data objects.

Guiding Principles&nbsp

To provide the best experience for your customers, be sure that you’ve built your applications so that they do not include hard-coded length assumptions for the JSON payload or Tweet display. With the latest experiments, the display range for some Tweets may extend beyond 140 characters.

Regardless of previous (or future) changes, the list below contains evergreen guidelines to keep in mind when intergrating with the Twitter API platform:

  • Do not make assumptions about the size, length, or format of Tweet objects. More specifically do not hard-code assumptions around text and full_text fields
  • Always pay attention to the values provided in the display_text_range field, which defines the visible (display) text content within a Tweet
  • Although we document the structure of a Tweet, new properties may be added to the JSON object over time

For additonal guidance, please reference this page available at developer.twitter.com.


Recent changes&nbsp

(Updated: October 2017)

We design any updates or experiments to minimize the impact to your systems so that they’ll continue to function if you don’t do anything. However, if you choose not to update your systems to reflect these changes, you may only receive partial JSON payloads and your displays may not properly show a full Tweet.

  • Giving users more characters to express themselves
  • Replies: @names that auto-populate at the start of a reply Tweet will no longer be display elements and will not count towards the character limit within the Tweet. Tweets starting with a @mention will count, as will @mentions added explicitly by the user in the body of the Tweet.
  • Media attachments: URLs that are generated at the end of Tweets when a user attaches photos, videos, GIFs, polls, Quote Tweets, or DM deep links - will no longer count towards the character limit.

What this means for the JSON Payload&nbsp

The following things will change within Tweet payloads:

  • The displayed text in a Tweet will adhere to the Tweet text length limit, but - when @replies and/or media attachment URLs are present - the text content of the overall Tweet JSON object will be able to exceed Tweet text length limit. From a development perspective this mean that your systems will need to be adjusted to avoid hard-coding length assumptions within your applications.
  • Conceptually the payload text is divided into three regions:
    • A hidden prefix that may contain one or more space-separated @mentions which shall not be rendered as part of the display text, but must instead be rendered as metadata.
    • A display text range up to the Tweet text length limit.
    • A hidden suffix that may contain an attachment URL which shall not be rendered as part of the display text, but must instead be rendered as metadata. This is limited to containing a single URL entity that identifies an attachment resource: currently, one to four photos, a GIF, video, poll, Quote Tweet, or DM deep link.
      • Note: URLs for Quote Tweet or DM deep links which are typed or pasted into a Tweet will still count against the character limit. In the near future, we will add an API parameter “attachment_url” to the POST statuses/update endpoint to attach these URLs to a Tweet. They will not count against the character limit when this method is used.
  • If the text contains a hidden prefix or suffix, then the Tweet payload will contain values to identify the start and end indices of the text that should be displayed (see description of display_text_range payload element below).

Payload “Types”, Conditions, and Guidance&nbsp

Please note that ‘extended_tweet’ is the nomenclature applicable to the Native/Original Twitter format. In Gnip Activity Streams format, the same payload element is called ‘long_object’.

Tweets with no “Hidden Text” (AKA Classic Tweet)

If a Tweet does not contain leading @replies or attachment URLs (aka “hidden text”), then the tweet payload and body will look exactly the same as it does today - no ‘extended_tweet’ / ‘long_object’ object, no display_text_range. Render and process the Tweet payload as you do today.

Example Payloads:

{
    "created_at": "Thu Jul 28 22:50:33 +0000 2016",
    "id": 758796817370800100,
    "id_str": "758796817370800129",
    "text": "Regular tweet!",
    "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client",
    "truncated": false,
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
        "id": 735369652956766200,
        "id_str": "735369652956766208",
        "name": "Ygritte",
        "screen_name": "ygritteygritte",
        "location": null,
        "url": null,
        "description": null,
        "protected": false,
        "verified": false,
        "followers_count": 0,
        "friends_count": 0,
        "listed_count": null,
        "favourites_count": 0,
        "statuses_count": 0,
        "created_at": "Wed May 25 07:19:22 +0000 2016",
        "utc_offset": null,
        "time_zone": null,
        "geo_enabled": false,
        "lang": "en",
        "contributors_enabled": false,
        "is_translator": false,
        "profile_background_color": "",
        "profile_background_image_url": null,
        "profile_background_image_url_https": null,
        "profile_background_tile": false,
        "profile_link_color": "",
        "profile_sidebar_border_color": "",
        "profile_sidebar_fill_color": "",
        "profile_text_color": "",
        "profile_use_background_image": false,
        "profile_image_url": "http://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "profile_image_url_https": "https://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "default_profile": true,
        "default_profile_image": false,
        "following": null,
        "follow_request_sent": null,
        "notifications": null
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "entities": {
        "hashtags": [],
        "urls": [],
        "user_mentions": [],
        "symbols": []
    },
    "favorited": false,
    "retweeted": false,
    "filter_level": "low",
    "lang": "pt"
}
        
{
    "id": "tag:search.twitter.com,2005:758796817370800129",
    "objectType": "activity",
    "verb": "post",
    "postedTime": "2016-07-28T22:50:33.000Z",
    "generator": {
        "displayName": "Twitter Web Client",
        "link": "http://twitter.com"
    },
    "provider": {
        "objectType": "service",
        "displayName": "Twitter",
        "link": "http://www.twitter.com"
    },
    "link": "http://twitter.com/ygritteygritte/statuses/758796817370800129",
    "body": "Regular tweet!",
    "actor": {
        "objectType": "person",
        "id": "id:twitter.com:735369652956766208",
        "link": "http://www.twitter.com/ygritteygritte",
        "displayName": "Ygritte",
        "postedTime": "2016-05-25T07:19:22.568Z",
        "image": "https://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "summary": null,
        "friendsCount": 0,
        "followersCount": 0,
        "listedCount": 0,
        "statusesCount": 0,
        "twitterTimeZone": null,
        "verified": false,
        "utcOffset": null,
        "preferredUsername": "ygritteygritte",
        "languages": [
            "en"
        ],
        "links": [
            {
                "href": null,
                "rel": "me"
            }
        ],
        "favoritesCount": 0
    },
    "object": {
        "objectType": "note",
        "id": "object:search.twitter.com,2005:758796817370800129",
        "summary": "Regular tweet!",
        "link": "http://twitter.com/ygritteygritte/statuses/758796817370800129",
        "postedTime": "2016-07-28T22:50:33.000Z"
    },
    "favoritesCount": 0,
    "twitter_entities": {
        "hashtags": [],
        "urls": [],
        "user_mentions": [],
        "symbols": []
    },
    "twitter_lang": "pt",
    "retweetCount": 0,
    "twitter_filter_level": "low"
}
        

Tweets with “Hidden Text” (AKA Classic Tweet with hidden text)

If a Tweet body contains “hidden text” (leading @replies and/or attachment URLs) and combined with the user-entered text remains less than the Tweet text length limit, the standard root-level Tweet body field should be used. In this case, a display_text_range will be included at the root-level to indicate the portion of the tweet body that should be displayed (excluding “hidden text” in the form of leading @replies and trailing attachment urls). In this case, you should use the display_text_range to identify the non-hidden text of the Tweet for display.

Rule of Thumb:
  1. If there is a display_text_range field at the root-level of the Tweet, that is an indicator that the Tweet has hidden text. That does not necessarily mean that is the display_text_range element that should be used (see next section/tweet type)

Example Payloads:

{
    "created_at": "Tue Jul 19 06:13:45 +0000 2016",
    "id": 755284472208031700,
    "id_str": "755284472208031745",
    "text": "image tweet with <140 ch https://t.co/ib4Ora8xF4",
    "display_text_range": [
        0,
        27
    ],
    "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter for  iPhone",
    "truncated": false,
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
        "id": 735369652956766200,
        "id_str": "735369652956766208",
        "name": "Ygritte",
        "screen_name": "ygritteygritte",
        "location": null,
        "url": null,
        "description": null,
        "protected": false,
        "verified": false,
        "followers_count": 0,
        "friends_count": 0,
        "listed_count": null,
        "favourites_count": 0,
        "statuses_count": 0,
        "created_at": "Wed May 25 07:19:22 +0000 2016",
        "utc_offset": null,
        "time_zone": null,
        "geo_enabled": false,
        "lang": "en",
        "contributors_enabled": false,
        "is_translator": false,
        "profile_background_color": "",
        "profile_background_image_url": null,
        "profile_background_image_url_https": null,
        "profile_background_tile": false,
        "profile_link_color": "",
        "profile_sidebar_border_color": "",
        "profile_sidebar_fill_color": "",
        "profile_text_color": "",
        "profile_use_background_image": false,
        "profile_image_url": "http://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "profile_image_url_https": "https://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "default_profile": true,
        "default_profile_image": false,
        "following": null,
        "follow_request_sent": null,
        "notifications": null
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 1,
    "favorite_count": 0,
    "entities": {
        "hashtags": [],
        "urls": [],
        "user_mentions": [],
        "symbols": [],
        "media": [
            {
                "id": 755284466356977700,
                "id_str": "755284466356977664",
                "indices": [
                    28,
                    51
                ],
                "media_url": "http://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "media_url_https": "https://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "url": "https://t.co/ib4Ora8xF4",
                "display_url": "pic.twitter.com/ib4Ora8xF4",
                "expanded_url": "http://twitter.com/ygritteygritte/status/755284472208031745/photo/1",
                "type": "photo",
                "sizes": {
                    "small": {
                        "w": 680,
                        "h": 569,
                        "resize": "fit"
                    },
                    "large": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    },
                    "thumb": {
                        "w": 150,
                        "h": 150,
                        "resize": "crop"
                    },
                    "medium": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    }
                }
            }
        ]
    },
    "extended_entities": {
        "media": [
            {
                "id": 755284466356977700,
                "id_str": "755284466356977664",
                "indices": [
                    28,
                    51
                ],
                "media_url": "http://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "media_url_https": "https://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "url": "https://t.co/ib4Ora8xF4",
                "display_url": "pic.twitter.com/ib4Ora8xF4",
                "expanded_url": "http://twitter.com/ygritteygritte/status/755284472208031745/photo/1",
                "type": "photo",
                "sizes": {
                    "small": {
                        "w": 680,
                        "h": 569,
                        "resize": "fit"
                    },
                    "large": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    },
                    "thumb": {
                        "w": 150,
                        "h": 150,
                        "resize": "crop"
                    },
                    "medium": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    }
                }
            }
        ]
    },
    "favorited": false,
    "retweeted": true,
    "possibly_sensitive": false,
    "filter_level": "low",
    "lang": "en"
}
        
{
    "id": "tag:search.twitter.com,2005:755284472208031745",
    "objectType": "activity",
    "verb": "post",
    "postedTime": "2016-0709T06:13:45.000Z",
    "generator": {
        "displayName": "Twitter for  iPhone",
        "link": "http://twitter.com"
    },
    "provider": {
        "objectType": "service",
        "displayName": "Twitter",
        "link": "http://www.twitter.com"
    },
    "link": "http://twitter.com/ygritteygritte/statuses/755284472208031745",
    "body": "image tweet with <140 ch https://t.co/ib4Ora8xF4",
    "display_text_range": [
        0,
        27
    ],
    "actor": {
        "objectType": "person",
        "id": "id:twitter.com:735369652956766208",
        "link": "http://www.twitter.com/ygritteygritte",
        "displayName": "Ygritte",
        "postedTime": "2016-05-25T07:19:22.568Z",
        "image": "https://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "summary": null,
        "friendsCount": 0,
        "followersCount": 0,
        "listedCount": 0,
        "statusesCount": 0,
        "twitterTimeZone": null,
        "verified": false,
        "utcOffset": null,
        "preferredUsername": "ygritteygritte",
        "languages": [
            "en"
        ],
        "links": [
            {
                "href": null,
                "rel": "me"
            }
        ],
        "favoritesCount": 0
    },
    "object": {
        "objectType": "note",
        "id": "object:search.twitter.com,2005:755284472208031745",
        "summary": "image tweet with <140 ch https://t.co/ib4Ora8xF4",
        "link": "http://twitter.com/ygritteygritte/statuses/755284472208031745",
        "postedTime": "2016-0709T06:13:45.000Z"
    },
    "favoritesCount": 0,
    "twitter_entities": {
        "hashtags": [],
        "urls": [],
        "user_mentions": [],
        "symbols": [],
        "media": [
            {
                "id": 755284466356977700,
                "id_str": "755284466356977664",
                "indices": [
                    28,
                    51
                ],
                "media_url": "http://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "media_url_https": "https://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "url": "https://t.co/ib4Ora8xF4",
                "display_url": "pic.twitter.com/ib4Ora8xF4",
                "expanded_url": "http://twitter.com/ygritteygritte/status/755284472208031745/photo/1",
                "type": "photo",
                "sizes": {
                    "small": {
                        "w": 680,
                        "h": 569,
                        "resize": "fit"
                    },
                    "large": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    },
                    "thumb": {
                        "w": 150,
                        "h": 150,
                        "resize": "crop"
                    },
                    "medium": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    }
                }
            }
        ]
    },
    "twitter_extended_entities": {
        "media": [
            {
                "id": 755284466356977700,
                "id_str": "755284466356977664",
                "indices": [
                    28,
                    51
                ],
                "media_url": "http://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "media_url_https": "https://pbs.twimg.com/media/CntPOHGUAAAinkH.jpg",
                "url": "https://t.co/ib4Ora8xF4",
                "display_url": "pic.twitter.com/ib4Ora8xF4",
                "expanded_url": "http://twitter.com/ygritteygritte/status/755284472208031745/photo/1",
                "type": "photo",
                "sizes": {
                    "small": {
                        "w": 680,
                        "h": 569,
                        "resize": "fit"
                    },
                    "large": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    },
                    "thumb": {
                        "w": 150,
                        "h": 150,
                        "resize": "crop"
                    },
                    "medium": {
                        "w": 1024,
                        "h": 857,
                        "resize": "fit"
                    }
                }
            }
        ]
    },
    "twitter_lang": "en",
    "retweetCount": 1,
    "twitter_filter_level": "low"
}
        

Extended Tweet with “Hidden Text”

If a Tweet body exceeds Tweet text length limit due to combination of hidden text and user-entered text, the root-level Tweet body will be truncated (as will its associated entities) and an additive extended_tweet object will be included in the payload and should be used to retrieve the full Tweet body and full set of associated entities.

Rules of Thumb:

  1. If there is an extended_tweet object, that is an indicator that the Tweet body exceeds the lenght limit and the root-level field (and entities) are truncated.
  2. When present, use all of the contents of the extended_tweet object rather than the same elements at the root level.

The entities within the extended_tweet object represent the full, untruncated set of entities applicable to the tweet. A display_text_range field will be included in the extended_tweet object to indicate the portion of the Tweet body that should be displayed (i.e. excluding “hidden text” in the form of leading @replies and trailing attachment urls).

All of the entities at the root level will be based on the truncated text (i.e. entities prior to the truncation point) and not the full set of entities. A display_text_range will also be included at the root-level in the context of the truncated tweet body, however, for proper display, you should utilize the one within the extended_tweet object.

Example Payloads:

{
    "created_at": "Wed Jul 20 17:50:10 +0000 2016",
    "id": 755822121331281900,
    "id_str": "755822121331281920",
    "text": "this is a tweet with 140 characters of display range text, which means that with an image attachment the full tweet… https://t.co/ECfyrsRRTG",
    "display_text_range": [
        0,
        140
    ],
    "source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter for  iPhone",
    "truncated": true,
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
        "id": 735369652956766200,
        "id_str": "735369652956766208",
        "name": "Ygritte",
        "screen_name": "ygritteygritte",
        "location": null,
        "url": null,
        "description": null,
        "protected": false,
        "verified": false,
        "followers_count": 0,
        "friends_count": 0,
        "listed_count": null,
        "favourites_count": 0,
        "statuses_count": 0,
        "created_at": "Wed May 25 07:19:22 +0000 2016",
        "utc_offset": null,
        "time_zone": null,
        "geo_enabled": false,
        "lang": "en",
        "contributors_enabled": false,
        "is_translator": false,
        "profile_background_color": "",
        "profile_background_image_url": null,
        "profile_background_image_url_https": null,
        "profile_background_tile": false,
        "profile_link_color": "",
        "profile_sidebar_border_color": "",
        "profile_sidebar_fill_color": "",
        "profile_text_color": "",
        "profile_use_background_image": false,
        "profile_image_url": "http://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "profile_image_url_https": "https://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "default_profile": true,
        "default_profile_image": false,
        "following": null,
        "follow_request_sent": null,
        "notifications": null
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "extended_tweet": {
        "full_text": "this is a tweet with 140 characters of display range text, which means that with an image attachment the full tweet text has >140 characters https://t.co/ws1QmqeYo6",
        "display_text_range": [
            0,
            143
        ],
        "entities": {
            "hashtags": [],
            "urls": [],
            "user_mentions": [],
            "symbols": [],
            "media": [
                {
                    "id": 755822116079935500,
                    "id_str": "755822116079935488",
                    "indices": [
                        144,
                        167
                    ],
                    "media_url": "http://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "media_url_https": "https://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "url": "https://t.co/ws1QmqeYo6",
                    "display_url": "pic.twitter.com/ws1QmqeYo6",
                    "expanded_url": "http://twitter.com/ygritteygritte/status/755822121331281920/photo/1",
                    "type": "photo",
                    "sizes": {
                        "medium": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        },
                        "small": {
                            "w": 680,
                            "h": 510,
                            "resize": "fit"
                        },
                        "thumb": {
                            "w": 150,
                            "h": 150,
                            "resize": "crop"
                        },
                        "large": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        }
                    }
                }
            ]
        },
        "extended_entities": {
            "media": [
                {
                    "id": 755822116079935500,
                    "id_str": "755822116079935488",
                    "indices": [
                        144,
                        167
                    ],
                    "media_url": "http://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "media_url_https": "https://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "url": "https://t.co/ws1QmqeYo6",
                    "display_url": "pic.twitter.com/ws1QmqeYo6",
                    "expanded_url": "http://twitter.com/ygritteygritte/status/755822121331281920/photo/1",
                    "type": "photo",
                    "sizes": {
                        "medium": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        },
                        "small": {
                            "w": 680,
                            "h": 510,
                            "resize": "fit"
                        },
                        "thumb": {
                            "w": 150,
                            "h": 150,
                            "resize": "crop"
                        },
                        "large": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        }
                    }
                }
            ]
        }
    },
    "retweet_count": 0,
    "favorite_count": 0,
    "entities": {
        "hashtags": [],
        "urls": [
            {
                "url": "https://t.co/ECfyrsRRTG",
                "expanded_url": "https://twitter.com/i/web/status/755822121331281920",
                "display_url": "twitter.com/i/web/status/7…",
                "indices": [
                    117,
                    140
                ]
            }
        ],
        "user_mentions": [],
        "symbols": []
    },
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "filter_level": "low",
    "lang": "en"
}
        
{
    "id": "tag:search.twitter.com,2005:755822121331281920",
    "objectType": "activity",
    "verb": "post",
    "postedTime": "2016-07-20T17:50:10.000Z",
    "generator": {
        "displayName": "Twitter for  iPhone",
        "link": "http://twitter.com"
    },
    "provider": {
        "objectType": "service",
        "displayName": "Twitter",
        "link": "http://www.twitter.com"
    },
    "link": "http://twitter.com/ygritteygritte/statuses/755822121331281920",
    "body": "this is a tweet with 140 characters of display range text, which means that with an image attachment the full tweet… https://t.co/ECfyrsRRTG",
    "long_object": {
        "body": "this is a tweet with 140 characters of display range text, which means that with an image attachment the full tweet text has >140 characters https://t.co/ws1QmqeYo6",
        "display_text_range": [
            0,
            143
        ],
        "twitter_entities": {
            "hashtags": [],
            "urls": [],
            "user_mentions": [],
            "symbols": [],
            "media": [
                {
                    "id": 755822116079935500,
                    "id_str": "755822116079935488",
                    "indices": [
                        144,
                        167
                    ],
                    "media_url": "http://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "media_url_https": "https://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "url": "https://t.co/ws1QmqeYo6",
                    "display_url": "pic.twitter.com/ws1QmqeYo6",
                    "expanded_url": "http://twitter.com/ygritteygritte/status/755822121331281920/photo/1",
                    "type": "photo",
                    "sizes": {
                        "medium": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        },
                        "small": {
                            "w": 680,
                            "h": 510,
                            "resize": "fit"
                        },
                        "thumb": {
                            "w": 150,
                            "h": 150,
                            "resize": "crop"
                        },
                        "large": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        }
                    }
                }
            ]
        },
        "extended_entities": {
            "media": [
                {
                    "id": 755822116079935500,
                    "id_str": "755822116079935488",
                    "indices": [
                        144,
                        167
                    ],
                    "media_url": "http://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "media_url_https": "https://pbs.twimg.com/media/Cn04NcZUIAAM0B0.jpg",
                    "url": "https://t.co/ws1QmqeYo6",
                    "display_url": "pic.twitter.com/ws1QmqeYo6",
                    "expanded_url": "http://twitter.com/ygritteygritte/status/755822121331281920/photo/1",
                    "type": "photo",
                    "sizes": {
                        "medium": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        },
                        "small": {
                            "w": 680,
                            "h": 510,
                            "resize": "fit"
                        },
                        "thumb": {
                            "w": 150,
                            "h": 150,
                            "resize": "crop"
                        },
                        "large": {
                            "w": 960,
                            "h": 720,
                            "resize": "fit"
                        }
                    }
                }
            ]
        }
    },
    "display_text_range": [
        0,
        140
    ],
    "actor": {
        "objectType": "person",
        "id": "id:twitter.com:735369652956766208",
        "link": "http://www.twitter.com/ygritteygritte",
        "displayName": "Ygritte",
        "postedTime": "2016-05-25T07:19:22.568Z",
        "image": "https://pbs.twimg.com/profile_images/735370259566329856/3mxqMJEq_normal.jpg",
        "summary": null,
        "friendsCount": 0,
        "followersCount": 0,
        "listedCount": 0,
        "statusesCount": 0,
        "twitterTimeZone": null,
        "verified": false,
        "utcOffset": null,
        "preferredUsername": "ygritteygritte",
        "languages": [
            "en"
        ],
        "links": [
            {
                "href": null,
                "rel": "me"
            }
        ],
        "favoritesCount": 0
    },
    "object": {
        "objectType": "note",
        "id": "object:search.twitter.com,2005:755822121331281920",
        "summary": "this is a tweet with 140 characters of display range text, which means that with an image attachment the full tweet… https://t.co/ECfyrsRRTG",
        "link": "http://twitter.com/ygritteygritte/statuses/755822121331281920",
        "postedTime": "2016-07-20T17:50:10.000Z"
    },
    "favoritesCount": 0,
    "twitter_entities": {
        "hashtags": [],
        "urls": [
            {
                "url": "https://t.co/ECfyrsRRTG",
                "expanded_url": "https://twitter.com/i/web/status/755822121331281920",
                "display_url": "twitter.com/i/web/status/7…",
                "indices": [
                    117,
                    140
                ]
            }
        ],
        "user_mentions": [],
        "symbols": []
    },
    "twitter_lang": "en",
    "retweetCount": 0,
    "twitter_filter_level": "low"
}
        
{
  "created_at": "Tue Sep 26 21:06:44 +0000 2017",
  "id": 912785533910306817,
  "id_str": "912785533910306817",
  "text": "So this is my first experimental Tweet with 280 characters, enabling me to express all my hopes and dreams for the… https://t.co/Nz6dQf3rIr",
  "source": "Twitter Web Client",
  "truncated": true,
  "in_reply_to_status_id": null,
  "in_reply_to_status_id_str": null,
  "in_reply_to_user_id": null,
  "in_reply_to_user_id_str": null,
  "in_reply_to_screen_name": null,
  "user": {
    "id": 17200003,
    "id_str": "17200003",
    "name": "Jim ❄️☃🌎",
    "screen_name": "snowman",
    "location": "MN ⇨ all over ⇨ CO",
    "url": null,
    "description": "family, travel, music, snow, urban farming, photography, coding, weather, hydrology, early-warning systems. From Minnesota, live in Colorado.",
    "translator_type": "regular",
    "protected": false,
    "verified": false,
    "followers_count": 751,
    "friends_count": 457,
    "listed_count": 39,
    "favourites_count": 2094,
    "statuses_count": 1637,
    "created_at": "Wed Nov 05 23:06:37 +0000 2008",
    "utc_offset": -21600,
    "time_zone": "Mountain Time (US & Canada)",
    "geo_enabled": true,
    "lang": "en",
    "contributors_enabled": false,
    "is_translator": false,
    "profile_background_color": "C0DEED",
    "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/846867852/0962a373696e2080d26659b920880fc8.jpeg",
    "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/846867852/0962a373696e2080d26659b920880fc8.jpeg",
    "profile_background_tile": true,
    "profile_link_color": "ABB8C2",
    "profile_sidebar_border_color": "FFFFFF",
    "profile_sidebar_fill_color": "DDEEF6",
    "profile_text_color": "333333",
    "profile_use_background_image": true,
    "profile_image_url": "http://pbs.twimg.com/profile_images/697445972402540546/2CYK3PWX_normal.jpg",
    "profile_image_url_https": "https://pbs.twimg.com/profile_images/697445972402540546/2CYK3PWX_normal.jpg",
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/17200003/1399004533",
    "default_profile": false,
    "default_profile_image": false,
    "following": null,
    "follow_request_sent": null,
    "notifications": null
  },
  "geo": null,
  "coordinates": null,
  "place": {
    "id": "fd70c22040963ac7",
    "url": "https://api.twitter.com/1.1/geo/id/fd70c22040963ac7.json",
    "place_type": "city",
    "name": "Boulder",
    "full_name": "Boulder, CO",
    "country_code": "US",
    "country": "United States",
    "bounding_box": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -105.301776,
            39.953552
          ],
          [
            -105.301776,
            40.094411
          ],
          [
            -105.183597,
            40.094411
          ],
          [
            -105.183597,
            39.953552
          ]
        ]
      ]
    },
    "attributes": {
      
    }
  },
  "contributors": null,
  "is_quote_status": false,
  "extended_tweet": {
    "full_text": "So this is my first experimental Tweet with 280 characters, enabling me to express all my hopes and dreams for the future of the Twitter platform, while also ignoring the voices in my head about poorly written parsers exploding around the globe... #AddingText4Exactly280Characters",
    "display_text_range": [
      0,
      280
    ],
    "entities": {
      "hashtags": [
        {
          "text": "AddingText4Exactly280Characters",
          "indices": [
            248,
            280
          ]
        }
      ],
      "urls": [
        
      ],
      "user_mentions": [
        
      ],
      "symbols": [
        
      ]
    }
  },
  "quote_count": 0,
  "reply_count": 4,
  "retweet_count": 0,
  "favorite_count": 2,
  "entities": {
    "hashtags": [
      
    ],
    "urls": [
      {
        "url": "https://t.co/Nz6dQf3rIr",
        "expanded_url": "https://twitter.com/i/web/status/912785533910306817",
        "display_url": "twitter.com/i/web/status/9…",
        "indices": [
          116,
          139
        ]
      }
    ],
    "user_mentions": [
      
    ],
    "symbols": [
      
    ]
  },
  "favorited": false,
  "retweeted": false,
  "filter_level": "low",
  "lang": "en",
  "matching_rules": [
    {
      "tag": null
    }
  ]
}
        

Additional Considerations&nbsp

To help illustrate the below considerations, we will use the term “condition” in reference to a Tweet that exceeds the length limit total characters of text and/or has hidden text.

Quote Tweets

Quote Tweets will have the same behavior as standard Tweets. If either the quoted Tweet or the original Tweet meets the new condition, then they will have the same extended_tweet / long_object object and/or display_text_range in the payload. The extended_tweet / long_object will be at the root-level if the quoted status meets the new condition and/or within the “quoted_status” section of the payload if the Tweet being quoted meets the new condition.

For clarity, below are the four scenarios that you can expect with Quote Tweets:

  1. Neither the Quote Tweet nor the original Tweet meet the new condition: no extended_tweet / long_object present in the payload.
  2. The Quote Tweet meets the new condition but original Tweet does not: presence of root-level extended_tweet / long_object in the payload.
  3. The Quote Tweet does not meet the new condition but original Tweet does: presence of extended_tweet / long_object in “quoted_status” section of the payload.
  4. Both the Quote Tweet and original Tweet meet the new condition: presence of extended_tweet / long_object in both the root-level and “quoted_status” section of the payload.

Retweets

Retweets function slightly different than the above behavior described for a Quote Tweet. If the Retweet status meets the new condition, then the extended_tweet / long_object object and/or display_text_range will only be present in the retweeted_status object of the payload (e.g., object.long_object for AS format). To properly get data from a Retweet with the new condition, your app should use the inner-most “body” field and extended_tweet / long_object objects in the payload (e.g., object.long_object).


FAQs&nbsp

Are there plans to update the Twitter4J, Gnip4J and Tweet-Text libraries?

  • Twitter4J and Gnip4J are third-party libraries, so any updates are outside of our purview.

  • Twitter-text is an open source Twitter project but we concluded there are probably no changes required. If we determine changes are needed, we would share them in the future.

Is there a limit to the # of @mentions in a tweet?

  • There will be a server-side limitation of up to 50 @mentions.

What about POST / Compose / Create behaviors and endpoints?

  • The Gnip team does not manage these endpoints or interactions and you should refer to the broader developer documentation for details.

Why does the display_text_range in the payload for extended_tweet exceed the Tweet lenght limit?

  • This generally won’t be the case; however, it is possible for the display_text_range in the payload to exceed the length limit due to HTML entity encoding of &, <, and > symbols.