S2 Cells
¶ Overview
Traffic & Incidents requests select an area using a single S2 cell. Pass the cell as a hexadecimal token produced by an S2 library, not as a raw decimal cell ID.
¶ Required S2 level per endpoint
Each endpoint accepts exactly one S2 level. A token at any other level, or a malformed token, returns HTTP 400.
| API | S2 level |
|---|---|
| Current Traffic | 13 |
| Traffic Snapshot | 13 |
| Active Incidents | 7 |
Reusing a level-13 token from a Traffic request in an Incidents request returns HTTP 400. If starting from a level-13 cell, use an S2 library to obtain its level-7 parent.
¶ Covering larger areas
Each request accepts one cell. For a larger area, compute an S2 covering at the endpoint’s level and request each cell while respecting rate limits.