If the picture is in `

If the picture is in pbs. twimg. com/media/ , then it is in the subarrays of the $ utimeline array. And if the picture is in pbs. twimg. com/ad_img/ , then it is not in any subarray.

Question: What tools of the Twitter API should I use to solve the problem of extracting pictures?

Example of img
pbs. twimg. com/ad_img/1100828604211040256/Q8LsMZsP?format=jpg&name=orig

PS Sorry for my English

any idea?

Is this for public tweets or DMs? For loading pictures in DMs: Retrieving media | Docs | Twitter Developer Platform

For regular tweets these urls are found in Entities object | Docs | Twitter Developer Platform or extended entities Extended entities object | Docs | Twitter Developer Platform

Sometimes, tweets that are Ads do not have these entities, and the ad media is not retrievable this way.

2 Likes

Hello. Thank you for your answer. Which method I should use for extracting pictures from Ads?
This is the main question… and problem.
I will be glad for ANY idea.

It’s not possible to do from the API as far as i know, unless you own the ads account, in that case - you need to specify include_card_uri=true parameter in a call to fetch the tweet Identifying Cards | Docs | Twitter Developer Platform

1 Like

Ads images are not part of the API unless you are whitelisted for access to the Ads API and are the account owner.

Can I ask why you want / need to “extract images” in this context? it may be helpful to inform our future API efforts to understand your needs here.

1 Like

In my idea, I need all the pictures. I don’t care if these are regular posts or advertising. And it’s a problem that the API gives only regular ones.

Sorry to say but I’m am not aware of any current plans to alter the way images are served here; my advice would be to rethink the project parameters. I realise that this is not the answer you’re looking for, and I apologise, but I’d rather let you know that, rather than bang your head on a wall!

You’re welcome to add this idea and some of the background justification on our ideas site as we look at building the new version of the APIs - https://twitterdevfeedback.uservoice.com

1 Like

Andy, thank you very much for your time and knoleges

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