Which url gets previewed


If there are multiple urls included in a tweet, is there a way to know which url will get previewed in the app?

Which URL gets previewed?

I think it is the last one. Although since the Tweet composer does show a preview on mobile, it might also be the first one. I’m also pretty sure that if a page has multiple sets of cards tags, then the last one encountered by the parser defines the card that is shown.


Clarifying a little bit on our specific use case, we are including a bit.ly and then a pic.twitter link that already exists.
We have seen post where sometimes is previews the webpage and other times previews the image.


That is surprising - the Twitter media link is almost always preferred over the card link image. That may depend on whether the pic.twitter media content is directly attached to the Tweet vs being referred to. I’d have to spelunk through some code to check on that.


I can confirm we are NOT attaching the image directly, and that the pic.twitter url is the last url in the message.

Doesn’t seem to be the same across platforms. We have noticed it on iOS mobile app.
Web and Android appear to show as was expected.

Could it be a caching issue if the pic.twitter link is used in multiple outgoing tweets?


For sure, possibly. It’s always difficult to diagnose client issues from the API side, unfortunately.


We are going to look to move our platform to use media ids instead of a pic.twitter url

Based on what I have researched this should ensure that its the image that is always shown, regardless of any urls in the body of the tweet.


Will using a media id for the image override any other url previews? or is this still device/platform specific behavior?


Yes, attaching a media id means that you’re adding an image to the Tweet, and that will always be shown in preference to a card from a URL.


perfect! thanks for your help