Autocomplete
address_verification.autocomplete(AddressVerificationAutocompleteParams**kwargs) -> AddressVerificationAutocompleteResponse
POST/v1/addver/completions
Resolves a partial street address into a list of full address candidates, optionally selecting a specific candidate by index and verifying it.
Basic usage — omit index: returns an array of CompletedAddressItem
results for the given partialStreet.
With index — specify index to resolve a single candidate. Returns
a single CompletedAddressItem.
With index + verify=true — additionally runs the selected address
through the USPS/Canada Post verifier and returns a StandardVerifiedAddress.
- Uses 1 lookup per call (plus 1 more if geocoding a result).
Autocomplete
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.autocomplete(
partial_street="partialStreet",
)
print(response.data){
"data": {
"address": {
"address": "address",
"address2": "address2",
"city": "city",
"country": "country",
"pc": "pc",
"prov": "prov"
},
"errors": {
"city": [
"string"
],
"generic": [
"string"
],
"line1": [
"string"
],
"line2": [
"string"
],
"postalOrZip": [
"string"
],
"provinceOrState": [
"string"
]
},
"geocodeResult": {
"accuracy": 0,
"accuracyType": "rooftop",
"location": {
"lat": 0,
"lng": 0
}
}
},
"message": "message",
"status": "success"
}Returns Examples
{
"data": {
"address": {
"address": "address",
"address2": "address2",
"city": "city",
"country": "country",
"pc": "pc",
"prov": "prov"
},
"errors": {
"city": [
"string"
],
"generic": [
"string"
],
"line1": [
"string"
],
"line2": [
"string"
],
"postalOrZip": [
"string"
],
"provinceOrState": [
"string"
]
},
"geocodeResult": {
"accuracy": 0,
"accuracyType": "rooftop",
"location": {
"lat": 0,
"lng": 0
}
}
},
"message": "message",
"status": "success"
}