Sonic

Complete an address into coordinates for Sonic Drive-In store search

Completes a partial address, place, city, state or ZIP into ranked matches, each already carrying the latitude and longitude that GET /sonic/nearby takes -- so a caller can run a Sonic restaurant search from free text instead of coordinates. Each suggestion's layer describes its granularity and is one of address, locality, state, postalCode or place, and confidence is one of exact, interpolated or fallback. Results are restricted to one country (default US). A query that matches nothing returns an empty suggestions array with count 0, not an error.

get/sonic/location-suggest

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/sonic/location-suggest
  • Auth: API key in header x-api-key

Query parameters

querystring required

Partial address, place, city, state or ZIP to complete

limitinteger

Maximum suggestions, 1-25. Defaults to 5. Upstream may return fewer.

countrystring

ISO 3166-1 alpha-2 country code to restrict results to. Defaults to US.

Headers

x-api-keystring required

API key required

Response

OK

codeinteger

Code is the HTTP status code or a custom code used to indicate the result of the request @example 200

msgunknown

Example response

{
  "data": {
    "count": 5,
    "country": "US",
    "limit": 5,
    "query": "cheyenne wy",
    "suggestions": [
      {
        "city": "Cheyenne",
        "confidence": "exact",
        "country": "United States",
        "country_code": "US",
        "county": "Laramie",
        "formatted_address": "2540 Dell Range Blvd, Cheyenne, WY 82009 US",
        "label": "2540 Dell Range Blvd",
        "latitude": 41.160549,
        "layer": "address",
        "longitude": -104.777671,
        "number": "2540",
        "postal_code": "82009",
        "state": "Wyoming",
        "state_code": "WY",
        "street": "Dell Range Blvd"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.