Updating how URLs are rendered in the Quote Tweet payload

data
quotetweet
urls
json

#1

Today, we want to share a few changes that are coming to the Quote Tweet payload that we expect will provide some clarity and efficiencies as you work with our data. These changes are initially additive and can be seen very soon in most Tweet payloads, but will eventually be a breaking change as we remove a few existing fields.

We are updating the way that URLs are rendered in the Quote Tweet payload.

To start, it’s important to understand how URLs are delivered in the Quote Tweet payload today. Every Quote Tweet includes both the Quote Tweet details as well as the quoted Tweet’s details. Below you can see an example of a Quote Tweet with the quoted Tweet’s quoted_status object. Notice that the text field in the Quoted Tweet includes the text of the Quote Tweet as well as the t.co URL for the quoted Tweet.

You can also see that the t.co link is appended to the end of the text field in the Quote Tweet. Note that this Quote Tweet has a URLs array listed that includes the URL of the quoted Tweet.

{  
   "created_at":"Mon May 07 19:43:04 +0000 2018",
   "id":993576970934931456,
   "id_str":"993576970934931456",
   "text":".@danielricciardo is just fantastic. Hoping he finds or stays with a team that appreciates him! https:\/\/t.co\/UenF8rZZfQ",
   "entities":{  
      "hashtags":[  

      ],
      "urls":[  
         {  
            "url":"https:\/\/t.co\/UenF8rZZfQ",
            "expanded_url":"https:\/\/twitter.com\/f1\/status\/993078922454577152",
            "display_url":"twitter.com\/f1\/status\/9930\u2026",
            "unwound":{  
               "url":"https:\/\/twitter.com\/f1\/status\/993078922454577152",
               "status":200,
               "title":"Formula 1 on Twitter",
               "description":"\u201cIt could be stick or twist time for Daniel Ricciardo soon Where will #F1's smiling assassin end up in 2019? \u2b07\ufe0f https:\/\/t.co\/VCDhvOr6w6\u201d"
            }
         }
      ]
   },
   "quoted_status":{  
      "entities":{  
         "urls":[  
            {  
               "url":"https:\/\/t.co\/VCDhvOr6w6",
               "expanded_url":"https:\/\/f1.com\/RIC-SillySeason",
               "display_url":"f1.com\/RIC-SillySeason",
               "unwound":{  
                  "url":"https:\/\/www.formula1.com\/en\/latest\/features\/2018\/5\/daniel-ricciardo-f1-silly-season-where-will-he-race.html",
                  "status":200,
                  "title":"SILLY SEASON - Who will Daniel Ricciardo race for in 2019?",
                  "description":"The F1 silly season is rapidly approaching, and there's one driver whose name will dominate this year's discussions: Daniel Ricciardo. The Australian is a man with options. Red Bull want to keep him - but he has also been linked with moves to Mercedes and Ferrari. And Renault have been interested in the past too. So where will he end up? Lawrence Barretto takes a look at the possibilities\u2026"
               }
            }
         ]
      }
   }
}

Over the years, we’ve heard from you that this creates a few problems with parsing the quoted Tweet’s URL from other URLs that may be included in the Quote Tweet or quoted_status.

Moving forward, we’re adding a new entity called the quoted_status_permalink to ensure the quoted Tweet can be easily referenced. We’ll also be removing the t.co link from the Quote Tweet’s text field as well as from the Quote Tweet’s urls array. Note that there will be a period of time where the quoted Tweet’s URL details will be in both locations. An example of the final end state is below:

{  
   "created_at":"Mon May 07 19:43:04 +0000 2018",
   "id":993576970934931456,
   "id_str":"993576970934931456",
   "text":".@danielricciardo is just fantastic. Hoping he finds or stays with a team that appreciates him!",
   .... 
   "is_quote_status":true,
   "quoted_status_id":987035623923027975,
   "quoted_status_id_str":"987035623923027975",
   "quoted_status_permalink":{  
      "url":"https:\/\/t.co\/UenF8rZZfQ",
      "expanded":"https:\/\/twitter.com\/f1\/status\/993078922454577152",
      "display":"twitter.com\/f1\/status\/9930\u2026"
   },
   "entities":{  
      "urls":[  

      ]
   },
   "quoted_status":{  
      "text":"It could be stick or twist time for Daniel Ricciardo soon\n\nWhere will #F1's smiling assassin end up in 2019? \u2b07\ufe0f\n\nhttps:\/\/t.co\/VCDhvOr6w6",
      "entities":{  
         "urls":[  
            {  
               "url":"https:\/\/t.co\/VCDhvOr6w6",
               "expanded_url":"https:\/\/f1.com\/RIC-SillySeason",
               "display_url":"f1.com\/RIC-SillySeason",
               "unwound":{  
                  "url":"https:\/\/www.formula1.com\/en\/latest\/features\/2018\/5\/daniel-ricciardo-f1-silly-season-where-will-he-race.html",
                  "status":200,
                  "title":"SILLY SEASON - Who will Daniel Ricciardo race for in 2019?",
                  "description":"The F1 silly season is rapidly approaching, and there's one driver whose name will dominate this year's discussions: Daniel Ricciardo. The Australian is a man with options. Red Bull want to keep him - but he has also been linked with moves to Mercedes and Ferrari. And Renault have been interested in the past too. So where will he end up? Lawrence Barretto takes a look at the possibilities\u2026"
               },
               "indices":[  
                  113,
                  136
               ]
            }
         ]
      }
   }
}

Developers who parse Quote Tweet URLs from either the text, or the urls array of the Quoted Tweet, should update their parsers to follow this new logic by mid-June to avoid disruption. We will return this new format data in all of our APIs in mid-May, 2018. We’ve further documented these changes in our reference documentation, take a look for more details.


#2