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, Vines, and more. A few months ago, we announced a forthcoming set of changes around what will count toward a Tweet’s 140 characters where @replies and attachments (photos, GIFs, videos, and polls, Quote Tweets) will no longer count toward the character limit. The following guidance and conditions apply to all Gnip APIs and the Twitter Streaming APIs (and the compat-extended mode of the Twitter REST APIs).


What is Changing?&nbsp

Anything that currently gets added to a Tweet based on the click of a button will no longer count toward a Tweet’s 140 character limit or be rendered with the Tweet’s displayed text. Anything that is typed/entered/pasted into the compose box by a user, such as standard @mentions and/or traditional web URLs, will continue to count toward a Tweet’s 140 character limit and be rendered within the Tweet’s displayed text.

  • 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. URLs typed or pasted inside the Tweet will be counted 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 does not exceed 140 characters, but - when @replies and/or media attachment URLs are present - the text content of the overall Tweet JSON object will be able to exceed 140 characters. 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 which remains a maximum of 140 characters in length.
    • 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 < 140 Characters, 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 < 140 Characters 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 140 characters, 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. Twitter is not specifically prescribing how hidden text should be displayed, but some examples to consider are included in the general developer documentation.

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"
}
        

Tweets > 140 Characters (AKA Extended Tweet with “Hidden Text”)

If a Tweet body exceeds 140 characters 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 140 characters 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"
}
        

Payload Examples (download zip files)&nbsp

We have generated an additional set of payload examples in a variety of different variations (all of the variants above including original, reply, retweet, quoted) that you can download. Click to download the zip files below:


Additional Considerations&nbsp

To help illustrate the below considerations, we will use the term “condition” in reference to a Tweet that exceeds 140 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).

Requesting the same format on the Twitter Public REST APIs

The same payload format as described in this doc (with the same conditionals) can be requested via the Public Twitter REST APIs using tweet_mode=compat-extended to allow developers across the 3 different API categories to utilize a single format.


FAQs&nbsp

Will all of the consumer changes be rolled out at once?

  • No, it is likely that the consumer changes will be rolled out in multiple phases, with the exclusion of attachment URLs likely to come first and @replies to follow.

When will the consumer changes be rolled out?

  • These changes will begin to be rolled out over the next couple of months. You should be prepared for these changes to roll out as soon as 9/12/2016.

Is there a “test” environment I can use?

  • No, there are no current plans to provide a test environment or endpoint related to these changes.

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 140 characters?

  • This generally won’t be the case; however, it is possible for the display_text_range in the payload to exceed 140 characters due to HTML entity encoding of &, <, and > symbols. That being said, the field length is limited to 140 display characters.