Verify
client.addressVerification.verify(AddressVerificationVerifyParamsparams, RequestOptionsoptions?): AddressVerificationVerifyResponse { data, message, status }
POST/v1/addver/verifications
- Structured Address — Verify and standardize a structured address (e.g., with
line1,city, etc.). - Freeform Address — Verify and standardize a freeform address written on one line. For best results, append the ISO 2-letter country code (e.g.,
US,CA) to the end of the line.
- Specifying
includeDetails=truewill provide additional output as documented in theDetailsschema. - Uses 1 lookup for verification, and 1 more if geocoding (unless your contract says otherwise).
Verify
import PostGrid from 'postgrid-node';
const client = new PostGrid({
addressVerificationAPIKey: process.env['POSTGRID_ADDRESS_VERIFICATION_API_KEY'], // This is the default and can be omitted
});
const response = await client.addressVerification.verify({
address: '1234 Elm St, Los Angeles, CA 90001, US',
});
console.log(response.data);{
"status": "success",
"message": "Address verified successfully",
"data": {
"city": "Los Angeles",
"country": "US",
"line1": "1234 Elm St",
"postalOrZip": "90001",
"provinceOrState": "CA",
"status": "verified",
"errors": {}
}
}{
"status": "success",
"message": "Address verified successfully",
"data": {
"city": "Los Angeles",
"country": "US",
"line1": "1234 Elm St",
"postalOrZip": "90001",
"provinceOrState": "CA",
"status": "verified",
"errors": {}
}
}Returns Examples
{
"status": "success",
"message": "Address verified successfully",
"data": {
"city": "Los Angeles",
"country": "US",
"line1": "1234 Elm St",
"postalOrZip": "90001",
"provinceOrState": "CA",
"status": "verified",
"errors": {}
}
}{
"status": "success",
"message": "Address verified successfully",
"data": {
"city": "Los Angeles",
"country": "US",
"line1": "1234 Elm St",
"postalOrZip": "90001",
"provinceOrState": "CA",
"status": "verified",
"errors": {}
}
}