Search code examples
twitter

need to get url attached to the tweet (status)


When I try to get the tweet (status) using this API endpoint https://api.twitter.com/1.1/statuses/show.json?id= the entities object which have urls does not provide me the link posted with the status, in the urls object there is only the tweet url itself.

example https://twitter.com/i/web/status/1148391479490043910

in this status there is an attached url

https://www.realitytvworld.com/news/tyler-cameron-13-things-know-about-the-bachelorette-star-hannah-brown-bachelor-tyler-cameron--26081.php

the shortest one is

https://t.com/LtkuldDijy

I need to get this url mentioned above in the urls subobject of entities object

Does anyone face this issue?


Solution

  • after a ton of searches and tries, I got the reason

    the issue was because of the truncate issue of the tweet itself, so when request twitter API, must add 'tweet_mode=extended' to the request and everything work perfectly !