Skip to content

Tile colors

The Tiles API supports ten color palettes for precipitation tiles. Set the color query parameter to a value from 0 to 9; the default is 0 — Rainbow.

Keep your API key on the server

We do not recommend putting API keys in frontend code: browser code and network requests are visible to users. Make the authenticated requests below on your server. For a web map, use the backend proxy in the Leaflet or MapLibre example.

Compare the palettes

Examples of the available color palettes.

To see a palette on a map, run the Leaflet example or MapLibre globe.

Color palettes and legends

Color Name Rain Snow Description
0 Rainbow Example Example Default rainbow-style palette
1 TWC Example Example Inspired by The Weather Channel
2 Dark Sky Example Example Based on RainViewer’s Dark Sky color scheme
3 Meteored Example Example Based on RainViewer’s Meteored palette
4 Nexrad Example Example NEXRAD Level III style from RainViewer
5 Rainviewer Example Example Rainviewer color palette
6 Selex Example Example Rainbow @ SELEX-IS palette from RainViewer
7 Titan Example Example TITAN color scheme from RainViewer
8 Rainviewer Universal Blue Example Example RainViewer’s Original palette
9 Rainviewer TWC Example Example RainViewer’s The Weather Channel (TWC) palette

Usage

Obtain a current snapshot for the layer you want to use, then pass the palette number in color. See Getting Started for authentication and the snapshot request.

HTTP
GET https://api.rainbow.ai/tiles/v1/precip-global/{snapshot}/0/5/9/13?color=3
Ocp-Apim-Subscription-Key: YOUR_API_KEY

Raw dBZ values

The Tiles API also provides access to tiles that encode raw dBZ reflectivity values - dbz_u8. It is following the Black and White dBZ Values scheme from RainViewer.

Usage

To use it pass the dbz_u8 value to the color query parameter in the tile request.

HTTP
GET https://api.rainbow.ai/tiles/v1/precip-global/{snapshot}/0/5/9/13?color=dbz_u8
Ocp-Apim-Subscription-Key: YOUR_API_KEY

Key Details

  • Values range from -32 dBZ to +95 dBZ

  • Each pixel's red color channel encodes the reflectivity value

  • Snow masking is applied via the highest bit of the red channel

Value Extraction Logic

To decode a pixel's dBZ value: 1. Let R be the red component of the pixel. 2. If R & 128 == 128, the pixel represents snow. 3. The dBZ value is computed as: dbz = (R & 127) - 32 4. If the pixel is fully transparent (alpha = 0), there is no radar coverage.

Example

Text Only
Let R = 175

175 & 128 = 128 → snow pixel
175 & 127 = 47
47 - 32 = 15 dBZ

This means: snow with 15 dBZ reflectivity