API Reference
The request and response format for the /validate-address endpoint, and every input and output field.
Endpoint
The server's API endpoint can be queried using curl, for example:
POST /validate-address
curl --request POST \
--url http://localhost:8080/validate-address \
--header 'Content-Type: application/json' \
--data '{
"Name_Firm": "",
"Primary_Address": "101 State St nw",
"Secondary_Address": "",
"Locality": "La Crosse",
"Region": "wi",
"Postcode": ""
}'A successful response to a /validate-address call will look like this:
Response
{
"carrier_route_sort_zone": "D",
"cart": "C019",
"check_digit": "5",
"city": "La Crosse",
"cmra_flag": "N",
"congress_district": "3",
"county_name": "La Crosse",
"delivery_type": "P",
"dpbc": "01",
"dpv_footnotes": "AABB",
"dpv_no_stat_flag": "N",
"dpv_status": "Y",
"dpv_vacant_flag": "N",
"fault_code": "",
"fips_code": "55063",
"full_address": "101 State St",
"lastline": "La Crosse WI 54601-3221",
"post_directional": "",
"pre_directional": "",
"primary_address": "101 State St",
"primary_name": "State",
"primary_number": "101",
"primary_secondary_address": "101 State St",
"rdi_indicator": "N",
"record_type": "S",
"secondary_address": "",
"secondary_description": "",
"secondary_number": "",
"state": "WI",
"status_code": "S94000",
"suffix": "St",
"undeliverable": "F",
"urbanization_name": "",
"zip4": "3221",
"zip5": "54601"
}Input Fields
Note: These input fields are what the AIQ Realtime Services endpoint accepts by default. Custom configurations provided to the service may change this interface.
| Field name | Description | Example |
|---|---|---|
Name_Firm | The company name. Optional. | Charmant Hotel |
Primary_Address | The delivery address line that includes information like the house number, street name, and unit information. | 101 State St |
Secondary_Address | Delivery address line that can include various types of address information. Optional. | |
Locality | The city, town, or suburb. | La Crosse |
Region | The name of the state or province for this address. | WI |
Postcode | The five-digit primary ZIP Code. This field does not include the 4-digit ZIP4 Code. Optional. |
Output Fields
Note: These output fields are what the AIQ Realtime Services endpoint returns by default. Custom configurations provided to the service may change this interface.
| Field name | Description |
|---|---|
carrier_route_sort_zone | Carrier-route sort zone; indicates eligibility for Standard Mail Automation Enhanced Carrier Route.
|
congress_district | Three-digit district number for the U.S. House of Representatives. |
dpbc | Contains the two-digit Delivery Point Bar Code (DPBC). |
fips_code | Contains the Federal Information Processing Standards (FIPS) code for state and county. Combines the 2-digit state code with the 3-digit county code. Note: U.S. territories, possessions, or protectorates such as Puerto Rico, the U.S. Virgin Islands, or the Pacific Islands don't have FIPS state digits. |
cart | The Carrier Route. |
full_address | The address line of the address. |
lastline | The last City, State, and ZIP code information of the address. |
undeliverable | Deliverability indicator.
|
urbanization_name | Contains the full urbanization name. Applicable to Puerto Rico territory. |
county_name | Contains the full county name. |
delivery_type | Contains the type of postal facility:
|
cmra_flag | Contains the DPV Commercial Mail Receiving Agency (CMRA) component that the transform generated for this record.
|
dpv_footnotes | Up to 12 characters. DPV footnotes are required for end-user CASS certification. The footnotes contain the following information:
|
dpv_no_stat_flag | Contains a value that indicates whether the address is a vacant property, receives mail as part of a drop, or doesn't have an established delivery yet. Output values include:
|
dpv_status | Contains a DPV status component that the transform generated for this record.
|
dpv_vacant_flag | Contains a vacant address indicator.
|
fault_code | Contains a code that indicates why the transform couldn't assign the address. Field is blank when the transform assigned the address. |
city | Contains the locality.
|
zip5 | Contains the 5-digit ZIP Code. Doesn't include the 4-digit ZIP+4. |
zip4 | Contains the four-digit ZIP+4 Code. Located after the primary postal code on a mail piece, either preceded with a hyphen or not. For example, for the full ZIP Code 54601-1234, the value is "1234". |
primary_address | Contains the primary address line, such as the street address or post office box. Doesn't include secondary address information such as apartment. If you enable the USE_USPS_PRIMARY_NAME_ABBREVIATION option, the transform uses the USPS Primary Name abbreviation first. |
primary_name | Contains the primary street name description. Note: If output doesn't fit within the length of the output field, the transform truncates the data using intelligent truncation. |
primary_number | Contains the house or building number. |
post_directional | Contains the abbreviated directional that follows the street name. For example, N, S, NW, or SE. |
pre_directional | Contains the abbreviated directional that precedes a street name. For example, N, S, NW, or SE. |
primary_secondary_address | Contains the primary address and secondary address on one line. Doesn't include remainder data. The software outputs this line as if the INCLUDE_UNUSED_ADDRESS_LINE_DATA option is set to NO. When set to NO, the output doesn't include invalid secondary address line information. |
suffix | Contains the abbreviated street type, such as St, Ave, or Pl. |
rdi_indicator | Indicates whether the address is residential.
|
state | Contains the state, province, territory, or region. |
secondary_address | Contains the building name, floor, and room number in one field. |
status_code | Contains a code that indicates how the input address differs from the assigned address. Blank when the address is unassigned. |
secondary_description | Contains the unit description, such as #, Apartment, or Flat. |
secondary_number | Contains the unit number, such as 100 in the unit APT 100. |
Geocode Output Fields
Geocoding data appended to each response
When geocoding is enabled, the following fields are available in the response. They can be exposed and customized through the Geocoding_Options section of aiq_config.yml.
| Field name | Description |
|---|---|
address_latitude | Contains the latitude at the best assigned level, which is 0-90 degrees north or south of the equator. The transform standardizes the latitude to six decimals in the format 45.801357. |
address_longitude | Contains the longitude at the best assigned level, which is 0-180 degrees east or west of the Greenwich meridian. The transform standardizes the longitude to six decimals in the format 123.458331. |
address_match_level | Contains the level to which the transform matches the address to the data in the reference files (directories).
|
census_tract_block | Contains the census tract code as defined by the government for reporting census information. Census tracts are small, relatively permanent statistical subdivisions of a county. |
centroid_latitude | Contains the latitude at the postcode-level centroid of the postcode. The transform standardizes the latitude to six decimals in the format 45.801357. |
centroid_longitude | Contains the longitude at the postcode-level centroid of the postcode. The transform standardizes the longitude to six decimals in the format 123.45833. |
centroid_match_level | Match code indicating the precision of the centroid latitude and longitude assignment. The lower the number, the more precise the assignment.
|
gov_county_code | Contains a unique county code as defined by the government for reporting census information. |
gov_locality1_code | Contains a unique code for an incorporated municipality such as a city, town, or locality, as defined by the government for reporting census information. |
gov_region1_code | Contains a unique region code as defined by the government for reporting census information. For example, in the USA, the code is a Federal Information Processing Standard (FIPS) two-digit state code. |
info_code | Contains a three-character code that provides information about the geocoding results:
|
stat_area_code | Contains a core-based statistical area code where an area has a high degree of social and economic integration within the core that the area surrounds. The government defines the area for reporting census information. |
metro_stat_area_code | Contains the metropolitan statistical area. A metropolitan statistical area has a large population with a high degree of social and economic integration with the core of the area. The government defines the area for reporting census information. |
minor_div_code | Contains the minor civil division, or census county division code when the minor civil division is not available. The minor civil division designates the primary government and/or administrative divisions of a county, such as a civil township or precinct. |