Batch Verification
client.addressVerification.batchVerification(AddressVerificationBatchVerificationParams { addresses, geocode, includeDetails, 2 more } params, RequestOptionsoptions?): AddressVerificationBatchVerificationResponse { data, message, status }
POST/v1/addver/verifications/batch
Verify a batch of US or Canadian addresses in a single request. Each item is either a freeform string or the structured address fields themselves.
- Accepts up to 2,000 addresses per request.
- 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
errorfield rather than averifiedAddress. - If you are not subscribed and the batch would exceed your remaining free lookups, the entire batch fails (nothing is verified). Size your batch to the number of lookups you have left.
- To add the addresses to a draft accuracy statement (beta), pass its ID
as
accuracyStatementand send every address as a structured object withinputIDandaccuracyStatementInclusion(includeorexclude). Accuracy statements require a live API key and the feature to be enabled for your organization.
Batch Verification
import PostGrid from 'postgrid-node';
const client = new PostGrid({
addressVerificationAPIKey: process.env['POSTGRID_ADDRESS_VERIFICATION_API_KEY'], // This is the default and can be omitted
});
const response = await client.addressVerification.batchVerification({ addresses: ['string'] });
console.log(response.data);{
"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
}
},
"inputID": "inputID",
"line2": "line2",
"provinceOrStateName": "provinceOrStateName",
"status": "verified",
"zipPlus4": "zipPlus4"
}
}
]
},
"message": "message",
"status": "success"
}Returns Examples
{
"data": {
"results": [
{
"error": "error",
"verifiedAddress": {
"city": "city",
"country": "country",
"line1": "line1",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState",
"countryName": "countryName",
"details": {
"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
}
},
"inputID": "inputID",
"line2": "line2",
"provinceOrStateName": "provinceOrStateName",
"status": "verified",
"zipPlus4": "zipPlus4"
}
}
]
},
"message": "message",
"status": "success"
}