Skip to main content

MGM Radar

A clean, standalone API for Turkey's national radar composite: ingest the MGM image, turn it into calibrated rain data, and serve it to app developers and hobbyists.

Status: launched. Ingest, processing, live serving, access and metering, archive/exports, operations, tests, and deployment assets are in place and running in production. The design and specs live in openspec/changes/archive/2026-11-20-bootstrap-mgm-radar-api/. The independent reference comparison is complete (report), as are the two-week soak (report) and the paid-listing decision (record); remaining follow-ups are tracked in the validation plan.

What it does

flowchart LR
    SRC["MGM compmax1..15<br/>(10-min JPEG)"]
    ING["Ingest<br/>raw + archive"]
    PROC["Process<br/>dBZ, rain, confidence"]
    SERVE["Serve<br/>live API + history"]

    SRC --> ING --> PROC --> SERVE
  • Ingest the full rolling set of MGM composite frames, not just the latest.
  • Process each frame into a georeferenced reflectivity grid, a rain-rate grid, and an explicit confidence mask.
  • Serve a versioned REST API: metadata, frames, images, snapshots, tiles, point queries, and historical series/exports.
  • Archive every frame so history is queryable for forecasting and ML users.

What it is not

  • Not a forecast model. It serves observations.
  • Not a multi-source platform in this change. The source sits behind an adapter so it can be replaced later.
  • Not a general-purpose weather UI. The product surface is the API, the account portal, and the documentation.

Architecture

flowchart TD
    SRC["MGM compmax1..15 (HTTPS)"]
    ING["INGEST<br/>poller → downloader → hash/dedupe → raw → index"]
    PROC["PROCESS<br/>decode → georef → legend → classify → dBZ → rain<br/>→ confidence → derived store → render"]
    SERVE["SERVE<br/>/v1: meta · frames · image · tiles · point · batch<br/>archive: series · exports · jobs · signed URLs<br/>edge: auth · quotas · rate limits · usage"]

    SRC -- "conditional GET" --> ING
    ING -- "new frame" --> PROC
    PROC -- "indexed artifacts" --> SERVE

Repository layout

src/mgmradar/
  ingest/      source adapter, poller, downloader, dedupe, raw storage
  process/     decode, calibration, classification, rain rate, renders
  store/       object storage and frame/export index
  api/         FastAPI routes, schemas, auth, quotas
  ops/         health, metrics, alerts
tests/         offline fixtures and golden-frame tests
deploy/        compose/runbook, CDN notes (image: root Dockerfile)
docs/          source, calibration, API, archive, operations, licensing
openspec/      proposal, specs, design, tasks

API at a glance

Method Path Purpose
GET /v1/meta source, coverage, bounds, units, legend, versions (public on the first-party host)
GET /v1/frames list frames
GET /v1/frames/{scan_time} one frame's metadata
GET /v1/frames/{scan_time}/image.png full-frame Web Mercator overlay
GET /v1/frames/{scan_time}/tiles/{z}/{x}/{y}.png XYZ tile
GET /v1/snapshot focused bbox/place radar snapshot
GET /v1/frames/latest/image.png newest complete frame
GET /v1/point one coordinate observation
POST /v1/points bounded batch observations
GET /v1/series one coordinate over time
POST /v1/exports create a bbox/time export job
GET /v1/exports/{id} export status + signed URL
GET /v1/coverage.geojson radar footprint (public on the first-party host)
GET /v1/status freshness and processing health (public on the first-party host)
GET /v1/health liveness/readiness (no auth)
GET /v1/health/ready 503 unless dependencies and data are fresh
GET /ops operations dashboard (Cloudflare Access SSO)
POST /mcp remote MCP server (Streamable HTTP)

/v1 uses X-API-Key. The five MCP tools are available from a first-party local stdio package (uvx mgmradar-mcp, with the key in MGM_API_KEY) and from the remote /mcp endpoint over Streamable HTTP. The remote server accepts the same X-API-Key from header-capable clients, and OAuth 2.1 from OAuth-only hosts such as ChatGPT, which discover the authorization server, register themselves, and ask the customer to approve the radar:read scope. OAuth is accepted only on /mcp, never on /v1. MCP place inputs resolve Turkish neighborhoods and villages as well as provinces and districts, and every observation returns a nullable tri-state answer (rain_detected, no_rain_detected, indeterminate) with an explicit freshness band. See MCP server for setup and troubleshooting, and MCP listings for the official registry and developer directories that cover both the hosted and local transports. The evals/ directory holds the provider-independent tool-selection benchmark.

Plans

The Basic tier is permanent and card-free: 5,000 requests per month, 150 per day, 1 request per second, and the newest frame only. It includes no timestamped images, tiles, batch requests, history, or exports.

Plan Price Requests / month History Includes
Basic $0 5,000 live only meta, frames, latest frame/image, point
Pro $9 150,000 7 days + images, batch, history
Ultra $29 500,000 90 days + tiles, exports (1/day)
Mega $89 1,500,000 full archive + exports (10/day)
Enterprise Custom Custom full archive SLA, bulk export, dedicated support

Rain threshold alerts are included in Pro and above with no per-alert charge in version one. Basic has no alert rules. The configured limits match config/plans.yaml:

Plan Alert rules Deliveries / day Deliveries / month
Basic 0 0 0
Pro 10 100 2,000
Ultra 50 500 10,000
Mega 200 2,000 50,000
Enterprise 1,000 10,000 250,000

A downgrade disables rules above the new limit without deleting them and cancels their pending deliveries; an upgrade does not re-enable them automatically. See rain-alerts.md for the customer guide and runbook-rain-alerts.md for operations.

Sign up at /signup, verify the email, and the key is shown once. Paid plans are self-serve through the portal; Polar handles checkout. There is no overage: a quota rejection returns 429 until the reset or a plan change. See pricing.md for the full rules.

Documentation

Known risks

  • Upstream has no SLA. MGM can change the image layout, palette, cadence, or URL without notice. The service detects drift, quarantines bad frames, and reports staleness.
  • Licensing. The source is publicly reachable but its terms assert all rights reserved. The owner has accepted the redistribution risk; the position is recorded in docs/licensing.md. This is not legal advice.
  • Coarse product. The composite is roughly 2.4 km/px and column-maximum, not a surface rain measurement. The API must say so.

Naming

MGM Radar is the product name. The repository directory is mgm-radar; the Python package, distribution, CLI command, environment-variable prefix, and metric prefix use the single-token form mgmradar.

The name references the upstream source (MGM, the Turkish State Meteorological Service) but does not imply affiliation. MGM Radar is an independent product, not an official MGM service.

Development

python3.12 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
ruff check src tests
mypy src
pytest

Run the service with mgmradar serve, the ingest loop with mgmradar poll, and the export worker with mgmradar export-worker --cleanup. See the self-hosting guide and deployment runbook.

License

Proprietary. All rights reserved. The upstream data is subject to its own terms; see docs/licensing.md.

Metadata

Release files for mgmradar 0.40.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mgmradar 0.40.2
File Size Uploaded Provenance Actions
mgmradar-0.40.2.tar.gz 3.5 MB With provenance Details for mgmradar-0.40.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mgmradar 0.40.2
File Interpreter ABI Platform Actions
mgmradar-0.40.2-py3-none-any.whl Python 3 none any Details for mgmradar-0.40.2-py3-none-any.whl

Total release size: 5.4 MB

Release files / mgmradar-0.40.2.tar.gz

Download URL mgmradar-0.40.2.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
5e238e24000cdde66fdb92963c62388fbe98c9baf83e50bc7ca0270bcfda30bc
BLAKE2b-256 checksum
How to use checksums
29ad8c39322b08673ec302be5250ef0f7f7f2489fb9edecc75187f5bbde8297d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / mgmradar-0.40.2-py3-none-any.whl

Download URL mgmradar-0.40.2-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
00a534343e39750a4a0bcd8d2b79f8f72bf6d2ff726194d4ffc62e40f64209ed
BLAKE2b-256 checksum
How to use checksums
4770461f7bcb089be5beb5477515e82377d729ff10d4a6ab8211975e9fa659e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for mgmradar 0.40.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mgmradar-0.40.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page