【问题标题】:api for zip +4 from an address来自地址的 zip +4 api
【发布时间】:2010-05-08 01:13:36
【问题描述】:

从地址获取 zip +4 的最佳 api/资源是什么?

我不想要需要不时下载和更新的东西;我想要一个自动更新的。

目标是查找州和联邦官员,而不会出现“重复”职位。

【问题讨论】:

    标签: geolocation zipcode


    【解决方案1】:

    你试过Google Maps JavaScript API V3

    更新:

    回应您的评论

    这很容易计数 1, 2, 3 ;)

    看看这个:

    您需要寻找谷歌地图地理编码服务! (视口偏差

    示例代码为:

    使用 jQuery

    $(function() {
        $.getJSON("http://maps.google.com/maps/api/geocode/json?address=Winnetka&sensor=false",
        function(data) {
            var zip_code = data.results[0].long_name;
            alert(zip_code);
        });
    });
    

    【讨论】:

    • 我很想使用谷歌服务,但我还没有花时间弄清楚如何为其提供地址并取回“已清理”的地址。
    • 我在 zip+4 之后。 Google 似乎不会公开这些数据(如果他们有),但感谢您提供的示例。
    • 只是出于好奇,您能给我一个您应该搜索的示例地址吗?
    • "1030 florida ave lynchburg" 应该返回 24504-4809 的 zip + 4,例如:local.yahooapis.com/MapsService/V1/…
    • 接缝好像是有原因的 groups.google.com/group/Google-Maps-API/browse_thread/thread/… 但当然取决于你需要什么!!
    【解决方案2】:

    Yahoo 在他们的 API 中有一个 zip + 4,每天限制 5000 个请求。

    Yahoo GeoCoding

    【讨论】:

    • 此 API 现已弃用。它被 Placefinder 取代。现在它正在被 BOSS Geo 服务所取代。他们说“我们继续为 Placefinder 和 Placemaker 提供速率受限的 YQL 表,用于非商业用途。将不再积极支持免费的 REST api。
    【解决方案3】:

    USPS 有一个用于查找/检查邮政编码(除其他外)的 API。

    http://www.usps.com/webtools/address.htm

    【讨论】:

    • 您只有在通过 USPS 运送时才能使用它。我至少两次被 API 密钥拒绝(诚实回答)。
    【解决方案4】:

    我在过去的工作中使用过 Endicia。它是一个基于网络 HTTP 的 API。 (我不记得是 SOAP 还是 REST。)

    【讨论】:

    • 我觉得这叫dial a zip。
    【解决方案5】:
    Apple provide brilliant facility to get zip+4code from lattitude and longitude with reverse geocoder -
    
        - (void)getPlaceMarkInfo
        {
            CLLocationCoordinate2D coordinate;
    
            coordinate.latitude             = your lattitude;
    
            coordinate.longitude            = your longitude;
    
            MKReverseGeocoder *RevGeoCoder  = [[MKReverseGeocoder alloc] initWithCoordinate:coordinate];
    
            RevGeoCoder.delegate            = self;
    
            [RevGeoCoder start];
        }
    
    #pragma mark MKReverseGeocoderDelegate:
    
    
    - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
    {
        NSLog(@"YOUR STATE IS - %@",[placemark.addressDictionary valueForKey:@"State"]);
    
        NSDictionary *dictAddress = placemark.addressDictionary;
    
        NSString *strZipPlus4Code = [NSString
                                     stringWithFormat:@"%@-%@",[dictAddress valueForKey:@"ZIP"],
                                                                         [dictAddress valueForKey:@"PostCodeExtension"]];
    
        strStateName = [placemark.addressDictionary valueForKey:@"State"];
    }
    
    
    - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
    {
        NSLog(@"REVERSE GEOCODER FAILED");
    
    }
    

    【讨论】:

      【解决方案6】:

      以前的答案包含一些非常好的信息,最重要的是:

      • 只有通过 USPS 运送才能使用 USPS API(来自他们的 terms of service:“用户同意使用 USPS 网站、API 和 USPS 数据来促进 USPS 运送交易。”)
      • 邮政编码的调整/更新相当频繁,因此拥有最新数据非常重要。 (更多关于多久重新验证您的地址的信息here

      你还说你想要一些不需要安装和保持更新的东西。

      考虑到这些条件,我建议LiveAddress API。它是一个基于云的自动更新 API,可在 40 多个其他数据点中返回您地址上的 ZIP+4 数据。它可以每秒处理数以千计的地址,因此超级快速且易于使用。如果您有一个想要工作的地址列表(而不是一次一个),您可能需要LiveAddress for Lists,它可以让您一次上传和处理整个列表。

      披露:我在提供 LiveAddress 的公司 SmartyStreets 工作。

      【讨论】:

        【解决方案7】:

        参考 Yahoo BOSS GEO Api:

        http://yboss.yahooapis.com/geo/placefinder?location=170+South+Market+St.,+San+Jose,+CA

        使用以下授权 HEADER 发出 GET 请求

        在 HTTP Header 中使用 OAuth 的示例:

        授权:OAuth的境界= “http://yboss.yahooapis.com/”,oauth_consumer_key = “dj0yJmk9QnFUYVRUSWtRZEhsJmQ9WVdrOVFrYzFja2x4TkdNbWNHbzlNVEExTWpFMk1ESTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD1lNA--”,oauth_nonce = “ZDQDDVLFCWKCZ0BD”,oauth_signature_method = “HMAC-SHA1”,oauth_timestamp =” 1367827192" ,oauth_version ="1.0",oauth_signature="phP2dNiCmvwpK4M6G%2F85KnnvTXo%3D"

        地点:

        BOSS Geo 查询的身份验证需要 HTTP 标头中的 OAuth 信息或通过 GET 请求中的参数。授权需要六个要素:

        oauth_version=1.0 – The standard of OAuth supported by BOSS Geo.
        
        oauth_timestamp= – The timestamp is expressed in the number of seconds since January 1, 1970 00:00:00 GMT. The timestamp value MUST be a positive integer and MUST be equal to or greater than the timestamp used in previous requests. The timestamp can be reused for up to 5 minutes. Important: After 5 minutes a fresh timestamp must be supplied.
        
        oauth_nonce – is a random string, uniquely generated for all requests for a specific timestamp. This helps verify that a request has never been made before and helps prevent replay attacks when requests are made over a non-secure channel (such as HTTP).
        
        oauth_consumer_key= – obtained from YDN during the BOSS project registration process. This is unique to the developer. Please follow the directions on the displayed key page and copy the entire key from YDN. If you do not copy the entire key, this results in a "Consumer Key rejected" error.
        
        oauth_signature_method=HMAC-SHA1 – (specific algorithm used for BOSS OAuth calls).
        
        oauth_signature – can be generated by an OAuth library. A list of supported OAuth libraries is available here: http://oauth.net/code. Over a dozen languages are supported.
        

        您将在“邮政编码”键下的 Response 中获得 zip+4 代码。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-05-02
          • 2012-05-07
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多