DEV Community

Cover image for How to Get Real-Time Traffic Camera Feeds via API
Roman Kotenko
Roman Kotenko

Posted on • Originally published at road511.com

How to Get Real-Time Traffic Camera Feeds via API

No major traffic data provider gives you camera feeds. Not HERE, not TomTom, not Google, not INRIX. They all sell traffic flow from probe data, but live camera images? Nobody aggregates that.

Road511 does. 10,000+ traffic cameras across 40+ US states and Canadian provinces, all accessible through one REST API.

The Problem

Every state DOT publishes camera images, but every one does it differently:

  • Georgia — JSON array with ImageUrl field, refreshes every 30 seconds
  • California — Caltrans CWWP2 SOAP-like API with district iteration
  • Ontario — Transnomis map markers with lazy-loaded detail popups
  • Kentucky — ArcGIS FeatureServer with paginated queries
  • Wyoming — XOR-encrypted protobuf binary files

Want cameras for a cross-state route? You're looking at 5+ separate integrations with different auth, formats, and update schedules.

One API Call

curl "https://api.road511.com/api/v1/features?type=cameras&jurisdiction=CA&limit=20" \
  -H "X-API-Key: your_key"
Enter fullscreen mode Exit fullscreen mode
{
  "data": [
    {
      "id": "ca-cam-d7-101-001",
      "jurisdiction": "CA",
      "feature_type": "cameras",
      "name": "US-101 at Ventura Blvd",
      "latitude": 34.1583,
      "longitude": -118.4686,
      "is_active": true,
      "properties": {
        "image_url": "https://cwwp2.dot.ca.gov/data/d7/cctv/image/us101atventurabl/us101atventurabl.jpg",
        "direction": "Northbound",
        "highway": "US-101"
      }
    }
  ],
  "total": 1847,
  "has_more": true
}
Enter fullscreen mode Exit fullscreen mode

The image_url is a direct link to the camera image. Most refresh every 30-120 seconds. Some cameras also have video_url for live streams.

GeoJSON for Maps

Want to drop every camera in a state directly onto a Leaflet map?

curl "https://api.road511.com/api/v1/features/geojson?type=cameras&jurisdiction=GA" \
  -H "X-API-Key: your_key"
Enter fullscreen mode Exit fullscreen mode

Returns a standard GeoJSON FeatureCollection. Add it to your map layer with zero transformation:

const response = await fetch(
  'https://api.road511.com/api/v1/features/geojson?type=cameras&jurisdiction=GA',
  { headers: { 'X-API-Key': 'your_key' } }
);
const geojson = await response.json();

L.geoJSON(geojson, {
  onEachFeature: (feature, layer) => {
    const { name, image_url } = feature.properties;
    layer.bindPopup(`
      <strong>${name}</strong><br>
      <img src="${image_url}" width="320" loading="lazy">
    `);
  }
}).addTo(map);
Enter fullscreen mode Exit fullscreen mode

Bounding Box Queries

Don't know which states your route crosses? Use a bounding box:

curl "https://api.road511.com/api/v1/features?type=cameras&bbox=-118.5,33.7,-117.8,34.3&limit=50" \
  -H "X-API-Key: your_key"
Enter fullscreen mode Exit fullscreen mode

This returns cameras within the LA metro area regardless of jurisdiction.

Lazy-Loaded Details

Some cameras return compact data in list mode but have richer detail available on demand:

curl "https://api.road511.com/api/v1/features/ab-cam-001/details" \
  -H "X-API-Key: your_key"
Enter fullscreen mode Exit fullscreen mode

The detail endpoint fetches the latest image URL and any additional metadata directly from the upstream source, cached in Redis for performance.

What's Available

State/Province Camera Count Refresh Rate
California ~1,800 1-5 min
Ontario ~800 2-5 min
Georgia ~700 30 sec
Michigan ~780 2-5 min
Texas ~600+ 1-5 min
Pennsylvania ~500+ 2-5 min
And 35+ more...

Use Cases

  • Navigation apps — show live camera views at upcoming interchanges
  • Fleet dispatch — verify conditions before routing a truck
  • Traffic dashboards — wall of cameras for control rooms
  • Weather verification — ground-truth current road conditions
  • ML training — traffic density estimation from camera images

Try It

Top comments (0)