Road Closed

This information is outdated and is no longer maintained. Get the latest!

 

How can I use autocomplete without the jQuery plugin?

Question

Last Updated: July 3, 2013

I'd like to use the LiveAddress autocomplete feature with my own implementation, and without using the jQuery plugin. How can I do this?

Answer

You are welcome to build your own autocomplete implementation (user interface) using our LiveAddress autocomplete REST endpoint, provided that you are currently using an active LiveAddress API subscription. You are required to submit a website key from your account with each autocomplete request. Please note that as we provide this freely, we reserve the right to terminate usage of the autocomplete endpoint if we detect abuse or violation of terms. By using the autocomplete service in any way, you agree to the terms as explained on the pages of our website.

Here is a sample request: https://us-autocomplete.api.smartystreets.com/suggest?auth-id=WEBSITE_KEY_HERE&prefix=123+main Here are the accepted parameters:

ParameterRequiredValue
prefixYThe portion of the address which has already been typed
auth-idYA website key from your account
suggestionsMaximum number of suggestions, between 1 and 10, with 10 being the default
city_filterA list of city names, separated by commas, to which to limit the results
state_filterA list of state abbreviations, separated by commas, to which to limit the results
preferA list of cities/states to bias in the results, such that suggestions in those areas appear at the top. Separate city/state combinations with a semicolon, and put a comma between the city and state. Examples:
"Las Vegas, NV"
"Houston, TX; Spring, TX"
"UT; MN"
"Salt Lake City, UT; NV"
geolocateBy default, suggestions are geolocated to show suggestions in the user's city, based on their IP address. You can toggle this feature by setting the value to true or false.

The response will be a JSON object like so: { "suggestions": [ { "text": "123 Main Rd, Abbot ME", "street_line": "123 Main Rd", "city": "Abbot", "state": "ME" }, /* ...TRUNCATED FOR BREVITY ... */ ] }

The structure of the response, and the input parameters, are subject to change at any time as we improve the service. We do not officially support or endorse external or 3rd-party implementations of LiveAddress autocomplete.