Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Insights API - getting error code 1 with subcode 99

We are retrieving Insights data via the Facebook Marketing API. We are using the Python "facebookads" module for this. I was downloading historic data in the past for all of our accounts which was working perfectly fine. Since 2 weeks or so I am getting this error:

2018-06-01 16:01:57 - (DEBUG) - urllib3.connectionpool - https://graph.facebook.com:443 "GET /v2.11/act_nnnn/insights?access_token=&appsecret_proof=&time_range=%7B%22since%22%3A%222018-05-08%22%2C%22until%22%3A%222018-05-08%22%7D&level=ad&breakdowns=%5B%22impression_device%22%5D&filtering=%5B%7B%22field%22%3A%22spend%22%2C%22operator%22%3A%22GREATER_THAN%22%2C%22value%22%3A%220%22%7D%5D&limit=5000&fields=account_id%2Ccampaign_id%2Ccampaign_name%2Cadset_id%2Cadset_name%2Cad_id%2Cad_name%2Cimpressions%2Cclicks%2Creach%2Cspend%2Caccount_currency%2Cactions%2Caction_values%2Ctotal_actions%2Ctotal_action_value HTTP/1.1" 500 77

2018-06-01 16:01:57 - (DEBUG) - FacebookAdsDownloader - An exception occurred:

Message: Call was not successful

Method: GET

Path: https://graph.facebook.com/v2.11/act_nnnn/insights

Params: {'time_range': '{"since":"2018-05-08","until":"2018-05-08"}', 'level': 'ad', 'breakdowns': '["impression_device"]', 'filtering': '[{"field":"spend","operator":"GREATER_THAN","value":"0"}]', 'limit': 5000, 'fields': 'account_id,campaign_id,campaign_name,adset_id,adset_name,ad_id,ad_name,impressions,clicks,reach,spend,account_currency,actions,action_values,total_actions,total_action_value'}

Status: 500

Response: { "error": { "code": 1, "message": "An unknown error occurred", "error_subcode": 99 } }

Anyone has an idea, why I get this error? This very same request was working already. I have retried the same request over and over.

like image 939
stack_lech Avatar asked Mar 06 '23 01:03

stack_lech


1 Answers

Shireesh Asthana from Facebook Developer team mentions here that too much data is requested and asynchronous requests have to be used. Example can be found here: retrieve async ads insights results from FB ads API with pagination

like image 68
stack_lech Avatar answered Mar 12 '23 02:03

stack_lech