How can I get tweet URL having only the tweet id?
I found a solution but I want to know if there is a better one. First, I assume you have to do a query and search after the tweet id obtaining the user name, and after that build the URL as follows:
https://twitter.com/{username}/status/{tweetid}.
Is this correct? Is there an easier solution which doesn't imply doing the query first?
You don't need to use the API or know the user account. Just drop it into the following URL format, where XXXXXXXXX is the tweet id.
Tap the share icon then tap Tweet this Moment to see the URL in the Tweet compose view. From this menu pop-up you also have the option to copy the URL link. Click on the Moment and find its URL in the address bar of your web browser.
Today, Twitter IDs are unique 64-bit unsigned integers, which are based on time, instead of being sequential. The full ID is composed of a timestamp, a worker number, and a sequence number.
It appears that https://twitter.com/statuses/{tweetid} suggested by anas-eqal no longer works consistently. Thus, I went hunting for an alternative. I concede that the accepted response, as of the time of this reply, works perfectly well. However, for my use case I needed a url that avoids a redirect and has a more consistent structure.
Here is what I came up with:
Both variants work well in all my tests to date.
You don't need the username.
Here's one of my tweets
https://twitter.com/edent/status/552767187694661632
If you replace my Twitter name (edent) with any other random name....
https://twitter.com/barackobama/status/552767187694661632
When you click on that link, Twitter will look up the Status ID and automatically redirect you.
So, don't bother doing the query, just stick any random name in there and it will still work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With