Google maps API. Get continent where the country is located

后端 未结 5 1529
灰色年华
灰色年华 2021-02-09 23:51

There is a simple query to google API

https://maps.googleapis.com/maps/api/geocode/json?address=&components=country:Russia&language=ru&key=MY_API_KEY

5条回答
  •  暖寄归人
    2021-02-10 00:00

    You can use http://country.io/continent.json to map country ISO2 code to continent ISO2 code.

    And convert continent ISO2 code to its with this dataset https://github.com/datasets/continent-codes/blob/master/data/continent-codes.csv

    Example of country ISO2 code to continent ISO2 code {"BD": "AS", "BE": "EU", "BF": "AF"...}

提交回复
热议问题