Search code examples
validationstreet-addresssmartystreets

SmartyStreets Address Validation PHP Example?


Can I get a sample PHP code example which calls SmartyStreets LiveAddress API for address validation?


Solution

  • Sure -- we have sample code at our GitHub repository. There's 3 examples there:

    1. A request to our API using cURL (can handle many addresses at once)
    2. A GET request. Easy, but only supports one address per request
    3. A "SLAP" (Single-Line Address Processing) example which shows how to verify an address if it's not already split into components like street, city, state, etc.

    If you have any further questions, I'd be happy to help; I wrote these examples.