0 Replies
      Latest reply on Oct 8, 2019 1:25 PM by theoaf
      theoaf Level 1 Level 1 (0 points)

        Hi there


        I'm trying to access the apple search ads API. However, the responses I'm getting are quite different to what I see on the web gui.


        For example when I run the following in python:


        params = {"startTime": '2019-10-01',
                  "endTime": '2019-10-01',
                  "selector": {
                      "orderBy": [{"field": "impressions", "sortOrder": "ASCENDING"}],
                      "pagination": {"offset": 0, "limit": 1000}},
                  "granularity": 'DAILY',
                  "timeZone": "UTC",
                  "returnRecordsWithNoMetrics": 'false',
                  "returnRowTotals": 'true',
                  "returnGrandTotals": 'true'
        response = requests.post('https://api.searchads.apple.com/api/v2/reports/campaigns', data=json.dumps(params),
                                 headers=headers, cert=(cert, key))
        res = response.json()
        campaigns = res['data']['reportingDataResponse']['row']
        UK_Brand = [campaign for campaign in campaigns if campaign['metadata']['campaignName']=='GB_UK Brand_New']


        I get the following response:


        {'impressions': 115,
         'taps': 22,
         'installs': 17,
         'newDownloads': 14,
         'redownloads': 3,
         'latOnInstalls': 0,
         'latOffInstalls': 17,
         'ttr': 0.1913,
         'avgCPA': {'amount': '1.4917', 'currency': 'GBP'},
         'avgCPT': {'amount': '1.1527', 'currency': 'GBP'},
         'localSpend': {'amount': '25.3595', 'currency': 'GBP'},
         'conversionRate': 0.7727}



        when I look on the GUI I get:



        It's not even that different, but its still just wrong and I have no idea why.



        Please help.