I'm developing a tool in python which exports Facebook KPIs daily.

So far so good, I managed to get it to work and it is working fine.
But now my customer requested even more details for the cities returned by the page insights API.

For example:
Facebook returns a JSON like this

{
  "data": [
    {
      "name": "page_impressions_by_city_unique",
      "period": "day",
      "values": [
        {
          "value": {
            "Arcole, Italy": 1,
            "Brentino Belluno, Italy": 2,
            "Bolzano, Italy": 2,
            "Naples, Italy": 1,
            "Padua, Italy": 1,
            "Rome, Italy": 1,
            ...
          },
          "end_time": "2019-05-13T07:00:00+0000"
        }
      ],
      "title": "Daily Reach by City",
      "description": "Daily: Total Page Reach by user city. (Unique Users)",
      "id": "***"
    }
  ]
}

The real problem is that in Italy there are some cities with the same name but different postal code (CAP in italian). That translates into potentials wrong attributions. So finally back to my question...

Can I get more information from these APIs such as the postal code or the Region? I could not find anything

Thank you and sorry for my bad english

0 Answers