Maximum of 200 promoted_tweet_ids?


#1

I am trying to crawl my account which has thousands of historical promoted tweets. I’m getting the error “A maximum of 200 items can be provided for promoted_tweet_ids”. This is self-explanatory, but I’m not sure what is actually a viable way to crawl my account since I don’t know what was live and what wasn’t a month ago. Is there a way to to ask for all non-zero stats on a day as opposed providing an explicit promoted_tweet_ids list to the endpoint ‘https://ads-api.twitter.com/0/stats/accounts/[account ID]/promoted_tweets’?

Thank you,
-Daniel


#2

When fetching analytics for an advertiser account, we recommend starting with our Analytics Best Practices. The key here is understanding when to query for certain entities based on their attributes and relationship to other entities in the object hierarchy (line item, campaign, funding instrument, etc). You will also find implementation tips for standard use cases.

We know, for example, that a Promoted Tweet (PTw) is always associated to a line item (ad group). If the line item is active, we’d want to collect stats for the PTw. Take a look at our supplementary script fetch_stats.py that demonstrates more on determining what’s active and and which PTws are relevant for fetching real-time, non-segmented stats. Pay close attention to the check() logic where specific attributes of entities are checked to determine whether or not to query for the entity.

If your particular use case is not fully covered here, do let us know. Happy to continue the discussion!