find duplicate addresses in database, stop users entering them early?

前端 未结 15 1257
长发绾君心
长发绾君心 2021-02-04 05:13

How do I find duplicate addresses in a database, or better stop people already when filling in the form ? I guess the earlier the better?

Is there any good way of abstra

15条回答
  •  攒了一身酷
    2021-02-04 05:51

    In the USA, you can use USPS Address Standardization Web Tool. It verifies and normalizes addresses for you. This way, you can normalize the address before checking if it already exists in the database. If all the addresses in the database are already normalized, you'll be able to spot duplicates easily.

    Sample URL:

    https://production.shippingapis.com/ShippingAPI.dll?API=Verify&XML=insert_request_XML_here

    Sample request:

    
      true
      true
      
    205 bagwell ave nutter fort wv

    Sample response:

    
      
    205 BAGWELL AVE NUTTER FORT WV 26301 4322 05 C025

    Other countries might have their own APIs. Other people mentioned 3rd party APIs that support multiple countries that might be useful in some cases.

提交回复
热议问题