Twitter / X have user intent URLs so that you can auto-resolve from a user id to a profile url:
These work if you are logged in to twitter - but if you're not logged in they go to an error page.
If someone can help me find a way around this I'll pay the bounty.
Thanks! :)
25,000 sats bounty
MerryOscar's bounties
Or use twitter api if you willing to intergrate this in your app
I think this will work GET https://api.twitter.com/1.1/users/show.json?user_id=ID
Replace ID with the user id
reply
Isn't it possible to just request get the website and parse the html statically?
reply
It seems like Twitter user intent URLs are designed to work when you're logged in, providing seamless redirection from user IDs to profile URLs. If you're not logged in, it may result in an error page possibly due to privacy or access restrictions
reply