Last updated
Last updated
Search locations using a geo-search query (City, State, Postal code) or using specific latitude and longitude coordinates.
Locations are sorted by distance from the searched location.
GET /_api/locations_search/
GET /_api/locations_search/?near_location=Seattle,%20WA
GET /_api/locations_search/?near_location=98121
GET /_api/locations_search/?near_lat=39.8281&near_lon=-98.5795
Locations are returned within objects
. If no locations are matched, objects
will be an empty list.
The response will also contain distance details for each location and distance context.
In the resulting response meta
we will add the latitude and longitude of the searched point for reference.
In each of the the resulting Location objects, we add distance
(in miles or km depending on distance_unit
).
For list of attributes returned for each location, see
near_location
string
Geographic search query. Can take any input that could be passed to Google Geocoding including city, state, full address or postal code
near_lat
float
Example: 39.8281
Used in combination with near_lon
near_lon
float
Example: -98.5795
Used in combination with near_lat
limit
integer
Number of locations to return
threshold
integer
Distance in distance_unit
(miles/km) to restrict location search results
distance_unit
string
miles
(default) or km
postal_code_match_type
string
Matching to location assigned postal code territories
Options:
- only
: This will only return locations that have postal codes assigned that match
- first
: This will return matching locations, but if no locations are assigned the postal code then normal geo-distance searched results will be returned
Query and search locations using the same technology that powers our Location Finder technology