Verify
address_verification.verify(AddressVerificationVerifyParams**kwargs) -> AddressVerificationVerifyResponse
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 os
from postgrid import PostGrid
client = PostGrid(
address_verification_api_key=os.environ.get("POSTGRID_ADDRESS_VERIFICATION_API_KEY"), # This is the default and can be omitted
)
response = client.address_verification.verify(
address="1234 Elm St, Los Angeles, CA 90001, US",
)
print(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": {}
}
}