https://github.com/vittodevit/fibercop-data-api
Unofficial mirror API for FiberCop's latest CRO/CNO data. Provides endpoints to access raw data, download CSV, get compact lists for map display, retrieve detailed records by ID, and view dataset statistics.
https://github.com/vittodevit/fibercop-data-api
csv docker fastapi python
Last synced: 9 days ago
JSON representation
Unofficial mirror API for FiberCop's latest CRO/CNO data. Provides endpoints to access raw data, download CSV, get compact lists for map display, retrieve detailed records by ID, and view dataset statistics.
- Host: GitHub
- URL: https://github.com/vittodevit/fibercop-data-api
- Owner: vittodevit
- Created: 2026-02-16T02:23:04.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-02-16T16:57:57.000Z (about 2 months ago)
- Last Synced: 2026-02-17T00:18:36.595Z (about 2 months ago)
- Topics: csv, docker, fastapi, python
- Language: Python
- Homepage: https://fbdapi.vitto.dev/
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FiberCop Data API
Unofficial mirror API for FiberCop's latest CRO/CNO data. Provides endpoints to access raw data, download CSV, get compact lists for map display, retrieve detailed records by ID, and view dataset statistics.
*Public API at*: https://fbdapi.vitto.dev/
*Documentation*: https://fbdapi.vitto.dev/docs
## Some technical info
**Stack**: FastAPI + Uvicorn (async Python), Docker
**Architecture**:
- **fetcher.py**: Daily scheduled job (APScheduler) downloads FiberCop's ZIP, extracts CSV with 90k+ CRO/CNO records
- **cache.py**: Thread-safe singleton cache with pre-computed views (listmap for maps, details dict for O(1) ID lookups, stats aggregations)
- **main.py**: FastAPI with 7 endpoints - `/raw`, `/list` (objects), `/listmap` (arrays for map perf), `/download` (CSV), `/details/{id}`, `/stats`, `/health`
**Some optimizations**:
- Integer-based IDs (not UUIDs or already existing fields) for faster lookup
- Array-of-arrays format `[[id,lat,lon,type],...]` minimizes JSON payload
- ETag + 24h cache headers on all responses
- Disk-persisted CSV survives container restart