1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Facebook API - Insights: Status: 500, error code 1, "An unknown error occurred" at...

Discussão em 'Python' iniciado por Stack, Setembro 12, 2025.

  1. Stack

    Stack Membro Participativo

    Of the late when trying to fetch data from FB's Marketing API, I get following error:


    Status: 500
    Response:
    {
    "error": {
    "code": 1,
    "message": "An unknown error occurred"
    }
    }​

    at times. If I try to immediately make the same request via Postman, it returns data at times and at times throws 500 status error. Below is the data being sent to FB

    facebookads.exceptions.FacebookRequestError:

    Message: Call was not successful
    Method: GET
    Path: https://graph.facebook.com/v2.3/act_XYZ/insights
    Params: {
    'time_increment': 1,
    'level': 'adgroup',
    'fields': '["account_name", "deeplink_clicks",
    "campaign_name",
    "social_impressions",
    "campaign_group_name",
    "campaign_id",
    "adgroup_name",
    "unique_impressions",
    "social_reach",
    "unique_social_impressions",
    "placement",
    "total_actions",
    "cpm",
    "impressions",
    "ctr",
    "reach",
    "clicks",
    "social_clicks",
    "spend",
    "website_clicks",
    "adgroup_id",
    "actions",
    "cpc",
    "cpp",
    "unique_clicks",
    "app_store_clicks",
    "unique_social_clicks",
    "account_id",
    "campaign_group_id"
    ]',
    'breakdowns': '["placement"]',
    'time_range': '{"since":"2015-09-01","until":"2015-09-09"}',
    'summary': None
    }

    Status: 500
    Response:
    {
    "error": {
    "code": 1,
    "message": "An unknown error occurred"
    }
    }


    I am using Facebook's Python SDK from


    Can someone please let me know what I might be missing in this case?

    Thanks.

    Continue reading...

Compartilhe esta Página