Skip to content
Get started

Batch Verification

intl_address_verification.batch_verification(IntlAddressVerificationBatchVerificationParams**kwargs) -> IntlAddressVerificationBatchVerificationResponse
POST/v1/intl_addver/verifications/batch

Verify a batch of international addresses in a single request. Each address can be freeform or structured, matching the same input formats accepted by the single verification endpoint.

  • Uses 1 lookup per address.
  • Requires a secret API key.
  • Returns results in the same order as the input addresses.
  • If an individual address fails, its result will contain an error field rather than a verifiedAddress.
ParametersExpand Collapse
addresses: Iterable[Address]

Array of addresses to verify. Each item can be a freeform string or a structured address object.

One of the following:
class AddressStructuredAddressInput:

Input model for structured international address verification.

address: AddressStructuredAddressInputAddress
country: str

The country code (ISO 3166-1 alpha-2 or alpha-3).

line1: str

The first line of the address (e.g., street address, building, etc.).

postal_or_zip: str

The postal or ZIP code.

province_or_state: str

The administrative area (e.g., state, province, region).

city: Optional[str]

The city, town, or locality of the address.

line2: Optional[str]

The second line of the address (e.g., apartment, suite, etc.).

line3: Optional[str]

The third line of the address (e.g., additional locality or delivery info).

line4: Optional[str]

The fourth line of the address (e.g., further address details).

class AddressFreeformAddressInput:

Input model for freeform international address verification.

address: str

The full address as a single string.

geo_data: Optional[bool]
include_details: Optional[bool]
proper_case: Optional[bool]
use_enhanced_china_dataset: Optional[bool]
ReturnsExpand Collapse
class IntlAddressVerificationBatchVerificationResponse:
data: Data
results: List[DataResult]
error: Optional[str]

An error message for this address. Present when verification failed.

verified_address: Optional[DataResultVerifiedAddress]

The result of a verified international address.

city: str

The city or locality.

country: str

The country code (ISO 3166-1 alpha-2).

line1: str

The first address line.

postal_or_zip: str

The postal or ZIP code.

province_or_state: str

The province or state.

country_name: Optional[str]

The full country name.

details: Optional[DataResultVerifiedAddressDetails]

Additional details about the verified address, such as premise, thoroughfare, and locality.

building: Optional[str]

The building name or number.

building_type: Optional[str]

The type of building (e.g., apartment, office).

city_name: Optional[str]

The full city name.

city_secondary: Optional[str]

Secondary city information.

city_type: Optional[str]

The type of city (e.g., city, town, village).

delivery_address: Optional[str]

The full delivery address.

dependent_locality: Optional[str]

The dependent locality (UK addresses).

double_dependent_locality: Optional[str]

The double dependent locality (UK addresses).

organization: Optional[str]

The organization or company name.

postal_or_zip_primary: Optional[str]

The primary part of the postal or ZIP code.

postal_or_zip_secondary: Optional[str]

The secondary part of the postal or ZIP code.

post_box: Optional[str]

The post box number.

premise: Optional[str]

The premise name or number.

premise_number: Optional[str]

The premise number.

premise_secondary: Optional[str]

Secondary premise information.

premise_type: Optional[str]

The type of premise (e.g., house, flat).

province_or_state_name: Optional[str]

The full name of the province or state.

province_or_state_type: Optional[str]

The type of province or state (e.g., province, state, region).

street: Optional[str]

The street name.

street_post_direction: Optional[str]

The directional suffix for the street (e.g., N, S, E, W).

street_pre_direction: Optional[str]

The directional prefix for the street (e.g., N, S, E, W).

street_type: Optional[str]

The type of street (e.g., St, Ave, Blvd).

sub_administrative_area: Optional[str]

The sub-administrative area.

sub_building: Optional[str]

The sub-building name or number (e.g., unit, suite).

sub_building_floor: Optional[str]

The floor of the sub-building.

sub_building_number: Optional[str]

The sub-building number.

sub_building_type: Optional[str]

The type of sub-building (e.g., floor, wing).

sub_street: Optional[str]

The sub-street name.

sub_street_post_direction: Optional[str]

The directional suffix for the sub-street.

sub_street_pre_direction: Optional[str]

The directional prefix for the sub-street.

sub_street_type: Optional[str]

The type of sub-street.

super_administrative_area: Optional[str]

The super-administrative area.

telephone: Optional[str]

The telephone number associated with the address.

errors: Optional[Errors]

Errors encountered during address verification.

city: Optional[List[str]]

Errors related to the city.

generic: Optional[List[str]]

Generic errors not tied to a specific field.

line1: Optional[List[str]]

Errors related to the first address line.

line2: Optional[List[str]]

Errors related to the second address line.

postal_or_zip: Optional[List[str]]

Errors related to the postal or ZIP code.

province_or_state: Optional[List[str]]

Errors related to the province or state.

firm_name: Optional[str]

The firm or company name, if available.

formatted_address: Optional[str]

The formatted address string.

geo_data: Optional[DataResultVerifiedAddressGeoData]

Geocoding result for the verified address.

geo_accuracy: Optional[str]

The geocode accuracy.

latitude: Optional[str]

The latitude of the address.

longitude: Optional[str]

The longitude of the address.

line2: Optional[str]

The second address line.

line3: Optional[str]

The third address line, if available.

status: Optional[Status]

The verification status of an address.

One of the following:
"verified"
"corrected"
"failed"
summary: Optional[DataResultVerifiedAddressSummary]

A summary of the verification process and match levels.

context_identification_match_level: Optional[str]

Context identification match level.

lexicon_identification_match_level: Optional[str]

Lexicon identification match level.

match_score: Optional[float]

The match score (0-100).

message: Optional[str]

Additional message about the verification.

parsing_status: Optional[str]

The parsing status of the address.

post_code_status: Optional[str]

The status of the postal code.

post_processed_verification_match_level: Optional[str]

The match level after post-processing.

pre_processed_verification_match_level: Optional[str]

The match level before post-processing.

verification_status: Optional[str]

The overall verification status.

zip_plus4: Optional[str]

The ZIP+4 code (for US addresses).

message: str
status: Literal["success", "error"]
One of the following:
"success"
"error"

Batch Verification

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.intl_address_verification.batch_verification(
    addresses=[{
        "address": {
            "country": "country",
            "line1": "line1",
            "postal_or_zip": "postalOrZip",
            "province_or_state": "provinceOrState",
        }
    }],
)
print(response.data)
{
  "data": {
    "results": [
      {
        "error": "error",
        "verifiedAddress": {
          "city": "city",
          "country": "country",
          "line1": "line1",
          "postalOrZip": "postalOrZip",
          "provinceOrState": "provinceOrState",
          "countryName": "countryName",
          "details": {
            "building": "building",
            "buildingType": "buildingType",
            "cityName": "cityName",
            "citySecondary": "citySecondary",
            "cityType": "cityType",
            "deliveryAddress": "deliveryAddress",
            "dependentLocality": "dependentLocality",
            "doubleDependentLocality": "doubleDependentLocality",
            "organization": "organization",
            "postalOrZipPrimary": "postalOrZipPrimary",
            "postalOrZipSecondary": "postalOrZipSecondary",
            "postBox": "postBox",
            "premise": "premise",
            "premiseNumber": "premiseNumber",
            "premiseSecondary": "premiseSecondary",
            "premiseType": "premiseType",
            "provinceOrStateName": "provinceOrStateName",
            "provinceOrStateType": "provinceOrStateType",
            "street": "street",
            "streetPostDirection": "streetPostDirection",
            "streetPreDirection": "streetPreDirection",
            "streetType": "streetType",
            "subAdministrativeArea": "subAdministrativeArea",
            "subBuilding": "subBuilding",
            "SubBuildingFloor": "SubBuildingFloor",
            "subBuildingNumber": "subBuildingNumber",
            "subBuildingType": "subBuildingType",
            "subStreet": "subStreet",
            "subStreetPostDirection": "subStreetPostDirection",
            "subStreetPreDirection": "subStreetPreDirection",
            "subStreetType": "subStreetType",
            "superAdministrativeArea": "superAdministrativeArea",
            "telephone": "telephone"
          },
          "errors": {
            "city": [
              "string"
            ],
            "generic": [
              "string"
            ],
            "line1": [
              "string"
            ],
            "line2": [
              "string"
            ],
            "postalOrZip": [
              "string"
            ],
            "provinceOrState": [
              "string"
            ]
          },
          "firmName": "firmName",
          "formattedAddress": "formattedAddress",
          "geoData": {
            "geoAccuracy": "geoAccuracy",
            "latitude": "latitude",
            "longitude": "longitude"
          },
          "line2": "line2",
          "line3": "line3",
          "status": "verified",
          "summary": {
            "contextIdentificationMatchLevel": "contextIdentificationMatchLevel",
            "lexiconIdentificationMatchLevel": "lexiconIdentificationMatchLevel",
            "matchScore": 0,
            "message": "message",
            "parsingStatus": "parsingStatus",
            "postCodeStatus": "postCodeStatus",
            "postProcessedVerificationMatchLevel": "postProcessedVerificationMatchLevel",
            "preProcessedVerificationMatchLevel": "preProcessedVerificationMatchLevel",
            "verificationStatus": "verificationStatus"
          },
          "zipPlus4": "zipPlus4"
        }
      }
    ]
  },
  "message": "message",
  "status": "success"
}
Returns Examples
{
  "data": {
    "results": [
      {
        "error": "error",
        "verifiedAddress": {
          "city": "city",
          "country": "country",
          "line1": "line1",
          "postalOrZip": "postalOrZip",
          "provinceOrState": "provinceOrState",
          "countryName": "countryName",
          "details": {
            "building": "building",
            "buildingType": "buildingType",
            "cityName": "cityName",
            "citySecondary": "citySecondary",
            "cityType": "cityType",
            "deliveryAddress": "deliveryAddress",
            "dependentLocality": "dependentLocality",
            "doubleDependentLocality": "doubleDependentLocality",
            "organization": "organization",
            "postalOrZipPrimary": "postalOrZipPrimary",
            "postalOrZipSecondary": "postalOrZipSecondary",
            "postBox": "postBox",
            "premise": "premise",
            "premiseNumber": "premiseNumber",
            "premiseSecondary": "premiseSecondary",
            "premiseType": "premiseType",
            "provinceOrStateName": "provinceOrStateName",
            "provinceOrStateType": "provinceOrStateType",
            "street": "street",
            "streetPostDirection": "streetPostDirection",
            "streetPreDirection": "streetPreDirection",
            "streetType": "streetType",
            "subAdministrativeArea": "subAdministrativeArea",
            "subBuilding": "subBuilding",
            "SubBuildingFloor": "SubBuildingFloor",
            "subBuildingNumber": "subBuildingNumber",
            "subBuildingType": "subBuildingType",
            "subStreet": "subStreet",
            "subStreetPostDirection": "subStreetPostDirection",
            "subStreetPreDirection": "subStreetPreDirection",
            "subStreetType": "subStreetType",
            "superAdministrativeArea": "superAdministrativeArea",
            "telephone": "telephone"
          },
          "errors": {
            "city": [
              "string"
            ],
            "generic": [
              "string"
            ],
            "line1": [
              "string"
            ],
            "line2": [
              "string"
            ],
            "postalOrZip": [
              "string"
            ],
            "provinceOrState": [
              "string"
            ]
          },
          "firmName": "firmName",
          "formattedAddress": "formattedAddress",
          "geoData": {
            "geoAccuracy": "geoAccuracy",
            "latitude": "latitude",
            "longitude": "longitude"
          },
          "line2": "line2",
          "line3": "line3",
          "status": "verified",
          "summary": {
            "contextIdentificationMatchLevel": "contextIdentificationMatchLevel",
            "lexiconIdentificationMatchLevel": "lexiconIdentificationMatchLevel",
            "matchScore": 0,
            "message": "message",
            "parsingStatus": "parsingStatus",
            "postCodeStatus": "postCodeStatus",
            "postProcessedVerificationMatchLevel": "postProcessedVerificationMatchLevel",
            "preProcessedVerificationMatchLevel": "preProcessedVerificationMatchLevel",
            "verificationStatus": "verificationStatus"
          },
          "zipPlus4": "zipPlus4"
        }
      }
    ]
  },
  "message": "message",
  "status": "success"
}