xdevplatform/Twitter-API-v2-sample-code

[BUG] `GET /2/tweets/:id` not returning tweet url for some/many tweets

Closed this issue · 1 comments

Describe the bug
This is an issue with the Twitter API V2, which I have noticed that for many tweets it does not return the url mentioned in the tweet or as part of the attached media.

To Reproduce
Try finding tweet details for the following tweet:
1537477582194626560 (accessible via https://twitter.com/961227801365008385/status/1537477582194626560). This will give you correct results (url included)

Now do the same for the following tweet:
id: 1559108202666397696 accessible via https://twitter.com/961227801365008385/status/1559108202666397696. Although the tweet has a url, the API will NOT return it.

Expected behavior
API response matches what we see in the tweet via the link and tweet URLs are returned properly.

Additional context
I could confirm this issue via the Live Request of Twitter API dashboard as well as with Python client.

It will be resolved by adding the expansions=referenced_tweets.id to the API call so that urls of reference tweets are also included.