# Address Verification

## Verify

`address_verification.verify(AddressVerificationVerifyParams**kwargs)  -> AddressVerificationVerifyResponse`

**post** `/v1/addver/verifications`

1. **Structured Address** — Verify and standardize a structured address (e.g., with `line1`, `city`, etc.).
1. **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=true` will provide additional output as documented in the `Details` schema.
- Uses 1 lookup for verification, and 1 more if geocoding (unless your contract says otherwise).

### Parameters

- `address: str`

  The address you want to verify, written on a single line.

- `geocode: Optional[bool]`

- `include_details: Optional[bool]`

- `proper_case: Optional[bool]`

### Returns

- `class AddressVerificationVerifyResponse: …`

  - `data: Data`

    - `city: str`

      The city name of the address.

    - `country: str`

      The country code of the address.

    - `line1: str`

      The first line of the address.

    - `postal_or_zip: str`

      The postal code or ZIP code of the address.

    - `province_or_state: str`

      The province or state of the address.

    - `country_name: Optional[str]`

      The country name of the address.

    - `details: Optional[DataDetails]`

      If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

      - `box_id: Optional[str]`

        PO Box ID

      - `county: Optional[str]`

        County in the United States (US address only)

      - `county_num: Optional[str]`

        FIPS code for county (US address only)

      - `delivery_installation_area_name: Optional[str]`

        Delivery installation area name

      - `delivery_installation_qualifier: Optional[str]`

        Delivery installation qualifier

      - `delivery_installation_type: Optional[str]`

        Delivery installation type

      - `extra_info: Optional[str]`

        Any extra information relevant to the address

      - `post_direction: Optional[str]`

        The post-direction of the street (after the street name, US addresses only)

      - `pre_direction: Optional[str]`

        The pre-direction of the street (before the street name, US addresses only)

      - `residential: Optional[bool]`

        Indicates that the address is residential (US address only)

      - `rural_route_number: Optional[str]`

        Rural route number

      - `rural_route_type: Optional[str]`

        Rural route type

      - `street_direction: Optional[str]`

        The direction of the street (N, S, E, W, etc)

      - `street_name: Optional[str]`

        Name of the street where the address is located

      - `street_number: Optional[str]`

        Street number (e.g. the 20 in 20 Bay St)

      - `street_type: Optional[str]`

        Type of the street (DR, ST, BLVD, etc)

      - `suite_id: Optional[str]`

        The unit number/name

      - `suite_key: Optional[str]`

        The suite key

      - `us_census_block_number: Optional[str]`

        US Census block number

      - `us_census_cmsa: Optional[str]`

        US Census consolidated metropolitan statistical area

      - `us_census_fips: Optional[str]`

        US Census FIPS code (US address only)

      - `us_census_ma: Optional[str]`

        US Census metropolitan area

      - `us_census_msa: Optional[str]`

        US Census metropolitan statistical area

      - `us_census_pmsa: Optional[str]`

        US Census primary metropolitan statistical area

      - `us_census_tract_number: Optional[str]`

        US Census tract number

      - `us_congressional_district_number: Optional[str]`

        US congressional district number

      - `us_has_daylight_savings: Optional[bool]`

        True if address location recognizes DST

      - `us_mailing_check_digit: Optional[str]`

        PostNet barcode digit

      - `us_mailings_carrier_route: Optional[str]`

        4-character code assigned to mail delivery route within a 5 digit zip code

      - `us_mailings_default_flag: Optional[bool]`

        True if US address matches a high-rise default or rural route default in the USPS data

      - `us_mailings_delivery_point: Optional[str]`

        Unique USPS identifier for the delivery point

      - `us_mailings_dpv_confirmation_indicator: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_crma_indicator: Optional[str]`

        Y if this is a commercial mail receiving agency, N otherwise

      - `us_mailings_dpv_footnote1: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote2: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote3: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_elot_asc_desc: Optional[str]`

        A for ascending, D for descending

      - `us_mailings_elot_sequence_number: Optional[str]`

        eLOT sequence number

      - `us_mailings_ews_flag: Optional[str]`

        Y if address is in early warning system database

      - `us_mailings_lacs_flag: Optional[str]`

        Y if address converted by LACS

      - `us_mailings_lacs_return_code: Optional[str]`

        Corresponds to USPS LACSLink return code

      - `us_mailings_record_type_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_suite_link_return_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_postnet_barcode: Optional[str]`

        PostNet barcode for the address (US address only)

      - `us_state_legislative_lower: Optional[str]`

        Lower legislative district for the US address

      - `us_state_legislative_upper: Optional[str]`

        Upper legislative district for the US address

      - `us_time_zone: Optional[str]`

        Time zone for the US address area

      - `vacant: Optional[bool]`

        Indicates that the address is vacant according to the USPS (US address only)

    - `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 name of the address.

    - `geocode_result: Optional[DataGeocodeResult]`

      If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
      which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
      this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
      verification, suggestions, and POST /completions endpoint. Note that you must supply country when
      geocoding to get the result successfully.

      - `accuracy: float`

        A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

      - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

        A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

        - `"rooftop"`

        - `"point"`

        - `"range_interpolation"`

        - `"nearest_rooftop_match"`

        - `"intersection"`

        - `"street_center"`

        - `"place"`

        - `"state"`

      - `location: DataGeocodeResultLocation`

        Object that contains `lat`, `lng` properties with number values

        - `lat: float`

        - `lng: float`

    - `line2: Optional[str]`

      The second line of the address.

    - `province_or_state_name: Optional[str]`

      The full name of the province or state.

    - `status: Optional[Status]`

      The verification status of an address.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `zip_plus4: Optional[str]`

      The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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)
```

#### Response

```json
{
  "status": "success",
  "message": "Address verified successfully",
  "data": {
    "city": "Los Angeles",
    "country": "US",
    "line1": "1234 Elm St",
    "postalOrZip": "90001",
    "provinceOrState": "CA",
    "status": "verified",
    "errors": {}
  }
}
```

## Get Lookup Info

`address_verification.get_lookup_info()  -> AddressVerificationGetLookupInfoResponse`

**get** `/v1/addver/`

Returns your organization's current lookup usage and plan information.
Useful for checking how many lookups you have consumed and whether you
are on a paid plan.

### Returns

- `class AddressVerificationGetLookupInfoResponse: …`

  - `data: Data`

    - `free_limit: Optional[int]`

      The maximum number of lookups allowed in the current billing period.
      `null` indicates an unlimited plan.

    - `used: int`

      The number of lookups consumed in the current billing period.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.get_lookup_info()
print(response.data)
```

#### Response

```json
{
  "data": {
    "freeLimit": 0,
    "used": 0
  },
  "message": "message",
  "status": "success"
}
```

## Get Autocomplete Previews

`address_verification.get_autocomplete_previews(AddressVerificationGetAutocompletePreviewsParams**kwargs)  -> AddressVerificationGetAutocompletePreviewsResponse`

**get** `/v1/addver/completions`

Returns address completion previews for a partial street address, suitable
for populating an autocomplete dropdown without consuming a lookup per keystroke.

Each result contains a partial address preview (street, city, and — for non-US
addresses — only the first 3 digits of the postal code, to avoid revealing the
full code before a lookup is charged).

- Does not consume a lookup.
- Use `POST /completions` to resolve a full address once the user selects a result.

### Parameters

- `partial_street: str`

- `city_filter: Optional[str]`

- `country_filter: Optional[str]`

- `filter_exact: Optional[bool]`

- `limit: Optional[int]`

- `pc_filter: Optional[str]`

- `proper_case: Optional[bool]`

- `prov_instead_of_pc: Optional[bool]`

- `state_filter: Optional[str]`

- `verified_only: Optional[bool]`

### Returns

- `class AddressVerificationGetAutocompletePreviewsResponse: …`

  - `data: List[Data]`

    - `preview: DataPreview`

      A partial view of the address, suitable for display in an autocomplete dropdown.

      - `address: str`

        The street address line.

      - `city: Optional[str]`

        The city.

      - `pc: Optional[str]`

        For US addresses, the full postal code. For non-US addresses,
        only the first 3 digits are returned to avoid consuming a lookup.

      - `prov: Optional[str]`

        The province or state abbreviation. Returned instead of `pc` when `provInsteadOfPC=true`.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.get_autocomplete_previews(
    partial_street="partialStreet",
)
print(response.data)
```

#### Response

```json
{
  "data": [
    {
      "preview": {
        "address": "address",
        "city": "city",
        "pc": "pc",
        "prov": "prov"
      }
    }
  ],
  "message": "message",
  "status": "success"
}
```

## 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).

### Parameters

- `partial_street: str`

  The partial street address to complete (e.g. `"22 Bay"`).

- `filter_exact: Optional[bool]`

- `geocode: Optional[bool]`

- `include_details: Optional[bool]`

- `index: Optional[int]`

- `limit: Optional[int]`

- `proper_case: Optional[bool]`

- `verified_only: Optional[bool]`

- `verify: Optional[bool]`

- `city_filter: Optional[str]`

  Filter results to a specific city.

- `country_filter: Optional[str]`

  Filter results to a specific country code.

- `pc_filter: Optional[str]`

  Filter results to a specific postal code prefix.

- `state_filter: Optional[str]`

  Filter results to a specific state or province abbreviation.

- `verified_only: Optional[bool]`

### Returns

- `class AddressVerificationAutocompleteResponse: …`

  - `data: Data`

    - `class DataCompletedAddressItem: …`

      - `address: DataCompletedAddressItemAddress`

        The resolved address components.

        - `address: str`

          The first line of the address.

        - `address2: Optional[str]`

          The second line of the address.

        - `city: Optional[str]`

          The city.

        - `country: Optional[str]`

          The ISO 2-letter country code.

        - `pc: Optional[str]`

          The postal code.

        - `prov: Optional[str]`

          The province or state abbreviation.

      - `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.

      - `geocode_result: Optional[DataCompletedAddressItemGeocodeResult]`

        Geocoding result. Only present when `geocode=true` is supplied and an `index` is specified.

        - `accuracy: float`

          A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

        - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

          A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

          - `"rooftop"`

          - `"point"`

          - `"range_interpolation"`

          - `"nearest_rooftop_match"`

          - `"intersection"`

          - `"street_center"`

          - `"place"`

          - `"state"`

        - `location: DataCompletedAddressItemGeocodeResultLocation`

          Object that contains `lat`, `lng` properties with number values

          - `lat: float`

          - `lng: float`

    - `List[DataUnionMember1]`

      - `address: DataUnionMember1Address`

        The resolved address components.

        - `address: str`

          The first line of the address.

        - `address2: Optional[str]`

          The second line of the address.

        - `city: Optional[str]`

          The city.

        - `country: Optional[str]`

          The ISO 2-letter country code.

        - `pc: Optional[str]`

          The postal code.

        - `prov: Optional[str]`

          The province or state abbreviation.

      - `errors: Optional[Errors]`

        Errors encountered during address verification.

      - `geocode_result: Optional[DataUnionMember1GeocodeResult]`

        Geocoding result. Only present when `geocode=true` is supplied and an `index` is specified.

        - `accuracy: float`

          A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

        - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

          A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

          - `"rooftop"`

          - `"point"`

          - `"range_interpolation"`

          - `"nearest_rooftop_match"`

          - `"intersection"`

          - `"street_center"`

          - `"place"`

          - `"state"`

        - `location: DataUnionMember1GeocodeResultLocation`

          Object that contains `lat`, `lng` properties with number values

          - `lat: float`

          - `lng: float`

    - `class DataStandardVerifiedAddress: …`

      - `city: str`

        The city name of the address.

      - `country: str`

        The country code of the address.

      - `line1: str`

        The first line of the address.

      - `postal_or_zip: str`

        The postal code or ZIP code of the address.

      - `province_or_state: str`

        The province or state of the address.

      - `country_name: Optional[str]`

        The country name of the address.

      - `details: Optional[DataStandardVerifiedAddressDetails]`

        If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

        - `box_id: Optional[str]`

          PO Box ID

        - `county: Optional[str]`

          County in the United States (US address only)

        - `county_num: Optional[str]`

          FIPS code for county (US address only)

        - `delivery_installation_area_name: Optional[str]`

          Delivery installation area name

        - `delivery_installation_qualifier: Optional[str]`

          Delivery installation qualifier

        - `delivery_installation_type: Optional[str]`

          Delivery installation type

        - `extra_info: Optional[str]`

          Any extra information relevant to the address

        - `post_direction: Optional[str]`

          The post-direction of the street (after the street name, US addresses only)

        - `pre_direction: Optional[str]`

          The pre-direction of the street (before the street name, US addresses only)

        - `residential: Optional[bool]`

          Indicates that the address is residential (US address only)

        - `rural_route_number: Optional[str]`

          Rural route number

        - `rural_route_type: Optional[str]`

          Rural route type

        - `street_direction: Optional[str]`

          The direction of the street (N, S, E, W, etc)

        - `street_name: Optional[str]`

          Name of the street where the address is located

        - `street_number: Optional[str]`

          Street number (e.g. the 20 in 20 Bay St)

        - `street_type: Optional[str]`

          Type of the street (DR, ST, BLVD, etc)

        - `suite_id: Optional[str]`

          The unit number/name

        - `suite_key: Optional[str]`

          The suite key

        - `us_census_block_number: Optional[str]`

          US Census block number

        - `us_census_cmsa: Optional[str]`

          US Census consolidated metropolitan statistical area

        - `us_census_fips: Optional[str]`

          US Census FIPS code (US address only)

        - `us_census_ma: Optional[str]`

          US Census metropolitan area

        - `us_census_msa: Optional[str]`

          US Census metropolitan statistical area

        - `us_census_pmsa: Optional[str]`

          US Census primary metropolitan statistical area

        - `us_census_tract_number: Optional[str]`

          US Census tract number

        - `us_congressional_district_number: Optional[str]`

          US congressional district number

        - `us_has_daylight_savings: Optional[bool]`

          True if address location recognizes DST

        - `us_mailing_check_digit: Optional[str]`

          PostNet barcode digit

        - `us_mailings_carrier_route: Optional[str]`

          4-character code assigned to mail delivery route within a 5 digit zip code

        - `us_mailings_default_flag: Optional[bool]`

          True if US address matches a high-rise default or rural route default in the USPS data

        - `us_mailings_delivery_point: Optional[str]`

          Unique USPS identifier for the delivery point

        - `us_mailings_dpv_confirmation_indicator: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_dpv_crma_indicator: Optional[str]`

          Y if this is a commercial mail receiving agency, N otherwise

        - `us_mailings_dpv_footnote1: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_dpv_footnote2: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_dpv_footnote3: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_elot_asc_desc: Optional[str]`

          A for ascending, D for descending

        - `us_mailings_elot_sequence_number: Optional[str]`

          eLOT sequence number

        - `us_mailings_ews_flag: Optional[str]`

          Y if address is in early warning system database

        - `us_mailings_lacs_flag: Optional[str]`

          Y if address converted by LACS

        - `us_mailings_lacs_return_code: Optional[str]`

          Corresponds to USPS LACSLink return code

        - `us_mailings_record_type_code: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_suite_link_return_code: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_postnet_barcode: Optional[str]`

          PostNet barcode for the address (US address only)

        - `us_state_legislative_lower: Optional[str]`

          Lower legislative district for the US address

        - `us_state_legislative_upper: Optional[str]`

          Upper legislative district for the US address

        - `us_time_zone: Optional[str]`

          Time zone for the US address area

        - `vacant: Optional[bool]`

          Indicates that the address is vacant according to the USPS (US address only)

      - `errors: Optional[Errors]`

        Errors encountered during address verification.

      - `firm_name: Optional[str]`

        The firm name of the address.

      - `geocode_result: Optional[DataStandardVerifiedAddressGeocodeResult]`

        If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
        which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
        this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
        verification, suggestions, and POST /completions endpoint. Note that you must supply country when
        geocoding to get the result successfully.

        - `accuracy: float`

          A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

        - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

          A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

          - `"rooftop"`

          - `"point"`

          - `"range_interpolation"`

          - `"nearest_rooftop_match"`

          - `"intersection"`

          - `"street_center"`

          - `"place"`

          - `"state"`

        - `location: DataStandardVerifiedAddressGeocodeResultLocation`

          Object that contains `lat`, `lng` properties with number values

          - `lat: float`

          - `lng: float`

      - `line2: Optional[str]`

        The second line of the address.

      - `province_or_state_name: Optional[str]`

        The full name of the province or state.

      - `status: Optional[Status]`

        The verification status of an address.

        - `"verified"`

        - `"corrected"`

        - `"failed"`

      - `zip_plus4: Optional[str]`

        The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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)
```

#### Response

```json
{
  "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"
}
```

## Batch Verification

`address_verification.batch_verification(AddressVerificationBatchVerificationParams**kwargs)  -> AddressVerificationBatchVerificationResponse`

**post** `/v1/addver/verifications/batch`

Verify a batch of US or Canadian 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 (plus 1 more per address if geocoding).
- 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`.

### Parameters

- `addresses: Iterable[Address]`

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

  - `class AddressStandardFreeformAddressInput: …`

    - `address: str`

      The address you want to verify, written on a single line.

  - `class AddressStandardStructuredAddressInput: …`

    - `address: AddressStandardStructuredAddressInputAddress`

      - `city: str`

        The city of the address.

      - `country: Literal["ca", "us"]`

        The country of your address, one of `ca` or `us`.

        - `"ca"`

        - `"us"`

      - `line1: str`

        The first line of the address.

      - `postal_or_zip: str`

        The postal code or ZIP code of the address.

      - `province_or_state: str`

        The province or state of the address.

      - `line2: Optional[str]`

        The second line of the address.

      - `recipient: Optional[str]`

        The optional firm/recipient name.

- `geocode: Optional[bool]`

- `include_details: Optional[bool]`

- `proper_case: Optional[bool]`

### Returns

- `class AddressVerificationBatchVerificationResponse: …`

  - `data: Data`

    - `results: List[DataResult]`

      - `error: Optional[str]`

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

      - `verified_address: Optional[DataResultVerifiedAddress]`

        The verified address result. Present when verification succeeded.

        - `city: str`

          The city name of the address.

        - `country: str`

          The country code of the address.

        - `line1: str`

          The first line of the address.

        - `postal_or_zip: str`

          The postal code or ZIP code of the address.

        - `province_or_state: str`

          The province or state of the address.

        - `country_name: Optional[str]`

          The country name of the address.

        - `details: Optional[DataResultVerifiedAddressDetails]`

          If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

          - `box_id: Optional[str]`

            PO Box ID

          - `county: Optional[str]`

            County in the United States (US address only)

          - `county_num: Optional[str]`

            FIPS code for county (US address only)

          - `delivery_installation_area_name: Optional[str]`

            Delivery installation area name

          - `delivery_installation_qualifier: Optional[str]`

            Delivery installation qualifier

          - `delivery_installation_type: Optional[str]`

            Delivery installation type

          - `extra_info: Optional[str]`

            Any extra information relevant to the address

          - `post_direction: Optional[str]`

            The post-direction of the street (after the street name, US addresses only)

          - `pre_direction: Optional[str]`

            The pre-direction of the street (before the street name, US addresses only)

          - `residential: Optional[bool]`

            Indicates that the address is residential (US address only)

          - `rural_route_number: Optional[str]`

            Rural route number

          - `rural_route_type: Optional[str]`

            Rural route type

          - `street_direction: Optional[str]`

            The direction of the street (N, S, E, W, etc)

          - `street_name: Optional[str]`

            Name of the street where the address is located

          - `street_number: Optional[str]`

            Street number (e.g. the 20 in 20 Bay St)

          - `street_type: Optional[str]`

            Type of the street (DR, ST, BLVD, etc)

          - `suite_id: Optional[str]`

            The unit number/name

          - `suite_key: Optional[str]`

            The suite key

          - `us_census_block_number: Optional[str]`

            US Census block number

          - `us_census_cmsa: Optional[str]`

            US Census consolidated metropolitan statistical area

          - `us_census_fips: Optional[str]`

            US Census FIPS code (US address only)

          - `us_census_ma: Optional[str]`

            US Census metropolitan area

          - `us_census_msa: Optional[str]`

            US Census metropolitan statistical area

          - `us_census_pmsa: Optional[str]`

            US Census primary metropolitan statistical area

          - `us_census_tract_number: Optional[str]`

            US Census tract number

          - `us_congressional_district_number: Optional[str]`

            US congressional district number

          - `us_has_daylight_savings: Optional[bool]`

            True if address location recognizes DST

          - `us_mailing_check_digit: Optional[str]`

            PostNet barcode digit

          - `us_mailings_carrier_route: Optional[str]`

            4-character code assigned to mail delivery route within a 5 digit zip code

          - `us_mailings_default_flag: Optional[bool]`

            True if US address matches a high-rise default or rural route default in the USPS data

          - `us_mailings_delivery_point: Optional[str]`

            Unique USPS identifier for the delivery point

          - `us_mailings_dpv_confirmation_indicator: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_dpv_crma_indicator: Optional[str]`

            Y if this is a commercial mail receiving agency, N otherwise

          - `us_mailings_dpv_footnote1: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_dpv_footnote2: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_dpv_footnote3: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_elot_asc_desc: Optional[str]`

            A for ascending, D for descending

          - `us_mailings_elot_sequence_number: Optional[str]`

            eLOT sequence number

          - `us_mailings_ews_flag: Optional[str]`

            Y if address is in early warning system database

          - `us_mailings_lacs_flag: Optional[str]`

            Y if address converted by LACS

          - `us_mailings_lacs_return_code: Optional[str]`

            Corresponds to USPS LACSLink return code

          - `us_mailings_record_type_code: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_suite_link_return_code: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_postnet_barcode: Optional[str]`

            PostNet barcode for the address (US address only)

          - `us_state_legislative_lower: Optional[str]`

            Lower legislative district for the US address

          - `us_state_legislative_upper: Optional[str]`

            Upper legislative district for the US address

          - `us_time_zone: Optional[str]`

            Time zone for the US address area

          - `vacant: Optional[bool]`

            Indicates that the address is vacant according to the USPS (US address only)

        - `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 name of the address.

        - `geocode_result: Optional[DataResultVerifiedAddressGeocodeResult]`

          If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
          which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
          this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
          verification, suggestions, and POST /completions endpoint. Note that you must supply country when
          geocoding to get the result successfully.

          - `accuracy: float`

            A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

          - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

            A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

            - `"rooftop"`

            - `"point"`

            - `"range_interpolation"`

            - `"nearest_rooftop_match"`

            - `"intersection"`

            - `"street_center"`

            - `"place"`

            - `"state"`

          - `location: DataResultVerifiedAddressGeocodeResultLocation`

            Object that contains `lat`, `lng` properties with number values

            - `lat: float`

            - `lng: float`

        - `line2: Optional[str]`

          The second line of the address.

        - `province_or_state_name: Optional[str]`

          The full name of the province or state.

        - `status: Optional[Status]`

          The verification status of an address.

          - `"verified"`

          - `"corrected"`

          - `"failed"`

        - `zip_plus4: Optional[str]`

          The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.batch_verification(
    addresses=[{
        "address": "address"
    }],
)
print(response.data)
```

#### Response

```json
{
  "data": {
    "results": [
      {
        "error": "error",
        "verifiedAddress": {
          "city": "city",
          "country": "country",
          "line1": "line1",
          "postalOrZip": "postalOrZip",
          "provinceOrState": "provinceOrState",
          "countryName": "countryName",
          "details": {
            "boxID": "boxID",
            "county": "county",
            "countyNum": "countyNum",
            "deliveryInstallationAreaName": "deliveryInstallationAreaName",
            "deliveryInstallationQualifier": "deliveryInstallationQualifier",
            "deliveryInstallationType": "deliveryInstallationType",
            "extraInfo": "extraInfo",
            "postDirection": "postDirection",
            "preDirection": "preDirection",
            "residential": true,
            "ruralRouteNumber": "ruralRouteNumber",
            "ruralRouteType": "ruralRouteType",
            "streetDirection": "streetDirection",
            "streetName": "streetName",
            "streetNumber": "streetNumber",
            "streetType": "streetType",
            "suiteID": "suiteID",
            "suiteKey": "suiteKey",
            "usCensusBlockNumber": "usCensusBlockNumber",
            "usCensusCMSA": "usCensusCMSA",
            "usCensusFIPS": "usCensusFIPS",
            "usCensusMA": "usCensusMA",
            "usCensusMSA": "usCensusMSA",
            "usCensusPMSA": "usCensusPMSA",
            "usCensusTractNumber": "usCensusTractNumber",
            "usCongressionalDistrictNumber": "usCongressionalDistrictNumber",
            "usHasDaylightSavings": true,
            "usMailingCheckDigit": "usMailingCheckDigit",
            "usMailingsCarrierRoute": "usMailingsCarrierRoute",
            "usMailingsDefaultFlag": true,
            "usMailingsDeliveryPoint": "usMailingsDeliveryPoint",
            "usMailingsDpvConfirmationIndicator": "usMailingsDpvConfirmationIndicator",
            "usMailingsDpvCrmaIndicator": "usMailingsDpvCrmaIndicator",
            "usMailingsDpvFootnote1": "usMailingsDpvFootnote1",
            "usMailingsDpvFootnote2": "usMailingsDpvFootnote2",
            "usMailingsDpvFootnote3": "usMailingsDpvFootnote3",
            "usMailingsElotAscDesc": "usMailingsElotAscDesc",
            "usMailingsElotSequenceNumber": "usMailingsElotSequenceNumber",
            "usMailingsEWSFlag": "usMailingsEWSFlag",
            "usMailingsLACSFlag": "usMailingsLACSFlag",
            "usMailingsLACSReturnCode": "usMailingsLACSReturnCode",
            "usMailingsRecordTypeCode": "usMailingsRecordTypeCode",
            "usMailingsSuiteLinkReturnCode": "usMailingsSuiteLinkReturnCode",
            "usPostnetBarcode": "usPostnetBarcode",
            "usStateLegislativeLower": "usStateLegislativeLower",
            "usStateLegislativeUpper": "usStateLegislativeUpper",
            "usTimeZone": "usTimeZone",
            "vacant": true
          },
          "errors": {
            "city": [
              "string"
            ],
            "generic": [
              "string"
            ],
            "line1": [
              "string"
            ],
            "line2": [
              "string"
            ],
            "postalOrZip": [
              "string"
            ],
            "provinceOrState": [
              "string"
            ]
          },
          "firmName": "firmName",
          "geocodeResult": {
            "accuracy": 0,
            "accuracyType": "rooftop",
            "location": {
              "lat": 0,
              "lng": 0
            }
          },
          "line2": "line2",
          "provinceOrStateName": "provinceOrStateName",
          "status": "verified",
          "zipPlus4": "zipPlus4"
        }
      }
    ]
  },
  "message": "message",
  "status": "success"
}
```

## Suggest Addresses

`address_verification.suggest_addresses(AddressVerificationSuggestAddressesParams**kwargs)  -> AddressVerificationSuggestAddressesResponse`

**post** `/v1/addver/suggestions`

Returns up to 3 verified address suggestions for a given input address.

Useful as a fallback when `POST /verifications` returns a `failed` status —
suggestions represent the closest matches found and may help the user
identify the correct address.

Accepts the same freeform or structured input formats as `POST /verifications`.

- Uses 1 lookup per call (plus 1 more if geocoding).

### Parameters

- `address: str`

  The address you want to verify, written on a single line.

- `geocode: Optional[bool]`

- `include_details: Optional[bool]`

- `proper_case: Optional[bool]`

### Returns

- `class AddressVerificationSuggestAddressesResponse: …`

  - `data: List[Data]`

    - `city: str`

      The city name of the address.

    - `country: str`

      The country code of the address.

    - `line1: str`

      The first line of the address.

    - `postal_or_zip: str`

      The postal code or ZIP code of the address.

    - `province_or_state: str`

      The province or state of the address.

    - `country_name: Optional[str]`

      The country name of the address.

    - `details: Optional[DataDetails]`

      If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

      - `box_id: Optional[str]`

        PO Box ID

      - `county: Optional[str]`

        County in the United States (US address only)

      - `county_num: Optional[str]`

        FIPS code for county (US address only)

      - `delivery_installation_area_name: Optional[str]`

        Delivery installation area name

      - `delivery_installation_qualifier: Optional[str]`

        Delivery installation qualifier

      - `delivery_installation_type: Optional[str]`

        Delivery installation type

      - `extra_info: Optional[str]`

        Any extra information relevant to the address

      - `post_direction: Optional[str]`

        The post-direction of the street (after the street name, US addresses only)

      - `pre_direction: Optional[str]`

        The pre-direction of the street (before the street name, US addresses only)

      - `residential: Optional[bool]`

        Indicates that the address is residential (US address only)

      - `rural_route_number: Optional[str]`

        Rural route number

      - `rural_route_type: Optional[str]`

        Rural route type

      - `street_direction: Optional[str]`

        The direction of the street (N, S, E, W, etc)

      - `street_name: Optional[str]`

        Name of the street where the address is located

      - `street_number: Optional[str]`

        Street number (e.g. the 20 in 20 Bay St)

      - `street_type: Optional[str]`

        Type of the street (DR, ST, BLVD, etc)

      - `suite_id: Optional[str]`

        The unit number/name

      - `suite_key: Optional[str]`

        The suite key

      - `us_census_block_number: Optional[str]`

        US Census block number

      - `us_census_cmsa: Optional[str]`

        US Census consolidated metropolitan statistical area

      - `us_census_fips: Optional[str]`

        US Census FIPS code (US address only)

      - `us_census_ma: Optional[str]`

        US Census metropolitan area

      - `us_census_msa: Optional[str]`

        US Census metropolitan statistical area

      - `us_census_pmsa: Optional[str]`

        US Census primary metropolitan statistical area

      - `us_census_tract_number: Optional[str]`

        US Census tract number

      - `us_congressional_district_number: Optional[str]`

        US congressional district number

      - `us_has_daylight_savings: Optional[bool]`

        True if address location recognizes DST

      - `us_mailing_check_digit: Optional[str]`

        PostNet barcode digit

      - `us_mailings_carrier_route: Optional[str]`

        4-character code assigned to mail delivery route within a 5 digit zip code

      - `us_mailings_default_flag: Optional[bool]`

        True if US address matches a high-rise default or rural route default in the USPS data

      - `us_mailings_delivery_point: Optional[str]`

        Unique USPS identifier for the delivery point

      - `us_mailings_dpv_confirmation_indicator: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_crma_indicator: Optional[str]`

        Y if this is a commercial mail receiving agency, N otherwise

      - `us_mailings_dpv_footnote1: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote2: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote3: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_elot_asc_desc: Optional[str]`

        A for ascending, D for descending

      - `us_mailings_elot_sequence_number: Optional[str]`

        eLOT sequence number

      - `us_mailings_ews_flag: Optional[str]`

        Y if address is in early warning system database

      - `us_mailings_lacs_flag: Optional[str]`

        Y if address converted by LACS

      - `us_mailings_lacs_return_code: Optional[str]`

        Corresponds to USPS LACSLink return code

      - `us_mailings_record_type_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_suite_link_return_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_postnet_barcode: Optional[str]`

        PostNet barcode for the address (US address only)

      - `us_state_legislative_lower: Optional[str]`

        Lower legislative district for the US address

      - `us_state_legislative_upper: Optional[str]`

        Upper legislative district for the US address

      - `us_time_zone: Optional[str]`

        Time zone for the US address area

      - `vacant: Optional[bool]`

        Indicates that the address is vacant according to the USPS (US address only)

    - `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 name of the address.

    - `geocode_result: Optional[DataGeocodeResult]`

      If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
      which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
      this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
      verification, suggestions, and POST /completions endpoint. Note that you must supply country when
      geocoding to get the result successfully.

      - `accuracy: float`

        A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

      - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

        A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

        - `"rooftop"`

        - `"point"`

        - `"range_interpolation"`

        - `"nearest_rooftop_match"`

        - `"intersection"`

        - `"street_center"`

        - `"place"`

        - `"state"`

      - `location: DataGeocodeResultLocation`

        Object that contains `lat`, `lng` properties with number values

        - `lat: float`

        - `lng: float`

    - `line2: Optional[str]`

      The second line of the address.

    - `province_or_state_name: Optional[str]`

      The full name of the province or state.

    - `status: Optional[Status]`

      The verification status of an address.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `zip_plus4: Optional[str]`

      The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.suggest_addresses(
    address="1234 Elm St, Los Angeles, CA 90001, US",
)
print(response.data)
```

#### Response

```json
{
  "status": "success",
  "message": "Addresses suggested successfully",
  "data": [
    {
      "city": "Los Angeles",
      "country": "US",
      "line1": "1234 Elm St",
      "postalOrZip": "90001",
      "provinceOrState": "CA",
      "status": "verified",
      "errors": {}
    }
  ]
}
```

## Parse An Address

`address_verification.parse_an_address(AddressVerificationParseAnAddressParams**kwargs)  -> AddressVerificationParseAnAddressResponse`

**post** `/v1/addver/parses`

Parses a freeform address string into its individual components
(house number, street name, city, state, postal code, etc.).

Useful for extracting structured data from a single-line address without
running a full verification.

- Uses 1 lookup.

### Parameters

- `address: str`

  The address you want to verify, written on a single line.

### Returns

- `class AddressVerificationParseAnAddressResponse: …`

  - `data: Data`

    - `category: Optional[str]`

      The category of the location (e.g. restaurant).

    - `city: Optional[str]`

      The city name.

    - `city_district: Optional[str]`

      The borough within a city.

    - `country: Optional[str]`

      The country.

    - `house: Optional[str]`

      The name of the location.

    - `house_number: Optional[str]`

      The house or street number.

    - `island: Optional[str]`

      The name of the island.

    - `level: Optional[str]`

      The floor.

    - `near: Optional[str]`

      Populated if the input query contains a near/in qualifier.

    - `po_box: Optional[str]`

      The postal office box.

    - `postcode: Optional[str]`

      The postal or ZIP code.

    - `road: Optional[str]`

      The street name.

    - `state: Optional[str]`

      The state or province.

    - `state_district: Optional[str]`

      The county.

    - `suburb: Optional[str]`

      The unofficial neighborhood name.

    - `unit: Optional[str]`

      The apartment, unit, office, lot, or other secondary unit designator.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.parse_an_address(
    address="address",
)
print(response.data)
```

#### Response

```json
{
  "data": {
    "category": "category",
    "city": "city",
    "cityDistrict": "cityDistrict",
    "country": "country",
    "house": "house",
    "houseNumber": "houseNumber",
    "island": "island",
    "level": "level",
    "near": "near",
    "poBox": "poBox",
    "postcode": "postcode",
    "road": "road",
    "state": "state",
    "stateDistrict": "stateDistrict",
    "suburb": "suburb",
    "unit": "unit"
  },
  "message": "message",
  "status": "success"
}
```

## Lookup City Or State From Postal Or Zip Code

`address_verification.lookup_city_or_state_from_postal_or_zip_code(AddressVerificationLookupCityOrStateFromPostalOrZipCodeParams**kwargs)  -> AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse`

**post** `/v1/addver/city_states`

Looks up city, county, and other location metadata for a given US or
Canadian postal code or ZIP code.

A single postal code may map to multiple cities (e.g. a ZIP that spans
several towns), so the response is an array.

- Uses 1 lookup.

### Parameters

- `postal_or_zip: str`

### Returns

- `class AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse: …`

  - `data: List[Data]`

    - `city: str`

      The city name.

    - `country: str`

      The ISO 2-letter country code.

    - `province_or_state: str`

      The province or state abbreviation.

    - `county: Optional[str]`

      The county name (US addresses only).

    - `county_fips: Optional[str]`

      The FIPS code for the county (US addresses only).

    - `mailable: Optional[bool]`

      Whether the location is mailable.

    - `preferred_city: Optional[str]`

      The USPS preferred city name for this postal code.

    - `zip_class: Optional[str]`

      The USPS ZIP code class (e.g. `S` for standard, `P` for PO Box only).

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.lookup_city_or_state_from_postal_or_zip_code(
    postal_or_zip="postalOrZip",
)
print(response.data)
```

#### Response

```json
{
  "data": [
    {
      "city": "city",
      "country": "country",
      "provinceOrState": "provinceOrState",
      "county": "county",
      "countyFIPS": "countyFIPS",
      "mailable": true,
      "preferredCity": "preferredCity",
      "zipClass": "zipClass"
    }
  ],
  "message": "message",
  "status": "success"
}
```

## Lookup Zip Code From City Or State

`address_verification.lookup_zip_code_from_city_or_state(AddressVerificationLookupZipCodeFromCityOrStateParams**kwargs)  -> AddressVerificationLookupZipCodeFromCityOrStateResponse`

**post** `/v1/addver/zip_codes`

Looks up all ZIP codes that correspond to a given US city and state.

- Currently only supported for US addresses (`countryCode: "US"`).
- Uses 1 lookup.

### Parameters

- `city: str`

  The city name.

- `country_code: str`

  The country code. Currently only `US` is supported.

- `state: str`

  The state abbreviation (e.g. `NY`).

### Returns

- `class AddressVerificationLookupZipCodeFromCityOrStateResponse: …`

  - `data: Data`

    - `zip_codes: List[str]`

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Example

```python
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.lookup_zip_code_from_city_or_state(
    city="city",
    country_code="countryCode",
    state="state",
)
print(response.data)
```

#### Response

```json
{
  "data": {
    "zipCodes": [
      "string"
    ]
  },
  "message": "message",
  "status": "success"
}
```

## Domain Types

### Errors

- `class 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.

### Status

- `Literal["verified", "corrected", "failed"]`

  The verification status of an address.

  - `"verified"`

  - `"corrected"`

  - `"failed"`

### Address Verification Verify Response

- `class AddressVerificationVerifyResponse: …`

  - `data: Data`

    - `city: str`

      The city name of the address.

    - `country: str`

      The country code of the address.

    - `line1: str`

      The first line of the address.

    - `postal_or_zip: str`

      The postal code or ZIP code of the address.

    - `province_or_state: str`

      The province or state of the address.

    - `country_name: Optional[str]`

      The country name of the address.

    - `details: Optional[DataDetails]`

      If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

      - `box_id: Optional[str]`

        PO Box ID

      - `county: Optional[str]`

        County in the United States (US address only)

      - `county_num: Optional[str]`

        FIPS code for county (US address only)

      - `delivery_installation_area_name: Optional[str]`

        Delivery installation area name

      - `delivery_installation_qualifier: Optional[str]`

        Delivery installation qualifier

      - `delivery_installation_type: Optional[str]`

        Delivery installation type

      - `extra_info: Optional[str]`

        Any extra information relevant to the address

      - `post_direction: Optional[str]`

        The post-direction of the street (after the street name, US addresses only)

      - `pre_direction: Optional[str]`

        The pre-direction of the street (before the street name, US addresses only)

      - `residential: Optional[bool]`

        Indicates that the address is residential (US address only)

      - `rural_route_number: Optional[str]`

        Rural route number

      - `rural_route_type: Optional[str]`

        Rural route type

      - `street_direction: Optional[str]`

        The direction of the street (N, S, E, W, etc)

      - `street_name: Optional[str]`

        Name of the street where the address is located

      - `street_number: Optional[str]`

        Street number (e.g. the 20 in 20 Bay St)

      - `street_type: Optional[str]`

        Type of the street (DR, ST, BLVD, etc)

      - `suite_id: Optional[str]`

        The unit number/name

      - `suite_key: Optional[str]`

        The suite key

      - `us_census_block_number: Optional[str]`

        US Census block number

      - `us_census_cmsa: Optional[str]`

        US Census consolidated metropolitan statistical area

      - `us_census_fips: Optional[str]`

        US Census FIPS code (US address only)

      - `us_census_ma: Optional[str]`

        US Census metropolitan area

      - `us_census_msa: Optional[str]`

        US Census metropolitan statistical area

      - `us_census_pmsa: Optional[str]`

        US Census primary metropolitan statistical area

      - `us_census_tract_number: Optional[str]`

        US Census tract number

      - `us_congressional_district_number: Optional[str]`

        US congressional district number

      - `us_has_daylight_savings: Optional[bool]`

        True if address location recognizes DST

      - `us_mailing_check_digit: Optional[str]`

        PostNet barcode digit

      - `us_mailings_carrier_route: Optional[str]`

        4-character code assigned to mail delivery route within a 5 digit zip code

      - `us_mailings_default_flag: Optional[bool]`

        True if US address matches a high-rise default or rural route default in the USPS data

      - `us_mailings_delivery_point: Optional[str]`

        Unique USPS identifier for the delivery point

      - `us_mailings_dpv_confirmation_indicator: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_crma_indicator: Optional[str]`

        Y if this is a commercial mail receiving agency, N otherwise

      - `us_mailings_dpv_footnote1: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote2: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote3: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_elot_asc_desc: Optional[str]`

        A for ascending, D for descending

      - `us_mailings_elot_sequence_number: Optional[str]`

        eLOT sequence number

      - `us_mailings_ews_flag: Optional[str]`

        Y if address is in early warning system database

      - `us_mailings_lacs_flag: Optional[str]`

        Y if address converted by LACS

      - `us_mailings_lacs_return_code: Optional[str]`

        Corresponds to USPS LACSLink return code

      - `us_mailings_record_type_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_suite_link_return_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_postnet_barcode: Optional[str]`

        PostNet barcode for the address (US address only)

      - `us_state_legislative_lower: Optional[str]`

        Lower legislative district for the US address

      - `us_state_legislative_upper: Optional[str]`

        Upper legislative district for the US address

      - `us_time_zone: Optional[str]`

        Time zone for the US address area

      - `vacant: Optional[bool]`

        Indicates that the address is vacant according to the USPS (US address only)

    - `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 name of the address.

    - `geocode_result: Optional[DataGeocodeResult]`

      If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
      which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
      this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
      verification, suggestions, and POST /completions endpoint. Note that you must supply country when
      geocoding to get the result successfully.

      - `accuracy: float`

        A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

      - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

        A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

        - `"rooftop"`

        - `"point"`

        - `"range_interpolation"`

        - `"nearest_rooftop_match"`

        - `"intersection"`

        - `"street_center"`

        - `"place"`

        - `"state"`

      - `location: DataGeocodeResultLocation`

        Object that contains `lat`, `lng` properties with number values

        - `lat: float`

        - `lng: float`

    - `line2: Optional[str]`

      The second line of the address.

    - `province_or_state_name: Optional[str]`

      The full name of the province or state.

    - `status: Optional[Status]`

      The verification status of an address.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `zip_plus4: Optional[str]`

      The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Get Lookup Info Response

- `class AddressVerificationGetLookupInfoResponse: …`

  - `data: Data`

    - `free_limit: Optional[int]`

      The maximum number of lookups allowed in the current billing period.
      `null` indicates an unlimited plan.

    - `used: int`

      The number of lookups consumed in the current billing period.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Get Autocomplete Previews Response

- `class AddressVerificationGetAutocompletePreviewsResponse: …`

  - `data: List[Data]`

    - `preview: DataPreview`

      A partial view of the address, suitable for display in an autocomplete dropdown.

      - `address: str`

        The street address line.

      - `city: Optional[str]`

        The city.

      - `pc: Optional[str]`

        For US addresses, the full postal code. For non-US addresses,
        only the first 3 digits are returned to avoid consuming a lookup.

      - `prov: Optional[str]`

        The province or state abbreviation. Returned instead of `pc` when `provInsteadOfPC=true`.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Autocomplete Response

- `class AddressVerificationAutocompleteResponse: …`

  - `data: Data`

    - `class DataCompletedAddressItem: …`

      - `address: DataCompletedAddressItemAddress`

        The resolved address components.

        - `address: str`

          The first line of the address.

        - `address2: Optional[str]`

          The second line of the address.

        - `city: Optional[str]`

          The city.

        - `country: Optional[str]`

          The ISO 2-letter country code.

        - `pc: Optional[str]`

          The postal code.

        - `prov: Optional[str]`

          The province or state abbreviation.

      - `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.

      - `geocode_result: Optional[DataCompletedAddressItemGeocodeResult]`

        Geocoding result. Only present when `geocode=true` is supplied and an `index` is specified.

        - `accuracy: float`

          A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

        - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

          A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

          - `"rooftop"`

          - `"point"`

          - `"range_interpolation"`

          - `"nearest_rooftop_match"`

          - `"intersection"`

          - `"street_center"`

          - `"place"`

          - `"state"`

        - `location: DataCompletedAddressItemGeocodeResultLocation`

          Object that contains `lat`, `lng` properties with number values

          - `lat: float`

          - `lng: float`

    - `List[DataUnionMember1]`

      - `address: DataUnionMember1Address`

        The resolved address components.

        - `address: str`

          The first line of the address.

        - `address2: Optional[str]`

          The second line of the address.

        - `city: Optional[str]`

          The city.

        - `country: Optional[str]`

          The ISO 2-letter country code.

        - `pc: Optional[str]`

          The postal code.

        - `prov: Optional[str]`

          The province or state abbreviation.

      - `errors: Optional[Errors]`

        Errors encountered during address verification.

      - `geocode_result: Optional[DataUnionMember1GeocodeResult]`

        Geocoding result. Only present when `geocode=true` is supplied and an `index` is specified.

        - `accuracy: float`

          A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

        - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

          A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

          - `"rooftop"`

          - `"point"`

          - `"range_interpolation"`

          - `"nearest_rooftop_match"`

          - `"intersection"`

          - `"street_center"`

          - `"place"`

          - `"state"`

        - `location: DataUnionMember1GeocodeResultLocation`

          Object that contains `lat`, `lng` properties with number values

          - `lat: float`

          - `lng: float`

    - `class DataStandardVerifiedAddress: …`

      - `city: str`

        The city name of the address.

      - `country: str`

        The country code of the address.

      - `line1: str`

        The first line of the address.

      - `postal_or_zip: str`

        The postal code or ZIP code of the address.

      - `province_or_state: str`

        The province or state of the address.

      - `country_name: Optional[str]`

        The country name of the address.

      - `details: Optional[DataStandardVerifiedAddressDetails]`

        If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

        - `box_id: Optional[str]`

          PO Box ID

        - `county: Optional[str]`

          County in the United States (US address only)

        - `county_num: Optional[str]`

          FIPS code for county (US address only)

        - `delivery_installation_area_name: Optional[str]`

          Delivery installation area name

        - `delivery_installation_qualifier: Optional[str]`

          Delivery installation qualifier

        - `delivery_installation_type: Optional[str]`

          Delivery installation type

        - `extra_info: Optional[str]`

          Any extra information relevant to the address

        - `post_direction: Optional[str]`

          The post-direction of the street (after the street name, US addresses only)

        - `pre_direction: Optional[str]`

          The pre-direction of the street (before the street name, US addresses only)

        - `residential: Optional[bool]`

          Indicates that the address is residential (US address only)

        - `rural_route_number: Optional[str]`

          Rural route number

        - `rural_route_type: Optional[str]`

          Rural route type

        - `street_direction: Optional[str]`

          The direction of the street (N, S, E, W, etc)

        - `street_name: Optional[str]`

          Name of the street where the address is located

        - `street_number: Optional[str]`

          Street number (e.g. the 20 in 20 Bay St)

        - `street_type: Optional[str]`

          Type of the street (DR, ST, BLVD, etc)

        - `suite_id: Optional[str]`

          The unit number/name

        - `suite_key: Optional[str]`

          The suite key

        - `us_census_block_number: Optional[str]`

          US Census block number

        - `us_census_cmsa: Optional[str]`

          US Census consolidated metropolitan statistical area

        - `us_census_fips: Optional[str]`

          US Census FIPS code (US address only)

        - `us_census_ma: Optional[str]`

          US Census metropolitan area

        - `us_census_msa: Optional[str]`

          US Census metropolitan statistical area

        - `us_census_pmsa: Optional[str]`

          US Census primary metropolitan statistical area

        - `us_census_tract_number: Optional[str]`

          US Census tract number

        - `us_congressional_district_number: Optional[str]`

          US congressional district number

        - `us_has_daylight_savings: Optional[bool]`

          True if address location recognizes DST

        - `us_mailing_check_digit: Optional[str]`

          PostNet barcode digit

        - `us_mailings_carrier_route: Optional[str]`

          4-character code assigned to mail delivery route within a 5 digit zip code

        - `us_mailings_default_flag: Optional[bool]`

          True if US address matches a high-rise default or rural route default in the USPS data

        - `us_mailings_delivery_point: Optional[str]`

          Unique USPS identifier for the delivery point

        - `us_mailings_dpv_confirmation_indicator: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_dpv_crma_indicator: Optional[str]`

          Y if this is a commercial mail receiving agency, N otherwise

        - `us_mailings_dpv_footnote1: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_dpv_footnote2: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_dpv_footnote3: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_elot_asc_desc: Optional[str]`

          A for ascending, D for descending

        - `us_mailings_elot_sequence_number: Optional[str]`

          eLOT sequence number

        - `us_mailings_ews_flag: Optional[str]`

          Y if address is in early warning system database

        - `us_mailings_lacs_flag: Optional[str]`

          Y if address converted by LACS

        - `us_mailings_lacs_return_code: Optional[str]`

          Corresponds to USPS LACSLink return code

        - `us_mailings_record_type_code: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_mailings_suite_link_return_code: Optional[str]`

          See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

        - `us_postnet_barcode: Optional[str]`

          PostNet barcode for the address (US address only)

        - `us_state_legislative_lower: Optional[str]`

          Lower legislative district for the US address

        - `us_state_legislative_upper: Optional[str]`

          Upper legislative district for the US address

        - `us_time_zone: Optional[str]`

          Time zone for the US address area

        - `vacant: Optional[bool]`

          Indicates that the address is vacant according to the USPS (US address only)

      - `errors: Optional[Errors]`

        Errors encountered during address verification.

      - `firm_name: Optional[str]`

        The firm name of the address.

      - `geocode_result: Optional[DataStandardVerifiedAddressGeocodeResult]`

        If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
        which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
        this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
        verification, suggestions, and POST /completions endpoint. Note that you must supply country when
        geocoding to get the result successfully.

        - `accuracy: float`

          A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

        - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

          A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

          - `"rooftop"`

          - `"point"`

          - `"range_interpolation"`

          - `"nearest_rooftop_match"`

          - `"intersection"`

          - `"street_center"`

          - `"place"`

          - `"state"`

        - `location: DataStandardVerifiedAddressGeocodeResultLocation`

          Object that contains `lat`, `lng` properties with number values

          - `lat: float`

          - `lng: float`

      - `line2: Optional[str]`

        The second line of the address.

      - `province_or_state_name: Optional[str]`

        The full name of the province or state.

      - `status: Optional[Status]`

        The verification status of an address.

        - `"verified"`

        - `"corrected"`

        - `"failed"`

      - `zip_plus4: Optional[str]`

        The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Batch Verification Response

- `class AddressVerificationBatchVerificationResponse: …`

  - `data: Data`

    - `results: List[DataResult]`

      - `error: Optional[str]`

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

      - `verified_address: Optional[DataResultVerifiedAddress]`

        The verified address result. Present when verification succeeded.

        - `city: str`

          The city name of the address.

        - `country: str`

          The country code of the address.

        - `line1: str`

          The first line of the address.

        - `postal_or_zip: str`

          The postal code or ZIP code of the address.

        - `province_or_state: str`

          The province or state of the address.

        - `country_name: Optional[str]`

          The country name of the address.

        - `details: Optional[DataResultVerifiedAddressDetails]`

          If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

          - `box_id: Optional[str]`

            PO Box ID

          - `county: Optional[str]`

            County in the United States (US address only)

          - `county_num: Optional[str]`

            FIPS code for county (US address only)

          - `delivery_installation_area_name: Optional[str]`

            Delivery installation area name

          - `delivery_installation_qualifier: Optional[str]`

            Delivery installation qualifier

          - `delivery_installation_type: Optional[str]`

            Delivery installation type

          - `extra_info: Optional[str]`

            Any extra information relevant to the address

          - `post_direction: Optional[str]`

            The post-direction of the street (after the street name, US addresses only)

          - `pre_direction: Optional[str]`

            The pre-direction of the street (before the street name, US addresses only)

          - `residential: Optional[bool]`

            Indicates that the address is residential (US address only)

          - `rural_route_number: Optional[str]`

            Rural route number

          - `rural_route_type: Optional[str]`

            Rural route type

          - `street_direction: Optional[str]`

            The direction of the street (N, S, E, W, etc)

          - `street_name: Optional[str]`

            Name of the street where the address is located

          - `street_number: Optional[str]`

            Street number (e.g. the 20 in 20 Bay St)

          - `street_type: Optional[str]`

            Type of the street (DR, ST, BLVD, etc)

          - `suite_id: Optional[str]`

            The unit number/name

          - `suite_key: Optional[str]`

            The suite key

          - `us_census_block_number: Optional[str]`

            US Census block number

          - `us_census_cmsa: Optional[str]`

            US Census consolidated metropolitan statistical area

          - `us_census_fips: Optional[str]`

            US Census FIPS code (US address only)

          - `us_census_ma: Optional[str]`

            US Census metropolitan area

          - `us_census_msa: Optional[str]`

            US Census metropolitan statistical area

          - `us_census_pmsa: Optional[str]`

            US Census primary metropolitan statistical area

          - `us_census_tract_number: Optional[str]`

            US Census tract number

          - `us_congressional_district_number: Optional[str]`

            US congressional district number

          - `us_has_daylight_savings: Optional[bool]`

            True if address location recognizes DST

          - `us_mailing_check_digit: Optional[str]`

            PostNet barcode digit

          - `us_mailings_carrier_route: Optional[str]`

            4-character code assigned to mail delivery route within a 5 digit zip code

          - `us_mailings_default_flag: Optional[bool]`

            True if US address matches a high-rise default or rural route default in the USPS data

          - `us_mailings_delivery_point: Optional[str]`

            Unique USPS identifier for the delivery point

          - `us_mailings_dpv_confirmation_indicator: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_dpv_crma_indicator: Optional[str]`

            Y if this is a commercial mail receiving agency, N otherwise

          - `us_mailings_dpv_footnote1: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_dpv_footnote2: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_dpv_footnote3: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_elot_asc_desc: Optional[str]`

            A for ascending, D for descending

          - `us_mailings_elot_sequence_number: Optional[str]`

            eLOT sequence number

          - `us_mailings_ews_flag: Optional[str]`

            Y if address is in early warning system database

          - `us_mailings_lacs_flag: Optional[str]`

            Y if address converted by LACS

          - `us_mailings_lacs_return_code: Optional[str]`

            Corresponds to USPS LACSLink return code

          - `us_mailings_record_type_code: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_mailings_suite_link_return_code: Optional[str]`

            See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

          - `us_postnet_barcode: Optional[str]`

            PostNet barcode for the address (US address only)

          - `us_state_legislative_lower: Optional[str]`

            Lower legislative district for the US address

          - `us_state_legislative_upper: Optional[str]`

            Upper legislative district for the US address

          - `us_time_zone: Optional[str]`

            Time zone for the US address area

          - `vacant: Optional[bool]`

            Indicates that the address is vacant according to the USPS (US address only)

        - `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 name of the address.

        - `geocode_result: Optional[DataResultVerifiedAddressGeocodeResult]`

          If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
          which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
          this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
          verification, suggestions, and POST /completions endpoint. Note that you must supply country when
          geocoding to get the result successfully.

          - `accuracy: float`

            A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

          - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

            A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

            - `"rooftop"`

            - `"point"`

            - `"range_interpolation"`

            - `"nearest_rooftop_match"`

            - `"intersection"`

            - `"street_center"`

            - `"place"`

            - `"state"`

          - `location: DataResultVerifiedAddressGeocodeResultLocation`

            Object that contains `lat`, `lng` properties with number values

            - `lat: float`

            - `lng: float`

        - `line2: Optional[str]`

          The second line of the address.

        - `province_or_state_name: Optional[str]`

          The full name of the province or state.

        - `status: Optional[Status]`

          The verification status of an address.

          - `"verified"`

          - `"corrected"`

          - `"failed"`

        - `zip_plus4: Optional[str]`

          The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Suggest Addresses Response

- `class AddressVerificationSuggestAddressesResponse: …`

  - `data: List[Data]`

    - `city: str`

      The city name of the address.

    - `country: str`

      The country code of the address.

    - `line1: str`

      The first line of the address.

    - `postal_or_zip: str`

      The postal code or ZIP code of the address.

    - `province_or_state: str`

      The province or state of the address.

    - `country_name: Optional[str]`

      The country name of the address.

    - `details: Optional[DataDetails]`

      If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.

      - `box_id: Optional[str]`

        PO Box ID

      - `county: Optional[str]`

        County in the United States (US address only)

      - `county_num: Optional[str]`

        FIPS code for county (US address only)

      - `delivery_installation_area_name: Optional[str]`

        Delivery installation area name

      - `delivery_installation_qualifier: Optional[str]`

        Delivery installation qualifier

      - `delivery_installation_type: Optional[str]`

        Delivery installation type

      - `extra_info: Optional[str]`

        Any extra information relevant to the address

      - `post_direction: Optional[str]`

        The post-direction of the street (after the street name, US addresses only)

      - `pre_direction: Optional[str]`

        The pre-direction of the street (before the street name, US addresses only)

      - `residential: Optional[bool]`

        Indicates that the address is residential (US address only)

      - `rural_route_number: Optional[str]`

        Rural route number

      - `rural_route_type: Optional[str]`

        Rural route type

      - `street_direction: Optional[str]`

        The direction of the street (N, S, E, W, etc)

      - `street_name: Optional[str]`

        Name of the street where the address is located

      - `street_number: Optional[str]`

        Street number (e.g. the 20 in 20 Bay St)

      - `street_type: Optional[str]`

        Type of the street (DR, ST, BLVD, etc)

      - `suite_id: Optional[str]`

        The unit number/name

      - `suite_key: Optional[str]`

        The suite key

      - `us_census_block_number: Optional[str]`

        US Census block number

      - `us_census_cmsa: Optional[str]`

        US Census consolidated metropolitan statistical area

      - `us_census_fips: Optional[str]`

        US Census FIPS code (US address only)

      - `us_census_ma: Optional[str]`

        US Census metropolitan area

      - `us_census_msa: Optional[str]`

        US Census metropolitan statistical area

      - `us_census_pmsa: Optional[str]`

        US Census primary metropolitan statistical area

      - `us_census_tract_number: Optional[str]`

        US Census tract number

      - `us_congressional_district_number: Optional[str]`

        US congressional district number

      - `us_has_daylight_savings: Optional[bool]`

        True if address location recognizes DST

      - `us_mailing_check_digit: Optional[str]`

        PostNet barcode digit

      - `us_mailings_carrier_route: Optional[str]`

        4-character code assigned to mail delivery route within a 5 digit zip code

      - `us_mailings_default_flag: Optional[bool]`

        True if US address matches a high-rise default or rural route default in the USPS data

      - `us_mailings_delivery_point: Optional[str]`

        Unique USPS identifier for the delivery point

      - `us_mailings_dpv_confirmation_indicator: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_crma_indicator: Optional[str]`

        Y if this is a commercial mail receiving agency, N otherwise

      - `us_mailings_dpv_footnote1: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote2: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_dpv_footnote3: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_elot_asc_desc: Optional[str]`

        A for ascending, D for descending

      - `us_mailings_elot_sequence_number: Optional[str]`

        eLOT sequence number

      - `us_mailings_ews_flag: Optional[str]`

        Y if address is in early warning system database

      - `us_mailings_lacs_flag: Optional[str]`

        Y if address converted by LACS

      - `us_mailings_lacs_return_code: Optional[str]`

        Corresponds to USPS LACSLink return code

      - `us_mailings_record_type_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_mailings_suite_link_return_code: Optional[str]`

        See [USPS DPV](https://avdocs.postgrid.com/#usps-dpv)

      - `us_postnet_barcode: Optional[str]`

        PostNet barcode for the address (US address only)

      - `us_state_legislative_lower: Optional[str]`

        Lower legislative district for the US address

      - `us_state_legislative_upper: Optional[str]`

        Upper legislative district for the US address

      - `us_time_zone: Optional[str]`

        Time zone for the US address area

      - `vacant: Optional[bool]`

        Indicates that the address is vacant according to the USPS (US address only)

    - `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 name of the address.

    - `geocode_result: Optional[DataGeocodeResult]`

      If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
      which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema.  You can request
      this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
      verification, suggestions, and POST /completions endpoint. Note that you must supply country when
      geocoding to get the result successfully.

      - `accuracy: float`

        A real number from 0.00 to 1.00 which represents an [accuracy score](https://avdocs.postgrid.com/#accuracy-score)

      - `accuracy_type: Literal["rooftop", "point", "range_interpolation", 5 more]`

        A string representing the [accuracy type](https://avdocs.postgrid.com/#accuracy-type)

        - `"rooftop"`

        - `"point"`

        - `"range_interpolation"`

        - `"nearest_rooftop_match"`

        - `"intersection"`

        - `"street_center"`

        - `"place"`

        - `"state"`

      - `location: DataGeocodeResultLocation`

        Object that contains `lat`, `lng` properties with number values

        - `lat: float`

        - `lng: float`

    - `line2: Optional[str]`

      The second line of the address.

    - `province_or_state_name: Optional[str]`

      The full name of the province or state.

    - `status: Optional[Status]`

      The verification status of an address.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `zip_plus4: Optional[str]`

      The zip plus 4 code of the address.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Parse An Address Response

- `class AddressVerificationParseAnAddressResponse: …`

  - `data: Data`

    - `category: Optional[str]`

      The category of the location (e.g. restaurant).

    - `city: Optional[str]`

      The city name.

    - `city_district: Optional[str]`

      The borough within a city.

    - `country: Optional[str]`

      The country.

    - `house: Optional[str]`

      The name of the location.

    - `house_number: Optional[str]`

      The house or street number.

    - `island: Optional[str]`

      The name of the island.

    - `level: Optional[str]`

      The floor.

    - `near: Optional[str]`

      Populated if the input query contains a near/in qualifier.

    - `po_box: Optional[str]`

      The postal office box.

    - `postcode: Optional[str]`

      The postal or ZIP code.

    - `road: Optional[str]`

      The street name.

    - `state: Optional[str]`

      The state or province.

    - `state_district: Optional[str]`

      The county.

    - `suburb: Optional[str]`

      The unofficial neighborhood name.

    - `unit: Optional[str]`

      The apartment, unit, office, lot, or other secondary unit designator.

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Lookup City Or State From Postal Or Zip Code Response

- `class AddressVerificationLookupCityOrStateFromPostalOrZipCodeResponse: …`

  - `data: List[Data]`

    - `city: str`

      The city name.

    - `country: str`

      The ISO 2-letter country code.

    - `province_or_state: str`

      The province or state abbreviation.

    - `county: Optional[str]`

      The county name (US addresses only).

    - `county_fips: Optional[str]`

      The FIPS code for the county (US addresses only).

    - `mailable: Optional[bool]`

      Whether the location is mailable.

    - `preferred_city: Optional[str]`

      The USPS preferred city name for this postal code.

    - `zip_class: Optional[str]`

      The USPS ZIP code class (e.g. `S` for standard, `P` for PO Box only).

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`

### Address Verification Lookup Zip Code From City Or State Response

- `class AddressVerificationLookupZipCodeFromCityOrStateResponse: …`

  - `data: Data`

    - `zip_codes: List[str]`

  - `message: str`

  - `status: Literal["success", "error"]`

    - `"success"`

    - `"error"`
