Find nearby stops for voice agents

GET /compact/v1/stopsInRadius
Base URL: https://capi.busmaps.com:8443

For voice models and voice agents, this endpoint reduces response tokens and keeps spoken-answer tool calls focused. Return all candidate stops from /v1/stopsInRadius in a normalized compact response sorted by calculated distance from the requested point. routeFields and stopFields declare row order once; each stop uses routeRefs to reference globally deduplicated routes including their transport modes. Stop identifiers, coordinates, distances and route identifiers remain available for exact /v1/nextDepartures and /v1/line follow-ups. No stops or routes are truncated beyond an optional requested limit.

Voice-ready response: This JSON REST method uses a smaller positional representation so voice models spend fewer tokens on repeated fields and map-only data. It does not accept or process audio.

Need the complete response object?

The standard endpoint returns the complete application and map-oriented response for the same capability.

View the standard endpoint

Response fields and units

FieldFormat / unitMeaning
stops[].transit_icon (stopFields) string or null Opaque stop icon identifier passed through unchanged. The trailing column preserves existing column indexes; null means no icon.
routeFields + routes, stopFields + stops columnar JSON Each row uses the field order declared once by its matching Fields array
regionName string Region to reuse with stopId in /compact/v1/nextDepartures
stops[].stopId, countryIso string Stop identifiers for an exact follow-up departure request
stops[].lat, lon, distanceMeters WGS 84 decimal degrees and meters Stop coordinates and calculated distance from the requested point
stops[].routeRefs array of indexes Indexes into routes with routeId, countryIso, public-facing line name and transport mode
imperial boolean Optional flag, present as true for US/UK

Parameters

ParameterTypeRequiredDescriptionExample
location string Yes Coordinates for search in 'lat,lon' format 51.539258,-0.142972
radius integer Yes Search radius in meters 400
limit integer No Optional maximum number of candidate stops before distance sorting (Default: 3000) 100
lang string No Language code for translated stop/route names (IETF BCP 47 format) en

Wheelchair accessibility

wheelchairBoarding: wheelchairBoarding describes a stop.

Value Meaning
field absent Unknown (GTFS value 0).
1 Accessible.
2 Not accessible.

Try It Out

Required parameters only

curl -H "capi-key: Bearer YOUR_API_KEY" \
     -H "capi-host: busmaps.com" \
     "https://capi.busmaps.com:8443/compact/v1/stopsInRadius?location=51.539258,-0.142972&radius=400"

Common usage with optional parameters

curl -H "capi-key: Bearer YOUR_API_KEY" \
     -H "capi-host: busmaps.com" \
     "https://capi.busmaps.com:8443/compact/v1/stopsInRadius?location=51.539258,-0.142972&radius=400&limit=100"

Popular parameters

curl -H "capi-key: Bearer YOUR_API_KEY" \
     -H "capi-host: busmaps.com" \
     "https://capi.busmaps.com:8443/compact/v1/stopsInRadius?location=51.539258,-0.142972&radius=400&limit=100&lang=en"

Response Example

{
    "regionName": "uk_ireland",
    "routeFields": [
        "routeId",
        "countryIso",
        "line",
        "mode"
    ],
    "routes": [
        [
            "3173742969-2726050097",
            "GBR",
            "Northern",
            "subway"
        ],
        [
            "3565009689-2914759404",
            "GBR",
            "274",
            "bus"
        ],
        [
            "3844823529-791433801",
            "GBR",
            "88",
            "bus"
        ],
        [
            "3640576068-3262563337",
            "GBR",
            "134",
            "bus"
        ],
        [
            "991798478-4207167598",
            "GBR",
            "214",
            "bus"
        ],
        [
            "2229394747-887181106",
            "GBR",
            "N20",
            "bus"
        ],
        [
            "2413739300-3746968418",
            "GBR",
            "1",
            "bus"
        ],
        [
            "998520239-1621359431",
            "GBR",
            "24",
            "bus"
        ],
        [
            "3874723842-767720165",
            "GBR",
            "27",
            "bus"
        ],
        [
            "1027128312-612496406",
            "GBR",
            "31",
            "bus"
        ],
        [
            "306911036-390623978",
            "GBR",
            "N27",
            "bus"
        ],
        [
            "3822330147-1660613983",
            "GBR",
            "N28",
            "bus"
        ],
        [
            "648198988-2314007172",
            "GBR",
            "N31",
            "bus"
        ],
        [
            "2834791456-1653979818",
            "GBR",
            "N5",
            "bus"
        ],
        [
            "656716379-1251475361",
            "GBR",
            "29",
            "bus"
        ],
        [
            "95850258-4056063685",
            "GBR",
            "N253",
            "bus"
        ],
        [
            "3941329450-1891682798",
            "GBR",
            "N279",
            "bus"
        ],
        [
            "650442947-1984920687",
            "GBR",
            "N29",
            "bus"
        ],
        [
            "1608615088-1727388828",
            "GBR",
            "253",
            "bus"
        ],
        [
            "574288618-2198300056",
            "GBR",
            "46",
            "bus"
        ]
    ],
    "stopFields": [
        "stopId",
        "countryIso",
        "name",
        "mode",
        "lat",
        "lon",
        "code",
        "description",
        "wheelchairBoarding",
        "distanceMeters",
        "routeRefs",
        "transit_icon"
    ],
    "stops": [
        [
            "12749834648374944315",
            "GBR",
            "Camden Town Underground Station",
            "subway",
            51.539258,
            -0.142972,
            null,
            null,
            2,
            0,
            [
                0
            ],
            null
        ],
        [
            "10276177494248870102",
            "GBR",
            "Camden Town Underground Station",
            "subway",
            51.539194,
            -0.142888,
            null,
            null,
            2,
            9,
            [
                0
            ],
            null
        ],
        [
            "17917404820047035856",
            "GBR",
            "Camden Town Underground Station",
            "subway",
            51.539295,
            -0.142465,
            null,
            null,
            2,
            35,
            [
                0
            ],
            null
        ],
        [
            "10222722856752225669",
            "GBR",
            "Camden Town Underground Station",
            "subway",
            51.539349,
            -0.142478,
            null,
            null,
            2,
            36,
            [
                0
            ],
            null
        ],
        [
            "11974292288902583902",
            "GBR",
            "Camden High Street Camden Town",
            "bus",
            51.538744,
            -0.143454,
            "74369",
            "Stop CX",
            null,
            66,
            [
                1,
                2
            ],
            null
        ],
        [
            "806794109445716952",
            "GBR",
            "Kentish Town Road Camden Town",
            "bus",
            51.539948,
            -0.142251,
            "48681",
            "Stop L",
            null,
            92,
            [
                3,
                4,
                2,
                5
            ],
            null
        ],
        [
            "4228658847846611542",
            "GBR",
            "Camden Town Station",
            "bus",
            51.53843,
            -0.142342,
            "74888",
            "Stop X",
            null,
            102,
            [
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13
            ],
            null
        ],
        [
            "1626760138692631694",
            "GBR",
            "Camden Town Station",
            "bus",
            51.539216,
            -0.141445,
            "74831",
            "Stop Z1",
            null,
            106,
            [
                9,
                11,
                12
            ],
            null
        ],
        [
            "9770583287182576542",
            "GBR",
            "Camden Town Station",
            "bus",
            51.539799,
            -0.141349,
            "55724",
            "Stop S",
            null,
            127,
            [
                3,
                7,
                8,
                14,
                5,
                15,
                10,
                16,
                17,
                13
            ],
            null
        ],
        [
            "1544298330863233878",
            "GBR",
            "Camden Town Station / Bayham Street",
            "bus",
            51.538668,
            -0.140919,
            "47843",
            "Stop T",
            null,
            156,
            [
                6,
                4,
                18,
                1,
                2
            ],
            null
        ],
        [
            "8187525786594117823",
            "GBR",
            "Camden Town Station",
            "bus",
            51.537938,
            -0.141929,
            "74199",
            "Stop Y",
            null,
            164,
            [
                3,
                4,
                14,
                5,
                15,
                16,
                17
            ],
            null
        ],
        [
            "3702590244124351976",
            "GBR",
            "Camden Town Station / Camden Street",
            "bus",
            51.540003,
            -0.140634,
            "73580",
            "Stop R",
            null,
            182,
            [
                6,
                4,
                18,
                1,
                2
            ],
            null
        ],
        [
            "15662611411904534745",
            "GBR",
            "Bayham Street",
            "bus",
            51.538184,
            -0.140477,
            "76202",
            "Stop U",
            null,
            210,
            [
                9,
                11,
                12
            ],
            null
        ],
        [
            "18349897238089857359",
            "GBR",
            "Camden Town / Camden Road",
            "bus",
            51.540369,
            -0.140417,
            "71115",
            "Stop N",
            null,
            216,
            [
                18,
                1,
                14,
                15,
                16,
                17
            ],
            null
        ],
        [
            "18028702421017154993",
            "GBR",
            "Parkway",
            "bus",
            51.537534,
            -0.145392,
            "75875",
            "Stop CW",
            null,
            254,
            [
                1,
                2
            ],
            null
        ],
        [
            "7099218597593740742",
            "GBR",
            "Pratt Street",
            "bus",
            51.537174,
            -0.140836,
            "71814",
            "Stop CS",
            null,
            275,
            [
                1,
                2
            ],
            null
        ],
        [
            "1935855700261159746",
            "GBR",
            "Arlington Road (NW1)",
            "bus",
            51.536654,
            -0.142659,
            "51242",
            "Stop CT",
            null,
            290,
            [
                1,
                2
            ],
            null
        ],
        [
            "7921808350385612696",
            "GBR",
            "Pratt Street",
            "bus",
            51.539071,
            -0.138567,
            "74630",
            "Stop J",
            null,
            305,
            [
                19
            ],
            null
        ]
    ],
    "imperial": true
}

Response Schema

View JSON Schema
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Compact Stops In Radius Response",
    "type": "object",
    "properties": {
        "regionName": {
            "type": "string",
            "description": "Transit data region that served the request"
        },
        "imperial": {
            "type": "boolean",
            "description": "Optional flag, present as true for US/UK; numeric distance fields remain in meters"
        },
        "routeFields": {
            "type": "array",
            "items": [
                {
                    "const": "routeId"
                },
                {
                    "const": "countryIso"
                },
                {
                    "const": "line"
                },
                {
                    "const": "mode"
                }
            ],
            "additionalItems": false,
            "minItems": 4,
            "maxItems": 4,
            "description": "Column order for routes rows"
        },
        "routes": {
            "type": "array",
            "items": {
                "type": "array",
                "items": [
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Route identifier for /line and departure matching"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "ISO 3166-1 alpha-3 country code"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Public-facing route name"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Transport type (bus, subway, train, tram, ...)"
                    }
                ],
                "additionalItems": false,
                "minItems": 4,
                "maxItems": 4
            },
            "description": "Globally deduplicated routes serving the returned stops"
        },
        "stopFields": {
            "type": "array",
            "items": [
                {
                    "const": "stopId"
                },
                {
                    "const": "countryIso"
                },
                {
                    "const": "name"
                },
                {
                    "const": "mode"
                },
                {
                    "const": "lat"
                },
                {
                    "const": "lon"
                },
                {
                    "const": "code"
                },
                {
                    "const": "description"
                },
                {
                    "const": "wheelchairBoarding"
                },
                {
                    "const": "distanceMeters"
                },
                {
                    "const": "routeRefs"
                },
                {
                    "const": "transit_icon"
                }
            ],
            "additionalItems": false,
            "minItems": 12,
            "maxItems": 12,
            "description": "Column order for stops rows"
        },
        "stops": {
            "type": "array",
            "items": {
                "type": "array",
                "items": [
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Stop identifier for an exact departure request"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "ISO 3166-1 alpha-3 country code"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Stop name"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Stop transport type"
                    },
                    {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Latitude in decimal degrees"
                    },
                    {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Longitude in decimal degrees"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Public stop code"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Additional stop description"
                    },
                    {
                        "enum": [
                            1,
                            2,
                            null
                        ],
                        "description": "Wheelchair accessibility of the stop"
                    },
                    {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Calculated distance from the requested point in meters"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "description": "Indexes into routes"
                    },
                    {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Opaque stop icon identifier passed through unchanged, for example tube, ubahn, sbahn or nyc-subway. Other values are allowed; absent when the source has no icon."
                    }
                ],
                "additionalItems": false,
                "minItems": 12,
                "maxItems": 12
            },
            "description": "All candidate stops sorted by calculated distance from the requested point"
        },
        "message": {
            "type": "string",
            "description": "Human-readable empty-result message"
        }
    },
    "required": [
        "regionName",
        "routeFields",
        "routes",
        "stopFields",
        "stops"
    ]
}

Response Codes

200 Compact nearby stops retrieved successfully
400 Invalid location or radius
500 Internal server error