Search endpoint & multiple media entities: 2 media that are the same.. but are not!

media
search

#1

Take for example tweet with ID: 1102595853842350080.

RT @kdramascenes: me when everyone’s comparing test scores https://t.co/0PE1Q7Bxxn

When requesting this tweet through the API (specifically the /search endpoint, haven’t tested fetching the tweet directly), this tweet actually returns 2 media entities:

#1

ID: 1099603246413475840
URL: https://t.co/0PE1Q7Bxxn
Media URL: http://pbs.twimg.com/media/D0KTU6BXcAALihV.jpg
Expanded URL: https://twitter.com/kdramascenes/status/1099603255221469185/photo/1
Start: 59
End: 82

#2

ID: 1099603246413422592
URL: https://t.co/0PE1Q7Bxxn
Media URL: http://pbs.twimg.com/media/D0KTU6BWoAAOUKm.jpg
Expanded URL: https://twitter.com/kdramascenes/status/1099603255221469185/photo/1
Start: 59
End: 82

This looks wrong to me:

  • How can a URL point to 2 different media?
  • How can the start&end be the same, i.e. that piece of text actually means 2 media?

Can anyone confirm if this behavior is correct, or not?


#2

Yes, this correct:

1102595853842350080 is a retweet of 1099603255221469185 - this doesn’t have anything to do with the media urls though, that just means we have to look in retweeted_status object in 1102595853842350080 - that will contain the relevant media URLs.

But this tweet has 2 photos attached, so it will have an extended_media property, that will list all the photos. the entities property in the json will only list the first one.

I’d think of https://t.co/0PE1Q7Bxxn url as the url of the tweet “attachment” which can be one or more photos.

Hope that helps!


closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.