USPS API for Address Correction Response Question

741 views Asked by At

I want to use the USPS API https://www.usps.com/business/web-tools-apis/address-information-api.htm for correcting addresses typed into our application.

Specifically, I will add a little button next to the address that will allow the user send the typed address to the service and then confirm that that the returned address is the one they would like to replace it with.

I have seen other websites do this and I like it because the user has control over inserting errant addresses returned by USPS. [I am not saying that the USPS data is bad; the likely scenario is that the entered address is so bad the USPS guessed wrong].

Anyway, I am looking at the response sample for the verify service:

USPS Response Sample

I am observing that only one guess at the real address is returned. Other services I have seen return multiple so the user can pick the best one.

Is there an option on the USPS API that will return multiple guesses for a single address?

Note: the Address ID='0' is for sending multiple addresses and being able to sort it out in the returned data.

1

There are 1 answers

0
Harry Whitehouse On

The address you input contained the suite number (STE K) so there is no ambiguity with the result. It is a "precise match". If you remove the "STE K" from the input address, the response will contain a ZIP + 4, but the DPV parameters will indicate that the match is a "default match". This type of match occurs with high rises and apartment complexes, where there is a main street address which has a "default" ZIP+4, but there is frequently a better "precise" response if an apartment or suite identifier is provided. The precise response will typically have a different +4 and carrier route than the default response.