← Traffic Docs|API Reference
Home

Traffic Images API Reference

Complete endpoint documentation and usage examples for the LTA Traffic Images API.

Authentication

All requests require an API key to be sent in the request header:

x-api-key: YOUR_API_KEY
GET/api/lta/traffic-images

Get all available traffic camera images

Description

Returns all available traffic camera images from LTA with coordinates, camera IDs, and image URLs. Includes 100+ active cameras across Singapore.

Parameters

None - no query parameters

Headers

x-api-keyYour API key (required)

Response (200 OK)

{
  "code": 0,
  "data": {
    "odata": {
      "context": "https://datamall.lta.gov.sg/api/v1/$metadata#Traffic-Imagesv2",
      "count": 106
    },
    "value": [
      {
        "ImageLink": "https://example.com/image.jpg",
        "Latitude": 1.3521,
        "Longitude": 103.8198,
        "CameraID": "C0001",
        "Timestamp": "2026-07-17T10:30:00+08:00"
      },
      {
        "ImageLink": "https://example.com/image2.jpg",
        "Latitude": 1.3585,
        "Longitude": 103.8320,
        "CameraID": "C0002",
        "Timestamp": "2026-07-17T10:30:00+08:00"
      }
    ]
  },
  "timestamp": "2026-07-17T10:30:00.000Z"
}

Response Schema

code (number)

Status code (0 = success)

data (object)

Contains OData metadata and camera array

data.value (array)

Array of traffic camera objects

ImageLink (string)

Direct URL to camera image

Latitude (number)

Camera latitude coordinate

Longitude (number)

Camera longitude coordinate

CameraID (string)

Unique camera identifier

Timestamp (string)

ISO 8601 timestamp when image was captured

Example Request

curl -H "x-api-key: YOUR_API_KEY" \
  https://api.mydigistudio.com/api/lta/traffic-images

Code Examples

JavaScript / TypeScript

const response = await fetch(
  'https://api.mydigistudio.com/api/lta/traffic-images',
  {
    method: 'GET',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  }
);

const data = await response.json();
console.log(data.data.value); // Array of traffic cameras

Python

import requests

headers = {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}

response = requests.get(
    'https://api.mydigistudio.com/api/lta/traffic-images',
    headers=headers
)

data = response.json()
cameras = data['data']['value']
for camera in cameras:
    print(f"Camera {camera['CameraID']}: {camera['ImageLink']}")

Error Responses

401

Unauthorized

{
  "code": 401,
  "error": "Authentication failed - invalid API key",
  "message": "Failed to fetch traffic images"
}
500

Server Error

{
  "code": 500,
  "error": "LTA API server error",
  "message": "Failed to fetch traffic images"
}

Caching & Rate Limiting

Cache Strategy

Cache Duration: 5 minutes (300 seconds)

Stale While Revalidate: Up to 1 hour

Responses include cache control headers for optimal performance

Rate Limiting

Max Requests: 60 per minute

Rate limit information is included in response headers

Contact support for higher rate limits

© 2026 DataHub SG. Traffic data sourced from Land Transport Authority (LTA) DataMall.