Documentation menu

Documentation / Weather data and map layers

Weather data and map layers

Read forecasts and source files, or display reviewed weather products as real map cells, observation points and alert geometry.

On this page

Read a forecast, then discover the source data you need

Use the same subscription key as the rest of the Mapsource API. The native NWS forecast endpoint accepts a supported U.S. latitude and longitude; its GeoJSON retains NWS forecast periods, times, units and descriptions. Active alerts accept an area code or named point, and a successful response may contain no active alerts.

For global model data, start with the live weather catalog. Select an enabled dataset, discover its current run and exact asset key, inspect its field index, then retrieve the native object or a bounded byte range. Product coverage, forecast steps, levels and publication times vary; the inventory of the selected source object is the authority on what exists. A source family listed for review is not an enabled dataset.

For a map, use /api/weather/visualizations to discover independently approved derived products, then the selected source’s visualization-assets and visualization-fields operations. Pin the returned ETag and submit an asynchronous visualization. The viewer at /solutions/weather lets you choose the source, field, native time and level, palette, value range and opacity. /docs/maplibre shows how to add the same result to your map.

# Public discovery: no API key required.
curl --fail-with-body https://api.mapsource.io/weather/catalog
curl --fail-with-body https://api.mapsource.io/environment/sources

# Complete native aurora JSON, with the source's published grid and times.
curl --fail-with-body \
  https://api.mapsource.io/environment/sources/noaa-ovation-aurora/snapshot \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY" --output aurora.json

# Complete native satellite detections; CSV rows are not fire perimeters.
curl --fail-with-body \
  https://api.mapsource.io/environment/sources/nasa-firms-viirs-noaa20/snapshot \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY" --output fire-detections.csv

# Native U.S. forecast periods.
curl --fail-with-body \
  'https://api.mapsource.io/weather/forecast?provider=nws&lat=40.7128&lon=-74.0060' \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY"

# An empty features array means no active alerts matched this point.
curl --fail-with-body \
  'https://api.mapsource.io/weather/alerts?point=40.7128,-74.0060' \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY"

# Copy an enabled source ID and an exact key from live discovery.
curl --fail-with-body \
  "https://api.mapsource.io/weather/sources/noaa-gfs/assets" \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY"
OBJECT_KEY='replace-with-an-exact-key-from-the-assets-response'

curl --fail-with-body --get \
  "https://api.mapsource.io/weather/sources/noaa-gfs/asset-metadata" \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY" --data-urlencode "objectKey=$OBJECT_KEY"

# A one-MiB native byte range; keep its Content-Range and ETag.
curl --fail-with-body --get \
  "https://api.mapsource.io/weather/sources/noaa-gfs/asset" \
  -H "Authorization: Bearer $MAPSOURCE_API_KEY" -H 'Range: bytes=0-1048575' \
  --data-urlencode "objectKey=$OBJECT_KEY" --dump-header weather.headers \
  --output weather.part

# A derived point-forecast map. Keep the same payload and nonce on a retry.
FIELDS=$(curl --fail-with-body 'https://api.mapsource.io/weather/sources/noaa-nws-forecast/visualization-fields?lat=40.7128&lon=-74.0060' -H "Authorization: Bearer $MAPSOURCE_API_KEY")
ETAG=$(printf '%s' "$FIELDS" | jq -r .etag)
NONCE=$(uuidgen)
JOB=$(curl --fail-with-body https://api.mapsource.io/weather/sources/noaa-nws-forecast/visualizations -H "Authorization: Bearer $MAPSOURCE_API_KEY" -H "If-Match: $ETAG" -H "Idempotency-Key: $NONCE" -H 'Content-Type: application/json' --data '{"lat":40.7128,"lon":-74.0060,"maxPoints":512}')

# Poll statusUrl with the same key, at least 3 seconds apart.
# When state is ready, GET resultUrl for GeoJSON and provenance.
printf '%s' "$JOB" | jq '{state,statusUrl,resultUrl,expiresAt}' 

Endpoints and parameters

Select an endpoint for its full parameter and response reference.

OperationEndpoint
Read the weather service catalog and delivery capabilitiesGET /api/environment/catalog
List source families and their concrete redistribution approvalsGET /api/environment/sources
Inspect a source family's eligibility and approved productsGET /api/environment/sources/{sourceId}
Read a complete native aurora or satellite fire snapshotGET /api/environment/sources/{sourceId}/snapshot
Read the reference variable dictionary without assuming model availabilityGET /api/environment/variables
Read measured per-source weather availability and observation agesGET /api/environment/status
Read native weather products, formats, rights and transfer limitsGET /api/weather/catalog
List forecast and analysis model productsGET /api/weather/models
Inspect a native weather model productGET /api/weather/models/{modelId}
Discover native source run directories for a dateGET /api/weather/models/{modelId}/runs
List source prefixes and assets within a discovered runGET /api/weather/models/{modelId}/runs/{runId}
Read actual native GRIB message index fields and byte rangesGET /api/weather/models/{modelId}/runs/{runId}/inventory
Discover native objects under an approved product prefixGET /api/weather/sources/{sourceId}/assets
Validate native asset format and pin its source versionGET /api/weather/sources/{sourceId}/asset-metadata
Download byte-identical native weather dataGET /api/weather/sources/{sourceId}/asset
Read the native NWS forecast for a supported U.S. pointGET /api/weather/forecast
Read native active NWS alerts for an area or pointGET /api/weather/alerts

Application integration

Choose an enabled concrete dataset from the live catalog. Its rights decision applies to that product, version and public access tier. The broader source-family catalog can include conditional, review and blocked records; presence in that catalog does not enable delivery.

List actual model runs, select a returned runId and inspect its assets and field inventory. Pass the returned asset key as the objectKey request parameter for inventory, asset metadata and downloads; response metadata retains its key field. Do not construct a recent filename and assume it exists, mix initialization times, or treat the first page of a historical bucket listing as the newest run. Follow returned continuation cursors rather than recursively crawling an upstream root.

Use native .idx/.index entries to select complete GRIB messages. Parameter names, levels, forecast steps, grids and units are source-specific; the canonical variable vocabulary is a lookup aid, not a promise that every dataset contains every variable. This service passes through original data rather than synthesizing sampled columns or atmospheric volumes.

For NWS forecasts, send named lat/lon coordinates and preserve the returned GeoJSON properties.periods. The provider resolves supported U.S. grid points. For alerts use an area or point filter. Empty features is a valid successful alert response; provider timeouts or out-of-coverage responses are not zero-valued weather observations.

Use the snapshot operation only for an enabled source that publishes a reviewed current JSON or CSV snapshot. It returns the complete native document, not a normalized Mapsource feature collection. OVATION includes its own observation time, forecast time and longitude/latitude/probability grid. FIRMS CSV preserves each detection's acquisition time, sensor and radiative-power fields.

For downloads, inspect asset-metadata or HEAD first. Pin the Mapsource ETag using If-Match and check each 206 Content-Range and body length. Mapsource validates the pin, returned source version and range before delivering bytes, including when a provider ignores conditional request headers. A 200 response to an explicit range is not a safe substitute for the requested bytes. Retain source attribution beside any downloaded object or transformed output.

This backend example retrieves one bounded range, pins the source version, and retains the rights metadata. Select start and end from the actual field inventory when you need a complete GRIB message.

async function fetchWeatherRange(sourceId, objectKey, start, end) {
  // Run on your backend; do not put a private API key in public JavaScript.
  const headers = { Authorization: "Bearer " + process.env.MAPSOURCE_API_KEY };
  if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) ||
      start < 0 || end < start || end - start + 1 > 1024 * 1024) {
    throw new Error("Choose a valid range of at most one MiB for this example");
  }
  const base = "https://api.mapsource.io/weather/sources/" +
    encodeURIComponent(sourceId);
  const metadataUrl = new URL(base + "/asset-metadata");
  metadataUrl.searchParams.set("objectKey", objectKey);
  const description = await fetch(metadataUrl, {
    headers, signal: AbortSignal.timeout(30_000)
  });
  if (!description.ok) {
    await description.body?.cancel();
    throw new Error("Asset description: " + description.status);
  }
  const metadata = await description.json();
  if (!metadata.etag || end >= metadata.bytes) {
    throw new Error("A source version and valid byte bounds are required");
  }
  const assetUrl = new URL(base + "/asset");
  assetUrl.searchParams.set("objectKey", objectKey);
  const response = await fetch(assetUrl, {
    headers: { ...headers, Range: "bytes=" + start + "-" + end,
      "If-Match": metadata.etag },
    signal: AbortSignal.timeout(30_000)
  });
  if (response.status !== 206) {
    await response.body?.cancel();
    throw new Error(response.status === 412 ? "Source changed; rediscover it" :
      "Expected the requested range");
  }
  const expectedRange = "bytes " + start + "-" + end + "/" + metadata.bytes;
  if (response.headers.get("Content-Range") !== expectedRange ||
      response.headers.get("ETag") !== metadata.etag) {
    await response.body?.cancel();
    throw new Error("Source version or range does not match");
  }
  const bytes = new Uint8Array(await response.arrayBuffer());
  if (bytes.byteLength !== end - start + 1) throw new Error("Incomplete range");
  return { bytes, rights: metadata.rights, provenance: metadata.provenance };
}

For a complete download, request successive permitted ranges against the same ETag and stream them into your destination. Keep partial output separate until all expected bytes arrive. Re-fetch metadata after a version conflict; never join chunks from different versions.

A provider’s bare version tag may be quoted to form the Mapsource HTTP ETag; the original value remains in provenance.sourceVersion. This changes metadata formatting only. Content-Digest contains SHA-256 of the returned bytes, so a range response describes that range rather than the full file. The Link header carries source and license links; decode X-Mapsource-Weather-Attribution with decodeURIComponent before displaying its text.

Native GRIB, NetCDF, radar and satellite files require a compatible decoder in your application. Preserve the original grid, CRS, missing-value mask and vertical coordinates. Grid-relative wind components need the source grid transform; radar radial velocity is not a full three-dimensional wind vector.

Air, ocean and environmental data

The catalog groups concrete products by environmentalDomains. A product can cover more than one category. These descriptions help you choose a source; use its current enabled state, rights decision and actual inventory to determine what Mapsource can deliver.

CategoryNative data and interpretation
AirAtmospheric model fields such as wind, temperature, moisture and pressure. Levels, forecast lead times, grids and units belong to the selected NOAA, ECMWF or other approved product.
OceanCurrents, waves, sea-surface temperature and ocean analyses. Surface current vectors, wave directions and depth levels are different quantities; keep their conventions and masks.
ChemistryModeled gas concentrations and chemical fields. NASA GEOS products are research output, not calibrated local air-monitor readings; retain each variable’s mass or mixing-ratio units.
ParticulatesAerosol and particulate fields, including source-specific dust, smoke or optical-depth variables. Aerosol optical thickness is not a surface PM concentration or an air-quality index.
SpaceNOAA OVATION’s native aurora occurrence probabilities. Forecast timing comes from the source. Darkness, cloud cover and viewing conditions still affect visibility.
BioSatellite fire detections and ecosystem stress products. FIRMS hotspots are thermal detections, not fire perimeters; reef bleaching alerts describe heat stress, not a direct census of coral mortality.

Some CAMS, Copernicus Marine and Earthdata distributions require provider registration, accepted terms or credentials. A source-family record can document those candidates while delivery stays disabled. Never pass provider credentials in an asset URL, infer permission from a public listing, or mistake a candidate for an included live product.

Earth’s official source list is a useful guide to this broader ecosystem: GFS for weather; ocean models and SST analyses; NASA GEOS and CAMS for chemistry and aerosols; NOAA OVATION for aurora; and FIRMS and Coral Reef Watch for environmental impacts. Mapsource fetches approved provider products directly; Earth’s processed assets, animation and derived fields are separate.

Native files require a suitable GRIB, NetCDF or CSV reader. The API does not claim decoded global wind animation, pressure-to-altitude conversion, interchangeable model grids, historical completeness or every layer offered by another visualization.

Global RTOFS currents are available as native HYCOM .archs.a.tgz archives with matching .archs.b field manifests. Download both from the same source cycle, pin each object’s ETag, and decompress and decode them in your application. The gateway preserves the archive and does not extract it. Regional RTOFS current products use NetCDF; the separate global diagnostic product retains its own field definitions.

Access and limits

Public catalogs and source-rights descriptions are free. Authenticated forecast, alert, live inventory and asset operations use the weather scope, shared subscription quota, and normal rate and concurrency limits. Weather also has a separate organization-level monthly byte allowance; splitting requests across keys does not create another allowance. Its window is UTC calendar month. Unused durable transfer reservations are retained after an authority change or restart; at most 64 MiB of unused credit per active account is retained conservatively. x402 query payments do not grant weather access.

A single raw object response or explicit byte range is limited to 16 MiB. Larger objects require bounded Range requests. Send Accept-Encoding: identity when checking native lengths, strong ETags or byte digests through the CDN. HEAD exposes the full source Content-Length without downloading its body. Read the current limits from the catalog and use If-Match with the returned Mapsource ETag when resuming a download. Mapsource enforces version and range checks before delivering bytes; upstream conditional-request support is not assumed. Quota and byte-limit rejections do not authorize a retry loop; respect Retry-After when supplied.

Object keys and prefixes must come from the selected product's discovery responses. Send an asset's returned key as the objectKey parameter on inventory, asset-metadata and asset requests; metadata retains its key field. API credentials belong in the Authorization header. Arbitrary upstream URLs, path traversal and multipart byte ranges are rejected. Returned source URLs are provenance, not a way to bypass product eligibility. Authenticated responses are private and must not be turned into a public CDN cache.

Derived metadata uses one quota unit per successful inspection. A newly accepted job costs one unit, including a job that later fails. Identical retries with the same Idempotency-Key reuse that charge; changed input returns 409. Status and result reads use no quota units and remain available after request-budget exhaustion, while ordinary HTTP rate/concurrency limits still apply. Delivered result bytes use the separate weather allowance. Jobs use one bounded CPU worker, a four-job queue and one active job per organization. Results contain at most 8,192 real features and 4 MiB. Tokens expire after 20 minutes; receipt idempotency lasts 24 hours. Retain tokens across handoffs; respect Retry-After. New selections require new nonces.

See plan limits for request allowances and error handling for quota and retry behavior.

Responses and examples

Forecasts and alerts retain their native GeoJSON shape. Snapshot responses retain the provider’s JSON document or CSV header and rows, with observation, forecast or acquisition times preserved. Original weather files retain their source bytes, format and native units; binary responses are not wrapped in a Mapsource JSON object. A byte range may begin inside a GRIB message and is not necessarily a complete decodable field. Use the actual .idx or .index boundaries when you need complete messages.

Asset metadata includes sourceId, key, bytes, etag, lastModified, contentType, nativeFormat, rights and provenance. The HTTP ETag may quote a bare provider tag; provenance.sourceVersion preserves the original provider value, and native bytes remain unchanged. Content-Digest describes the actual returned bytes, which are only the selected range on HTTP 206. Native forecast initialization, forecast valid time, observation time, publication time and retrieval time are distinct. Missing times, CRS or vertical metadata remain unknown. Read pressure/model levels from the source inventory; pressure is not a measured altitude.

SOURCE_LICENSE_RESTRICTED (403) means the selected product has no current redistribution permission. Unknown assets return NOT_FOUND. Invalid ranges return a request/range error; source failures use the normal upstream error envelope before streaming begins. After a stream is interrupted, discard incomplete output and resume only against the same ETag. A changed object must be rediscovered, not spliced into an earlier download.

Derived results use mapsource-weather-visualization.v1: a GeoJSON FeatureCollection with actual field units and source times, sampling/missing-value counts, source and companion ETags, attribution and named transformations. Scalar grids use georeferenced cell footprints. Satellite and radar observations use actual sample locations; a forecast marker labels the query location; alerts retain native non-null geometry. A point-density heatmap is a smoothed observation display, not temperature, probability or a new physical measurement. Categorical reef and alert values keep their discrete meanings. Missing values stay missing and valid zero values stay visible. The derived HTTP ETag hashes the returned JSON; source.etag pins the native input. Native byte-range operations remain unchanged.

Example responses and timing measurements · Current service status

Attribution

Retain the source, license link, product/version and attribution from the catalog, asset metadata and response headers. Designated ECMWF open data is CC BY 4.0: credit ECMWF, retain its copyright and license notices, and identify changes you make. NOAA/NWS reuse follows the specific product's terms; do not imply NOAA endorsement or present modified output as an official forecast. Publicly hosted third-party observations, restricted MADIS categories and restricted ECMWF products are not approved merely because a file is reachable.

Source and reference · Mapsource attribution guide

Questions about this guide? .