Hello

I am trying to receive analytical reports from Twitter Ads API for the several accounts. I requested accounts information, campaigns and generate reports for each of them. I use such key metrics as clicks, impressions and billed_charge_local_micro (spend column on the screenshots) for comparing them.
After comparing with gui, I received such results:


left table extracted by the Twitter API, middle table is GUI data, right table is the table with discrepancy in red cells.

Screenshots from gui:

(18ce53uyoec)

(18ce54vcyco)

(18ce55bff8q)

So, I use the same algorithm for all accounts. Midnight time used as start_time parameter in the algorigthm. First of all, I request active_entities url to get all campaigns in the period of time:

curl -H 'Authorization: OAuth oauth_nonce="--", oauth_signature="--", oauth_callback="--", oauth_token="--", oauth_consumer_key="--", oauth_signature_method="--", oauth_version="1.0", oauth_timestamp="--"' -A 'Jersey/2.31' 'https://ads-api.twitter.com/10/stats/accounts/18ce55bff8q/active_entities?start_time=2021-12-26T23%3A00%3A00Z&end_time=2022-01-01T23%3A00%3A00Z&entity=CAMPAIGN

Then I create jobs, monitor progress and compute final results:

curl -X POST --data '' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: OAuth oauth_nonce="--", oauth_signature="--", oauth_callback="--", oauth_token="--", oauth_consumer_key="--", oauth_signature_method="--", oauth_version="1.0", oauth_timestamp="--"' -A 'Jersey/2.31' 'https://ads-api.twitter.com/10/stats/jobs/accounts/18ce55bff8q?start_time=2021-12-26T23%3A00%3A00Z&granularity=DAY&end_time=2022-01-01T23%3A00%3A00Z&metric_groups=LIFE_TIME_VALUE_MOBILE_CONVERSION%2CBILLING%2CVIDEO%2CMOBILE_CONVERSION%2CENGAGEMENT%2CMEDIA%2CWEB_CONVERSION&placement=ALL_ON_TWITTER&entity_ids=gmif1%2Cgtu0u%2Cgqexi%2Cg0qfs%2Cgtv6d%2Cgtufj%2Cgmisp&entity=CAMPAIGN'

But I see these discrepancies after all transformations. Why do these discrepancies appear?

Looking at the screenshot for 18ce53uyoec, the two campaigns show spend in Euros. The Total Spend is showing results as Dollars. Adding both campaigns results in the same result as the Ads API. The advertiser would need to reach out to Twitter Ads - Help to get support displaying this value in Euros if they are looking to match across platforms.

I will need to take a closer look at the second two discrepancies you’ve reported but this is usually caused by a few common scenarios.

Statistics differences between the API and UI are usually caused by a few different things:

  1. Your application will need to make requests for both placements, ALL_ON_TWITTER and PUBLISHER_NETWORK , separately and sum up the results to match the UI,
  2. date ranges in the UI are inclusive while the end_time is exclusive in the API, and
  3. the API will default to midnight in the accounts local timezone, if not specified

The timeframe and number of entities makes it difficult to isolate what the problem is. Could you reproduce this with a smaller set of entities and shorter timeframe?