HI,
When tweet contains the shorten urls, once we extract the shorten urls how to get the actual url link instead of shorten url?

Thanks
Abdul

If it’s a third party url shortener like bit.ly you would have to make an http HEAD or GET request and follow the redirects to the final location.

Hi Igor,

Shorten URLs are like t.co ** and actual URL will be something like https://www.news.com.au/national/nsw-act/new****, if I use GET for shorten url, I am getting source of url instead of actual url

Thanks
Abdul

ah ok - the t.co shortener gets applied to every url, even already shortened ones. So if the url you want is like https://www.news.com.au/national/nsw-act/... then this url should be inside the urls object in the json in expanded_url Tweet object | Docs | Twitter Developer Platform - but you’ll have to specify this field to be included using tweet.fields=entities url parameter Using fields and expansions | Docs | Twitter Developer Platform