# MBTA Real-Time Vehicle Locations

> MBTA Real-Time Vehicle Locations is a paid API for AI agents from api.healthtravel-api.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-29).

Returns real-time positions and status of MBTA vehicles (trains/buses) currently operating on a given route

## Facts

- Endpoint: GET https://api.healthtravel-api.workers.dev/api/travel/mbta-realtime?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mbta-real-time-vehicle-locations-be727d37
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Nca4DctcrTbzLy16IIhhS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mbta-real-time-vehicle-locations-be727d37
```

Example prompt: Where are all the Red Line trains right now? Show me their live positions — give me up to 20 vehicles and whether each one is stopped or in transit.

## When to prefer this

Choose this endpoint when you need live, real-time MBTA vehicle positions for a specific route without requiring API keys or prior registration. It is ideal for transit-aware agents, commuter tools, or dashboards that need up-to-the-minute train and bus locations in the greater Boston area. It sources directly from the official MBTA v3 API and supports pay-per-call via crypto micropayments, making it suitable for lightweight or infrequent queries where a subscription would be wasteful.

## Known failure modes

- Missing or invalid route parameter returns an error — route is required
- Route ID not recognized by MBTA API results in empty vehicle list
- Limit value outside 1–100 range may be rejected or clamped
- MBTA upstream API downtime causes failed or stale response
- Network timeout from the upstream MBTA v3 API
- No vehicles currently active on the requested route returns count of 0

## How this service works

Live MBTA Boston vehicle positions for one route (e.g. Red, Orange, Blue, 1): vehicle label, latitude/longitude, bearing, speed, current status, current stop id and occupancy when reported. Anonymous access is rate limited by MBTA.

## Output

A JSON object containing a count of vehicles, the queried route ID, a source URL, a checkedAt timestamp, and an array of vehicle objects each with: vehicle ID, latitude, longitude, stop ID, bearing, route ID, speed in m/s (if available), occupancy (if available), last updated timestamp, and current status (e.g. IN_TRANSIT_TO or STOPPED_AT).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "route"
     ],
     "properties": {
      "limit": {
       "type": "string",
       "description": "Max vehicles, 1 to 100 (default 20)"
      },
      "route": {
       "type": "string",
       "description": "MBTA route id, letters/digits/hyphens, 1 to 20 characters"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 14,
  "route": "Red",
  "source": "https://api-v3.mbta.com/vehicles",
  "vehicles": [
   {
    "id": "R-548C5C56",
    "lat": 42.28245,
    "lon": -71.06246,
    "label": "1811",
    "stopId": "70094",
    "bearing": 330,
    "routeId": "Red",
    "speedMps": null,
    "occupancy": null,
    "updatedAt": "2026-10-23T05:30:54-04:00",
    "currentStatus": "IN_TRANSIT_TO"
   },
   {
    "id": "R-548C5C36",
    "lat": 42.28458,
    "lon": -71.06377,
    "label": "1948",
    "stopId": "70094",
    "bearing": 330,
    "routeId": "Red",
    "speedMps": null,
    "occupancy": null,
    "updatedAt": "2026-10-23T05:34:01-04:00",
    "currentStatus": "STOPPED_AT"
   }
  ],
  "checkedAt": "2026-10-23T09:36:40.289Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mbta-real-time-vehicle-locations-be727d37/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.healthtravel-api.workers.dev](https://www.zero.xyz/host/api.healthtravel-api.workers.dev/llms.txt)
