Api获取邮政编码的所有位置

时间:2018-03-20 11:01:50

标签: javascript php google-maps

我需要在哪里可以获得印度邮政编码的所有位置。

我已尝试使用以下链接

http://maps.googleapis.com/maps/api/geocode/json?address=110001

但在这里,我得到了城市和州名,我需要一个邮政编码,我们可以获取所有位置,如

{
        "Pincode": "110001",
        "Country": "INDIA",
        "City": "Central Delhi",
        "Address": "Baroda House"
    },
    {
        "Pincode": "110001",
        "Country": "INDIA",
        "City": "Central Delhi",
        "Address": "Bengali Market"
    },
    {
        "Pincode": "110001",
        "Country": "INDIA",
        "City": "Central Delhi",
        "Address": "Bhagat Singh Market"
    },
    {
        "Pincode": "110001",
        "Country": "INDIA",
        "City": "Central Delhi",
        "Address": "Connaught Place"
    },
    {
        "Pincode": "110001",
        "Country": "INDIA",
        "City": "Central Delhi",
        "Address": "Constitution House"
    },

我在谷歌搜索解决方案,但根据我的要求无法找到任何解决方案。任何人都可以指导我如何获得邮政编码的所有位置。

提前感谢您的帮助。

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

或者,您可以使用 https://thezipcodes.com/ 从帐户部分获取 API 密钥。点击获取请求。

https://thezipcodes.com/api/v1/search?zipCode=302010&countryCode={2digitCountryCode}&apiKey={apiKey}
{
  "success": true,
  "location": [
    {
      "country": "RU",
      "countryCode2": "RU",
      "countryCode3": "",
      "state": "Орловская Область",
      "stateCode2": "56",
      "latitude": "53.0747",
      "longitude": "36.2468",
      "zipCode": "302019",
      "city": "Орел 19"
    },
    {
      "country": "India",
      "countryCode2": "IN",
      "countryCode3": "IND",
      "state": "Rajasthan",
      "stateCode2": "24",
      "latitude": "26.7865",
      "longitude": "75.5809",
      "zipCode": "302019",
      "city": "Shyam Nagar (Jaipur)",
      "timeZone": "Indian Standard Time"
    }
  ]
}