Google Maps API doesn't (always) return the correct UK county for a place. How/where can I reliably get this?

Viewed 286

For UK places, I note that:

country = United Kingdom
administrative_area_level_1 - England (or Scotland, Wales, or Northern Ireland)
administrative_area_level_2 - this MAY OR MAY NOT provide the correct county name.

Example:

Google Place ID: hIJrz5bz8xtbkgRBXTcwY3iUiw
Name: Bridgend Tennis, Squash and Bowls Club
Google Map: https://goo.gl/maps/U3AaesWwbxMksuDF6
administrative_area_level_1 = Wales
administrative_area_level_2 = Bridgend County Borough
post_code = CF31 3AZ

But the problem is that the county of this place is Glamorgan (or maybe Mid Glamorgan)

https://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom

I've been through lots of these examples, and sometimes administrative_area_level_2 does contain the correct County name, other times it doesn't. And there's nowhere else in the data returned from the API call that does mention the correct County name.

Therefore my question is: how do I reliably get the correct UK country name from Google Maps API... or elsewhere?

Thanks!

"result": {
    "address_components": [
      {
        "long_name": "Church Road",
        "short_name": "Church Rd",
        "types": [
          "route"
        ]
      },
      {
        "long_name": "Bridgend",
        "short_name": "Bridgend",
        "types": [
          "postal_town"
        ]
      },
      {
        "long_name": "Bridgend County Borough",
        "short_name": "Bridgend County Borough",
        "types": [
          "administrative_area_level_2",
          "political"
        ]
      },
      {
        "long_name": "Wales",
        "short_name": "Wales",
        "types": [
          "administrative_area_level_1",
          "political"
        ]
      },
      {
        "long_name": "United Kingdom",
        "short_name": "GB",
        "types": [
          "country",
          "political"
        ]
0 Answers
Related