Hello!
We’re having a little problem with the python sdk, and I did not find any suitable answers at the forum.
Doing async requests methods (queue_async_stats_job >> async_stats_job_result >> for result in async_stats_job_results, then parsing it to get what we need (not putting code snippets here because I’m using airflow to orchestrate data requests)) returns less impressions than expectated in the Ads UI (yes, we are using both types of placements when requesting, and the timezone is correct; using yyyy-mm-dd to get default account timezone)
Here’s a print to illustrate what’s happening.

No. of impressions in 2022-11-06 as shown at Ads UI

No. of impressions in 2022-11-06 as returned with sdk async requests
Do you guys have any ideas why we having this (little) discrepancy with the impressions metric? The other ones (clicks and cost) matches perfectly, so we are not understanding this non-regular behavior.
Looking foward for your answers,
Thanks!
Jasl692
#2
Hi @arthurvinicius,
Could you provide the ad account ID, and the full API request? So I can test it on my end.
Thanks!
1 Like
AD account ID: 18ce55h2wzr
Parameters:
entity=PROMOTED_TWEET
metric_groups=ENGAGEMENT, BILLING, VIDEO
placement=both ALL_ON_TWITTER and PUBLISHER_NETWORK (on different api calls, ofc)
granularity=DAY
start_time=2022-11-06 (as said in the exemple)
end_time=2022-11-07
For each of the different api requests (with different placements), all the parameters are the same.
Our SDK methods flow is quoted at the first post.
Thanks!
Jasl692
#4
Thanks @arthurvinicius. Do you have the whole list of PROMOTED_TWEET entity IDs (since you’re using entity=PROMOTED_TWEET) that are used in the API request?
1 Like
Yes, however, it’s a pretty big list (approx. 601 items) and I can’t upload a .txt file here.
So I’m linking a google docs for it:
Jasl692
#6
Thank you. From Ads Manager UI, on 6 Nov 2022 where the total impressions for the day is 1266861, I’m seeing a total of 617 promoted tweets. It seems like you might only be pulling 601 promoted tweets, can you try the API again with all 617 promoted tweets entities?
Can you exemplify for us how you did this request to list all promoted tweets?
Tried to get 617 promoted tweets but couldn’t pull it.
I saw 617 promoted tweets in the Ads Manager:
There isn’t an API to pull all promoted tweets based on date, but an easier way is pulling all the line item IDs on that day, and then using /promoted_tweets with line_item_ids parameter to get the promoted tweet IDs.
One thing I noticed though is based on Ads Manager of your account, only about 32 line items and 322 promoted tweets have an impression of 1 or more. So there should be no need to pull all the promoted tweets as the rest are 0 impressions anyway.