# Vehicle Positions

The Vehicle Positions API is a GraphQL service that provides real-time positions and status for public transport vehicles across Norway. It enables fetching and streaming live vehicle data including location, delays, occupancy, and journey information.

[API Reference](/open/api/graphql/vehicle-positions)

## WebSocket Subscriptions

For real-time streaming updates, the API provides GraphQL subscriptions over WebSocket:

**WebSocket URL:** wss://api.entur.io/realtime/v2/vehicles/subscriptions

Subscriptions allow your application to receive continuous updates as vehicle positions change, rather than polling for data.

### Example Subscription

Connect to `wss://api.entur.io/realtime/v2/vehicles/subscriptions` with the `ET-Client-Name` header.

Subscribe to vehicle updates within a geographic bounding box:

```graphql
subscription {
  vehicles(
    boundingBox: {
      minLat: 59.9
      maxLat: 60.0
      minLon: 10.7
      maxLon: 10.8
    }
  ) {
    vehicleId
    location {
      latitude
      longitude
    }
    bearing
    delay
    line {
      publicCode
    }
  }
}
```

## Additional Resources
- [Real-Time Data Overview](/open-data/realtime) - Information about SIRI and GTFS-RT feeds
