アドレスからzip+4を取得するのに最適なAPI/リソースは何ですか?
時々ダウンロードして更新する必要があるものは必要ありません。自動的に更新されるものが欲しいです。
目標は、「重複した」立場を取得することなく、州および連邦政府の役人を調べることです。
アドレスからzip+4を取得するのに最適なAPI/リソースは何ですか?
時々ダウンロードして更新する必要があるものは必要ありません。自動的に更新されるものが欲しいです。
目標は、「重複した」立場を取得することなく、州および連邦政府の役人を調べることです。
Google Maps JavaScriptAPIV3を試しましたか
更新しました:
あなたのコメントに応えて
これは、カウント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);
});
});
YahooのAPIにはzip+4があり、1日あたりのリクエスト数は5000に制限されています。
USPSには、(とりわけ)郵便番号を検索/チェックするためのAPIがあります。
私は過去の仕事でエンディシアを使用しました。これはネットワーク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");
}
以前の回答には、いくつかの非常に優れた情報が含まれています。最も重要なのは、次のとおりです。
また、インストールして更新する必要のないものが必要だとのことです。
これらの資格を念頭に置いて、LiveAddressAPIをお勧めします。これはクラウドベースの自動的に更新されるAPIであり、40を超える他のデータポイントの中で、住所のZIP+4データを返します。1秒あたり数千のアドレスを処理できるため、超高速で使いやすいです。ただし、(一度に1つずつではなく)作業したいアドレスのリストがある場合は、リスト全体を一度にアップロードして処理できるLiveAddressforListsが必要になる場合があります。
開示:私はLiveAddressを提供する会社であるSmartyStreetsで働いています。
Yahoo BOSS GEO Apiを参照して:
http://yboss.yahooapis.com/geo/placefinder?location=170+South+Market+St.,+San+Jose,+CA
次の認証ヘッダーを使用してGETリクエストを作成します
HTTPヘッダーで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ヘッダーまたはGETリクエストのパラメーターを介したOAuth情報が必要です。承認に必要な要素は6つあります。
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.
「郵便番号」キーの下の応答でzip+4コードを取得します。