从地址获取邮政编码+4的最佳api /资源是什么?
我不想不时下载和更新某些内容;我想要自动更新的一个。
目标是在不获得“重复”职位的情况下查找州和联邦官员。
Yahoo的API中有zip + 4,每天限制5000个请求。
您是否尝试过Google Maps JavaScript API V3
UPDATED:
回复您的评论
这很容易,因为数1、2、3;)
看看这个:
您需要寻找Google地图地理编码服务! (视口偏移)
示例代码为:
使用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);
});
});
USPS具有一个用于查找/检查邮政编码的API(以及其他功能)。>>
我在过去的工作中使用Endicia。它是基于网络HTTP的API。 (我不记得是SOAP还是REST。)
先前的答案包括了一些非常好的信息,最重要的是:
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");
}