YAddress Web API

Base 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
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
}

Test the API:

  

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.

Curl

$ curl "http://www.yaddress.net/api/address?AddressLine1=123+Main+St&AddressLine2=San+Diego,CA" $ curl -H "Accept:application/xml" "http://www.yaddress.net/api/address?
AddressLine1=123+Main+St&AddressLine2=San+Diego,CA"