Sonic API endpoint
Returns Sonic Drive-In's restaurant directory as a country to state to city tree, with a restaurant count at every level. Use it to discover which states and cities have restaurants before calling GET /sonic/locations or GET /sonic/nearby. Each city carries both its display name and the slug that composes into a store path. Counts here describe listed restaurants and are internally consistent (the city counts sum to total_count); GET /sonic/locations enumerates a larger set of store pages, so the two totals intentionally differ.
/sonic/directoryThis endpoint takes no query parameters. It uses the anonymous regions API called by Sonic’s current All Locations page; restaurant counts are live and can change as stores open or close. Incomplete pagination or inconsistent country/state/city totals returns an upstream error.
Response includes total_count, countries[], source_url, and fetched_at.
Each entry in countries[] has country_code, country_name, count, and states[]. Each state has code, name, count, and cities[]. Each city has name, slug, and count.
slug follows the website’s city-link rule: trim, replace periods, whitespace and slashes with hyphens, then lowercase. It composes into a store path and is the value /sonic/locations accepts as its city filter; name is the display form.
Counts here describe listed restaurants and are internally consistent — the city counts sum to total_count. Note that /sonic/locations enumerates a larger set: it lists every published store page, including some the directory does not count, so the two totals intentionally differ.
Example response (state/city arrays abbreviated):
{"code":200,"msg":"OK","data":{"total_count":3357,"countries":[{"country_code":"US","country_name":"United States","count":3357,"states":[{"code":"AL","name":"Alabama","count":95,"cities":[{"name":"Albertville","slug":"albertville","count":1}]},{"code":"WY","name":"Wyoming","count":6,"cities":[{"name":"Cheyenne","slug":"cheyenne","count":2}]}]}],"source_url":"https://api-idp.sonicdrivein.com/snc/digital-exp-api/v1/locations/regions?countryCode=US","fetched_at":"2026-10-03T00:00:00Z"}}
| Field | Filled in, of 1 checked | Values in the sample |
|---|---|---|
| country_code | 1 | |
| country_name | 1 | “United States” |
| count | 1 | 3,354 |
| states | 1 | median 47 entries |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/sonic/directory" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"total_count": 3357,
"countries": [
{
"country_code": "US",
"country_name": "United States",
"count": 3357,
"states": [
{
"code": "AL",
"name": "Alabama",
"count": 95,
"cities": [
{
"name": "Albertville",
"slug": "albertville",
"count": 1
}
]
},
{
"code": "WY",
"name": "Wyoming",
"count": 6,
"cities": [
{
"name": "Cheyenne",
"slug": "cheyenne",
"count": 2
}
]
}
]
}
],
"source_url": "https://api-idp.sonicdrivein.com/snc/digital-exp-api/v1/locations/regions?countryCode=US",
"fetched_at": "2026-10-03T00:00:00Z"
}
}Request schema
No body schema
Response schema
#/definitions/sonic.directoryResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | Code is the HTTP status code or a custom code used to indicate the result of the request @example 200 | |||
| data | sonic.DirectoryResponse | No | ||||
| data.countries | array | No | ||||
| data.countries[].count | integer | No | 3364 | |||
| data.countries[].country_code | string | No | US | |||
| data.countries[].country_name | string | No | United States | |||
| data.countries[].states | array | No | ||||
| data.countries[].states[].cities | array | No | ||||
| data.countries[].states[].cities[].count | integer | No | 1 | |||
| data.countries[].states[].cities[].name | string | No | Albertville | |||
| data.countries[].states[].cities[].slug | string | No | albertville | Slug is the city segment as it appears in a store path, which is the lowercased form GET /sonic/locations returns. | ||
| data.countries[].states[].code | string | No | AL | |||
| data.countries[].states[].count | integer | No | 95 | |||
| data.countries[].states[].name | string | No | Alabama | |||
| data.fetched_at | string | No | ||||
| data.source_url | string | No | ||||
| data.total_count | integer | No | 3364 | |||
| msg | unknown | No | Msg is the message that describes the result of the request @example "Request successful" |
| Status | Description | Schema |
|---|---|---|
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/sonic/directory" \
-H "x-api-key: $CRAWLORA_API_KEY"