Logo Lanfrica

skynergroup/south-africa-traffic-api-client

Domain:

mobility

Record type:

software
Creator:
sky
Host:
South Africa Traffic API β€” JavaScript/Node.js client for real-time South African traffic data # 🚦 i-traffic South Africa API Client A comprehensive JavaScript/Node.js client for the South African i-traffic.co.za API. Features modular architecture with CLI tools, web interface, and complete endpoint coverage for real-time traffic data including alerts, cameras, events, message signs, and roadways. ## 🌟 Features - **πŸ—οΈ Modular Architecture**: Clean separation with base client, endpoint modules, CLI interface, and web demo - **πŸ“Š Complete API Coverage**: All 5 i-traffic endpoints (alerts, cameras, events, message signs, roadways) - **πŸ—ΊοΈ Embedded Maps**: Generate iframe embed codes for interactive traffic maps with customizable regions and layers - **πŸ–₯️ CLI Tools**: Full command-line interface for all operations with formatted output - **🌐 Web Interface**: Interactive browser-based demo application with map generation tools - **πŸ”§ Developer Friendly**: TypeScript-ready with comprehensive JSDoc comments - **⚑ Performance Optimized**: Parallel requests, error handling, and timeout management - **πŸ”’ Secure**: Environment-based API key management - **πŸ“± Cross-Platform**: Works in Node.js and modern browsers - **πŸ“š Well Documented**: Complete API reference and usage examples ## πŸš€ Quick Start ### Installation ```bash # Clone the repository git clone github.com cd south-africa-traffic-api-client # Install dependencies npm install # Set up your API key cp .env.example .env # Edit .env and add your i-traffic API key ``` ### Basic Usage ```javascript import { environment } from './config/environment.js'; import { ITrafficClient } from './src/endpoints/index.js'; // Initialize client const client = new ITrafficClient(environment.getClientConfig()); // Get traffic alerts const alerts = await client.alerts.getAll(); console.log(`Found ${alerts.length} traffic alerts`); // Get active cameras const activeCameras = await client.cameras.getActive(); console.log(`Found ${activeCameras.length} active cameras`); / …