How do the JSON and Object and description table of US street address API created by Smarty function?
In this article, I will clarify the object table and JSON output specifically of the Smarty US street address API. I will cover what information is included in the object table and how it is structured, as well as how the JSON output is formatted and what data it includes. This article is intended for readers who have programming knowledge and are already familiar with the concept of object tables and JSON output, but may be unfamiliar with the specifics of the Smarty API.
Table
Objects | Description |
input_id | A unique identifier for this address used in your application; this field will be copied into the output. |
street | The street line of the address, or the entire address ("freeform" input). |
street2 | Any extra address information |
secondary | Apartment, suite, or office number |
city | The city name |
state | The state name or abbreviation |
zipcode | The ZIP Code |
lastline | City, state, and ZIP Code combined |
addressee | The name of the person or company at this address |
urbanization | The neighborhood (only Puerto Rican addresses) |
candidates | The maximum number of addresses returned when the input is ambiguous |
match | The match output strategy to be employed for this lookup. Valid values are: strict, invalid, enhanced. Note: A freeform address that cannot be found will return an empty array, "[]". |
input_id: A unique identifier for this address used in your application; this field will be copied into the output.
street: The street line of the address, or the entire address ("freeform" input).
street2: Any extra address information, such as a unit number or building name.
secondary: The apartment, suite, or office number of the address.
city: The name of the city in which the address is located.
state: The name or abbreviation of the state in which the address is located.
zipcode: The ZIP Code of the address.
lastline: A combination of the city, state, and ZIP Code of the address.
addressee: The name of the person or company associated with the address.
urbanization: The neighborhood or urbanization (only applicable to Puerto Rican addresses).
candidates: The maximum number of addresses that will be returned when the input is ambiguous.
match: The match output strategy to be used for this lookup. Valid values are "strict", "invalid", and "enhanced". "Strict" means that the API will only return detailed output if a valid match is found; otherwise, the response will be an empty array. "Invalid" means that the API will return detailed output for both valid and invalid addresses, and the dpv_match_code can be used to determine whether the address is valid. "Enhanced" means that the API will return detailed output based on a more aggressive matching mechanism and a more comprehensive dataset, but requires a US Core license or a US Rooftop Geocoding license. Note: For freeform addresses that cannot be found, the API will return an empty array, "[]".
The information in the table is useful because it provides a clear and detailed description of each object that is included in the Smarty US street address API. This includes the name of the object, a brief overview of its purpose, and any additional notes or considerations that may be relevant. Having this information readily available can be especially helpful for developers who are working with the API, as it allows them to quickly understand what each object represents and how it can be used in their applications. Additionally, knowing the specific details of the objects and their properties can be useful for debugging or troubleshooting issues that may arise when using the API. Overall, the information in the table is an essential resource for anyone who wants to effectively utilize the Smarty US street address API in their projects.
JSON output explained
The JSON output is an array of two objects, each representing an address. Each object has several properties that provide various information about the address. The first object has properties such as "input_index", "candidate_index", "delivery_line_1", and "last_line", which give the index of the input address, the index of the candidate address, the first line of the delivery address, and the last line of the delivery address, respectively. It also has a "components" property which is an object containing various sub-properties that provide more detailed information about the address components, such as the primary number, street name, city name, and ZIP code. The object also has a "metadata" property, which is an object containing metadata about the address, such as the record type, ZIP type, county information, latitude and longitude coordinates, and time zone. Finally, the object has an "analysis" property, which is an object containing information about the analysis of the address, such as the DPV (Delivery Point Validation) match code and footnotes, and whether the address is active or vacant. The second object in the array has similar properties, but also includes an "addressee" property, which gives the name of the person or company at the address.
[
{
"input_index": 0,
"candidate_index": 0,
"delivery_line_1": "1 Santa Claus Ln",
"last_line": "North Pole AK 99705-9901",
"delivery_point_barcode": "997059901010",
"components": {
"primary_number": "1",
"street_name": "Santa Claus",
"street_suffix": "Ln",
"city_name": "North Pole",
"state_abbreviation": "AK",
"zipcode": "99705",
"plus4_code": "9901",
"delivery_point": "01",
"delivery_point_check_digit": "0"
},
"metadata": {
"record_type": "S",
"zip_type": "Standard",
"county_fips": "02090",
"county_name": "Fairbanks North Star",
"carrier_route": "C004",
"congressional_district": "AL",
"rdi": "Commercial",
"elot_sequence": "0001",
"elot_sort": "A",
"latitude": 64.75233,
"longitude": -147.35297,
"coordinate_license": 1,
"precision": "Rooftop",
"time_zone": "Alaska",
"utc_offset": -9,
"dst": true
},
"analysis": {
"dpv_match_code": "Y",
"dpv_footnotes": "AABB",
"dpv_cmra": "N",
"dpv_vacant": "N",
"dpv_no_stat": "Y",
"active": "Y",
"footnotes": "L#"
}
},
{
"input_index": 1,
"candidate_index": 0,
"addressee": "Apple Inc",
"delivery_line_1": "1 Infinite Loop",
// truncated for brevity
}
]
Finishing
In this conversation, we discussed the object table and JSON output of the Smarty US street address API. The object table provided a list of objects included in the API, along with descriptions of their purpose and any relevant notes. We also looked at an example of JSON output from the API, which is an array of objects representing addresses. Each object includes various properties that provide detailed information about the address, such as its components, metadata, and analysis. Overall, this information is useful for developers working with the Smarty US street address API, as it helps them understand the structure and content of the data they can access through the API.
Source
The Smarty US street address API is a service that allows developers to access and use comprehensive US street address data in their applications. If you are interested in using the Smarty API, you can request access through the third party data marketplace of Worldindata. Worldindata is a platform that connects developers with data providers, making it easy to find and purchase the data you need for your projects. To request access to the Smarty API through Worldindata, you will need to create an account on the platform and browse the available datasets. Once you have found the Smarty API, you can follow the steps provided by Worldindata to request access and purchase the data. Keep in mind that access to the Smarty API and the use of its data may be subject to certain terms and conditions, as well as fees or other charges.