-

YAddress Web API

API for postal address correction, validation, standardization and geocoding

URL http://www.yaddress.net/api/address or
https://www.yaddress.net/api/address
HTTP Method GET
HTTP Headers Accept: application/json for JSON formatted response (default)
Accept: application/xml for XML formatted response
Query String
Fields

AddressLine1, AddressLine2, UserKey

See Parameter Reference for details
Sample Request http://www.yaddress.net/api/address?
   AddressLine1=506+Fourth+Avenue+Unit+1&
   AddressLine2=Asbury+Prk+NJ&
   UserKey=XXXXX
Sample Response {
"ErrorCode": 0,
"ErrorMessage": "",
"AddressLine1": "506 4TH AVE APT 1",
"AddressLine2": "ASBURY PARK, NJ 07712-6086",
"Number": "506",
"PreDir": "",
"Street": "4TH",
"Suffix": "AVE",
"PostDir": "",
"Sec": "APT",
"SecNumber": "1",
"City": "ASBURY PARK",
"State": "NJ",
"Zip": "07712",
"Zip4": "6086",
"County": "MONMOUTH",
"StateFP": "34",
"CountyFP": "025",
"CensusTract": "8070.03",
"CensusBlock": "1015",
"Latitude": 40.223571,
"Longitude": -74.005973,
"GeoPrecision": 5,
"TimeZoneOffset": -5,
"DstObserved": true,
"PlaceFP": 1960
"CityMunicipality": Asbury Park
"SalesTaxRate": 6.6250
"SalesTaxJurisdiction": "State of NJ"
}

Input Parameters

AddressLine1 First address line
Contains street address ("123 Main St") and possible secondary designators ("Apt 5"). Can be omitted.
AddressLine2 Second address line
Contains city, state and ZIP parts. These components are optional, but at least one of them must be specified. Cannot be blank.
UserKey

API user key
Leave blank for testing. First 1,000 addresses can be processed with a blank user key. For production use, sign up for YAddress account.

Sign up for YAddress account...

Output Fields

ErrorCode Error code:
0No error
1System error. Operator's attention required. See Error Message for more details.
2Input address was supplied in an invalid format.
3Specified street was not found in the ZIP code provided or in any ZIP code of the city-state.
4City is not found in the state.
5Ambiguous street name. More than one street matches the search address with equal accuracy.
6YAddress installation is corrupted. Reinstall YAddress.
7YAddress data edition has expired. Contact www.yaddress.net to obtain current edition.
8No such house number in the street.
ErrorMessage Textual description of the error. Blank if no error occurred.
AddressLine1 First line of the parsed address. Includes secondary address designator if supplied in the original address. If the address failed to validate, this line is a copy of the input line.
AddressLine2 City-state-ZIP line of the parsed address. If the address failed to validate, this line is a copy of the input line.
Number House number of the parsed address. Blank if street address was not validated.
PreDir Street pre-direction of the parsed address. Blank if street address was not validated.
Street Street name of the parsed address, not including pre-direction, post-direction, and suffix. Blank if street address was not validated.
Suffix Street suffix of the parsed address. Blank if street address was not validated.
PostDir Street post-direction of the parsed address. Blank if street address was not validated.
Sec Secondary designator of the parsed address, such as apartment, suite, unit, etc. Blank if secondary designator was not validated.
SecNumber Secondary number of the parsed address, such as apartment, suite, unit, etc. Blank if secondary number was not validated.
City City of the parsed address. Blank if city was not validated.
State State of the parsed address. Blank if address was not validated.
Zip ZIP code of the parsed address. Blank if address was not validated.
Zip4 ZIP+4 code of the parsed address. Blank if address was not validated.
County County of the parsed address. Blank if county was not validated.
StateFP State FP number in two digits. Blank if state was not validated.
CountyFP County FP number in three digits. Blank if county was not validated. County FP’s are unique within a state.
CensusTract Census tract number in the format XXXX.XX. Blank if not determined. Census tract numbers are unique within a county.
CensusBlock Census block number in four digits. Blank if not determined. Census block numbers are unique within a census tract.
Latitude Latitude of the address location. 0 if address cannot be geocoded.
Longitude Longitude of the address location. 0 if address cannot be geocoded.
GeoPrecision Precision with which coordinates of the location were determined. Possible values are:
0Location could not be determined.
1Center point of the state.
2City center. Usually points to the downtown city district.
3Center point of the ZIP code.
4Nearest end of the nearest street block. For example, if input address is "105 Main St", and Main St only has addresses up to 100, the coordinates of "100 Main St" are returned.
5Location of the exact address.
TimeZoneOffset Time zone offset, i.e. the number of hours the time zone is ahead of or behind GMT.
Common US time zone offsets are:
-5Eastern time zone
-6Central time zone
-7Mountain time zone
-8Pacific time zone
-9Alaska time zone
-10Hawaii-Aleutian time zone
DstObserved Whether or not the Daylight Savings Time (DST) is observed at this location, i.e., clocks switch between standard time in winter and daylight savings time in summer. Boolean, true or false.
PlaceFP FIPS code of the Census Designated Place (CDP).
CityMunicipality Name of the city-level municipality the address is located within.
SalesTaxRate Local sales tax rate, percent.
SalesTaxJurisdiction Jurisdiction imposing sales tax:
1State
2County
3City
4Other, such as a local sales tax district

.NET Client

Download NuGet package Sources at GitHub

Install directly in Visual Studio:

PM> Install-Package YAddressWebApiClient

How to Use

YAddress.Client client = new YAddress.Client();
YAddress.Client.Address adr =
   client.ProcessAddress("506 Fourth Avenue Unit 1", "Asbury Prk, NJ", null);

SQL Server

See User Defined Function (UDF) for SQL Server.

Test the API