Skip to content

Developers · Data layer

Build with codriver. Open by default.

Community alerts, chargers and cameras on the map are available through an unauthenticated read endpoint. Providers can register push or pull feeds for review. This page introduces the current API; the external developer center holds the full contract.

Read · No account needed

GET /v2/entities/nearby

Query a point and radius to receive community alerts, chargers, cameras and eligible feed entities as JSON. No API key or session is needed. The route permits 60 requests per minute for guests and 120 for signed-in accounts.

curl 'https://app.codriver.io/v2/entities/nearby?lat=45.4699&lng=-73.5461&radius=3000'
# Example response:
# {
#   "entities": [
#     { "id": "...", "kind_id": "alert.police",
#       "geom": { "type": "Point", "coordinates": [-73.54, 45.46] }, ... },
#     { "id": "...", "kind_id": "charger.supercharger", ... }
#   ],
#   "sources": [ { "id": "chargers", "status": "online", ... } ]
# }

Use sources[] to narrow the response to one source; discover available IDs at /v2/sources. Cross-origin browser requests are not enabled, so call this endpoint from a server or script. Full parameter reference: developer.codriver.io (English).

Write · Your feeds, your layer

POST /v2/feeds

Register a feed once, then push entities when you have updates or let codriver pull an HTTPS URL you control. A feed maps to a layer you own. Registration requires a codriver session; a push token is returned only at creation or rotation.

Push feed

# 1. Register a feed after signing in at codriver.io:
curl -X POST 'https://app.codriver.io/v2/feeds' \
  -H 'Content-Type: application/json' \
  --cookie /tmp/cookies.txt \
  -d '{ "name": "My Traffic Feed", "direction": "push", "visibility": "private" }'
# → { "feed": { ... }, "push_ingest_token": "cdrf_..." }
# Store this token now; it is shown once.

# 2. Push entities whenever you have updates:
TOKEN="cdrf_..."
curl -X POST "https://app.codriver.io/v2/feeds/$TOKEN/entities" \
  -H 'Content-Type: application/json' \
  -d '[
    { "external_id": "incident-2026-05-22-001",
      "kind": "alert.road_closed",
      "lat": 45.5017, "lng": -73.5673,
      "properties": { "street": "René-Lévesque", "reason": "downed line" },
      "ttl_seconds": 3600 }
  ]'
# → { "accepted": 1, "rejected": 0, "errors": [] }

Pull feed

curl -X POST 'https://app.codriver.io/v2/feeds' \
  -H 'Content-Type: application/json' \
  --cookie /tmp/cookies.txt \
  -d '{
    "name":                  "MyCity 311 Feed",
    "direction":             "pull",
    "pull_url":              "https://api.mycity.example/311.json",
    "pull_auth_header":      "X-API-Key: your-key-here",
    "pull_interval_seconds": 300
  }'

The accepted pull interval is 30–3600 seconds; values outside that range are rejected. After 20 consecutive failures, the feed is disabled. Backoff doubles after each failure, up to one hour. Re-enable it with PATCH after fixing the cause. The URL must use HTTPS and a public hostname.

Kinds · Catalog

19 kinds in the committed catalog.

Each submitted kind must be in the catalog. The current seed includes:

  • Alerts: alert.police, alert.accident, alert.road_closed, alert.construction, alert.hazard, alert.hazard.car_stopped, alert.hazard.object_on_road, alert.hazard.pothole, alert.hazard.animal, alert.hazard.fog, alert.hazard.ice, alert.hazard.flooding
  • Cameras: camera.speed, camera.red_light, camera.avg_speed, camera.alpr
  • Chargers: charger.supercharger, charger.destination
  • Traffic: traffic.jam

A row with an unknown kind is rejected at ingestion; other valid rows in the batch can still be accepted. The external reference currently lists 18 and omits camera.alpr; the committed seed adds that nineteenth kind. For a new kind, contact support@codriver.io.

Stability · v1 contract

The published contract.

  • The published v1 contract promises a 90-day email deprecation window before breaking changes to external_id, kind, lat, lng, properties, ttl_seconds or observed_at.
  • Additive fields and new kinds are treated as non-breaking changes.
  • Existing kind IDs are not renamed under that published contract.
  • Entity and feed records are hosted in Helsinki. The optional Car route telemetry path has a Montreal first hop; see Privacy for that exception. Privacy →

Full spec and contact

Go deeper.

The canonical reference is at developer.codriver.io (English). It covers kinds, error codes, integration patterns and the stability policy in more detail. The engineering pointer in the driving-app repo is docs/EXTERNAL-FEEDS.md.

For feed-spec questions, layer review or bugs, email support@codriver.io.

FAQ

Questions integrators ask.

Do I need an account to read?+
No. GET /v2/entities/nearby permits 60 requests/minute for guests and 120 for signed-in accounts. It is intended for server-side calls or scripts; cross-origin browser access is not enabled.
How do I send my own data?+
Create a feed with POST /v2/feeds while signed in. Pull feeds supply an HTTPS URL returning a JSON array; push feeds use the one-time push_ingest_token to POST entity arrays. Registration enters curator review for inclusion in the public source catalog.
Is my feed visible to other users?+
The API accepts a visibility choice, and curator approval controls inclusion in the public source catalog. The nearby read API checks layer visibility and feed approval, public status and activity. A private or unapproved feed is excluded from guest reads; a public approved feed on a public layer can be returned. A review email is attempted when a decision is made; its delivery and timing are not guaranteed.
Which kinds can I submit?+
Use a kind in the current entity_kind catalog. The committed seed includes 19 IDs, including camera.alpr, while the external reference still lists 18. Unknown kinds are rejected per row; valid rows can still be accepted.
What stability policy applies?+
The published v1 contract promises a 90-day email deprecation window for breaking changes to its core fields and treats additive fields and new kinds as non-breaking. Check the external developer reference for the current contract.
Where does the data live?+
Entity and feed records are hosted in Helsinki, Finland. The optional Car route feature has a Montreal telemetry first hop, as described in the Privacy page.

← Back to community alerts