检索具有 REST/Javascript API 的国家/地区的州/省列表

Retrieve a list of States/Provinces for a Country with a REST/Javascript API

本文关键字:国家 地区 列表 API REST Javascript 检索      更新时间:2023-09-26

我正在寻找一个 API,它允许我检索我搜索的国家/地区的州/省列表。我重复国家名称或ISO,而不是Latlng/地理编码。

我遇到的最接近的事情是这样的:https://code.google.com/p/risevision/wiki/States_v2

但是,这仅适用于美国和加拿大。

我的第二选择

是我的第二选择,其中包含国家和州/省的数据库。

有人有其他想法吗?

融合表中的自然地球数据包含该数据。

https://www.google.com/fusiontables/DataSource?docid=19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA

您可以使用Geoname的Web服务,

它提供 Rest API,但您需要注册

更新:

尝试以下接口

http://api.geonames.org/countryInfo?country=US&username=demo

响应:

<geonames>
<country>
<countryCode>US</countryCode>
<countryName>United States</countryName>
<isoNumeric>840</isoNumeric>
<isoAlpha3>USA</isoAlpha3>
<fipsCode>US</fipsCode>
<continent>NA</continent>
<continentName>North America</continentName>
<capital>Washington</capital>
<areaInSqKm>9629091.0</areaInSqKm>
<population>310232863</population>
<currencyCode>USD</currencyCode>
<languages>en-US,es-US,haw,fr</languages>
<geonameId>6252001</geonameId>
<west>-124.733253</west>
<north>49.388611</north>
<east>-66.954811</east>
<south>24.544245</south>
</country>
</geonames>