# GRIB2 & NetCDF Reader API: Weather Data to CSV, JSON & Maps (`jumblemog/grib-netcdf-reader`) Actor

Read GRIB and NetCDF weather and climate files from links or uploads: GFS, ECMWF, HRRR, ERA5, CMIP. Values at points as JSON and CSV, area statistics, maps and NetCDF subsets. With a variables list, only those fields are downloaded, through the file's index. For developers and AI agents.

- **URL**: https://apify.com/jumblemog/grib-netcdf-reader.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GRIB2 & NetCDF Reader API: Weather Data to CSV, JSON & Maps

**Read GRIB and NetCDF weather and climate files from one API call.** Give links to the files (or upload one), say which places and variables you want, and you get back:

- **Values at your points** as JSON rows and CSV: temperature, pressure, wind, rain, cloud or any other variable in the file, for every level and time, with the grid cell each value came from and how far away it is.
- **Only the fields you ask for are downloaded.** NOAA and ECMWF publish an index next to each GRIB file; with a list of variables the tool reads the index and fetches just those messages. Four fields of a 500 MB GFS file are a 3.7 MB download.
- **Maps** as PNG pictures, with coastlines, borders, a colour scale in the right units and isobars on pressure maps, for the whole grid or an area you name.
- **Statistics over an area**: minimum and maximum with where they are, and the area-weighted mean, for each variable and time.
- **Conversions**: a NetCDF copy of what you picked (GRIB to NetCDF in one step), or every grid cell as a CSV row.
- **A list of what each file holds**: variables, levels, times, units, the grid and its resolution, and every GRIB message.

![2 m temperature over Europe from the GFS forecast of 18 November 2026, 06 UTC, on its 0.25 degree grid](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/grib-netcdf-reader-europe-t2m.png?signature=1BQUD40lw6UoNMH3eUWEJ)

*2 m temperature from NOAA's GFS 0.25° forecast, read from the public bucket with `"variables": ["TMP:2 m above ground"]` and `"area": "europe"`.*

The files are decoded by ECMWF's [ecCodes](https://confluence.ecmwf.int/display/ECC) and [cfgrib](https://github.com/ecmwf/cfgrib), and by [xarray](https://xarray.dev/) with the Unidata netCDF and HDF5 libraries. Nothing is estimated by a language model, and you install nothing: no wgrib2, no Python environment, no conda.

It's made for:

- AI agents asked "what does the forecast say for Chicago tomorrow?" or "how much rain fell in this file?". A language model can't read a binary GRIB file; this hands it the numbers as JSON, and a map it can show.
- Developers who need weather model output in an app or a pipeline without running a GRIB toolchain: wind and solar forecasts for energy, frost and rain for farms, wind and temperature for drones and aviation.
- Analysts and researchers with climate NetCDF files (reanalyses, CMIP model runs, satellite products) who want values at sites, area averages or a quick look.
- Anyone who was sent a .grib2 or .nc file and wants to know what is in it.

### How to use it

1. Put links to the files into **Links to GRIB or NetCDF files**, or upload one. To read a whole forecast run, write `{fh:03d}` where the forecast hour goes and set **Forecast hours**, such as `0-48/6`.
2. Optionally name the **Variables** (all when empty), **Levels** and a time window.
3. Add **Points**, one per line: `London: 51.507, -0.128`. Add an **Area** to cut maps and statistics to a region.
4. Click **Start**. With points, the dataset has one row per point, variable and time, and `values-wide.csv` has one row per point and time with a column per variable. Without points, the dataset has one item per file.

Write `example` as the link to read three built-in GFS forecast files (analysis, 6 and 12 hours, 1° grid) at London, New York, Tokyo and Sydney.

### How-to examples

The result lines are from runs of these inputs.

#### How to get a forecast at a few places from GFS

```json
{
  "files": ["https://noaa-gfs-bdp-pds.s3.amazonaws.com/gfs.20261118/00/atmos/gfs.t00z.pgrb2.0p25.f{fh:03d}"],
  "forecastHours": "6, 12",
  "variables": ["TMP:2 m above ground", "PRMSL", "UGRD:10 m above ground", "VGRD:10 m above ground"],
  "points": ["Chicago: 41.88, -87.63", "Madrid: 40.42, -3.70"]
}
```

Result: each file's index lists 743 fields; the four asked for are fetched by byte range, 3.7 MB of each 500 MB file. Chicago at 06 UTC: 8.86 °C, 1029.36 hPa, wind 3.56 m/s from 198°; at 12 UTC 7.45 °C. Madrid at 12 UTC: 15.53 °C, 1011.38 hPa, wind 4.15 m/s from 228°. Wind speed and direction (where the wind blows from) are worked out from the u and v components; nobody has to remember the formula.

#### How to compare two weather models at the same places

```json
{
  "files": [
    "https://noaa-gfs-bdp-pds.s3.amazonaws.com/gfs.20261118/00/atmos/gfs.t00z.pgrb2.0p25.f{fh:03d}",
    "https://data.ecmwf.int/forecasts/20261118/00z/ifs/0p25/oper/20261118000000-{fh}h-oper-fc.grib2"
  ],
  "forecastHours": "6, 12",
  "variables": ["TMP:2 m above ground", "PRMSL", "2t", "msl"],
  "points": ["Chicago: 41.88, -87.63", "Madrid: 40.42, -3.70"]
}
```

Result: `values-wide.csv` puts the two models in rows next to each other. Chicago at 12 UTC: GFS 7.45 °C and 1028.62 hPa, ECMWF IFS 4.70 °C and 1029.76 hPa. The NOAA names (TMP, PRMSL) match the GFS files and the ECMWF names (2t, msl) the ECMWF files; a name that no file holds is reported once for the run.

#### How to read the 3 km HRRR forecast for the United States

```json
{
  "files": ["https://noaa-hrrr-bdp-pds.s3.amazonaws.com/hrrr.20261119/conus/hrrr.t00z.wrfsfcf06.grib2"],
  "variables": ["TMP:2 m above ground", "UGRD:10 m above ground", "VGRD:10 m above ground", "MSLMA:mean sea level"],
  "points": ["Chicago: 41.878, -87.630", "Denver: 39.739, -104.990", "Miami: 25.762, -80.192"]
}
```

Result: 4 of the file's 173 fields fetched by the index, on HRRR's 3 km Lambert grid (1,059 × 1,799 cells). At 06 UTC Chicago has 8.20 °C, 1024.46 hPa and wind 4.56 m/s from 202°; Denver 3.20 °C and 1014.49 hPa; Miami 22.39 °C and wind 4.99 m/s from 108°. HRRR's winds are relative to its grid, so the direction is turned to true north with the grid's own orientation, and the map is drawn on a Lambert projection like the model's.

#### How to read DWD ICON-EU forecasts (.grib2.bz2 files)

```json
{
  "files": [
    "https://opendata.dwd.de/weather/nwp/icon-eu/grib/00/t_2m/icon-eu_europe_regular-lat-lon_single-level_2026111900_{fh:03d}_T_2M.grib2.bz2",
    "https://opendata.dwd.de/weather/nwp/icon-eu/grib/00/pmsl/icon-eu_europe_regular-lat-lon_single-level_2026111900_{fh:03d}_PMSL.grib2.bz2"
  ],
  "forecastHours": "0, 6",
  "points": ["Berlin: 52.520, 13.405", "Paris: 48.857, 2.352", "Madrid: 40.417, -3.704"]
}
```

Result: the four bzip2 files (about 1 MB each) are unpacked and read on ICON-EU's 0.0625° grid (657 × 1,377 cells). Berlin at 00 UTC: 8.05 °C and 988.59 hPa; at 06 UTC 5.95 °C and 990.01 hPa. Madrid at 06 UTC: 11.14 °C and 1012.34 hPa. DWD publishes one file per variable and keeps about a day of runs, so put the current run's date in the link.

#### How to see what is in a GRIB or NetCDF file

```json
{ "files": ["https://downloads.psl.noaa.gov/Datasets/ncep.reanalysis/surface/slp.2025.nc"] }
```

Without points, the dataset has one item per file. Result: "NetCDF 4 / HDF5 · 1 variable · 2.5° global regular grid · valid 2025-01-01T00:00:00Z to 2025-12-31T18:00:00Z", with `variables` (name, long name, units, levels, 1,460 times), `grid` (shape, resolution, bounds), the file's global attributes, a map of the first time and statistics for up to 200 times. For GRIB files, `messageList` lists every message (up to 3,000) with its variable, level, step and valid time.

#### How to read values from a climate NetCDF file

```json
{
  "files": [
    "https://downloads.psl.noaa.gov/Datasets/ncep.reanalysis/surface/slp.2025.nc",
    "https://downloads.psl.noaa.gov/Datasets/ncep.reanalysis/surface/pres.sfc.2025.nc"
  ],
  "points": ["Denver: 39.74, -104.99"],
  "timeFrom": "2025-06-01",
  "timeTo": "2025-06-01T12:00"
}
```

Result: three times from each file. At 00 UTC on 1 June 2025 the sea-level pressure at Denver was 1015.1 hPa and the surface pressure 789.5 hPa, the difference being the city's 1,600 m of height. One file per variable, as here, shares rows in `values-wide.csv`. The files store pressure in "Pascals"; the tool shows hPa (or inHg with `"units": "imperial"`, or the file's own units with `"original"`). Climate model calendars (360-day, no-leap) are read too.

#### How to turn GRIB into NetCDF or CSV

```json
{
  "files": ["https://noaa-gfs-bdp-pds.s3.amazonaws.com/gfs.20261118/00/atmos/gfs.t00z.pgrb2.0p25.f006"],
  "variables": ["TMP:2 m above ground", "PRMSL"],
  "area": "europe",
  "netcdf": true,
  "gridCsv": true,
  "maps": "none"
}
```

Result: `subset-001-gfs-t00z-pgrb2-0p25-f006.nc`, a compressed CF NetCDF file with `t2m` in °C and `prmsl` in hPa on the 153 × 281 cells between 34° and 72° N and 25° W and 45° E, and `grid-values.csv` with one row per cell and variable (lat, lon, value, units). Use `"units": "original"` to keep kelvin and pascals.

#### How to let an AI agent read weather files

Add the tool to an agent through Apify's MCP server at `https://mcp.apify.com/?tools=jumblemog/grib-netcdf-reader`. The agent can first call it with only `files` to learn what a file holds, then with `variables` and `points`. Each row carries `value`, `units`, `validTime` and the place's name, and `mapUrl` is a picture it can show.

### FAQ

**Which files can it read?**
GRIB edition 1 and 2 (NOAA GFS, GEFS, HRRR, NAM, RAP; ECMWF IFS and AIFS open data; ERA5 and other Copernicus downloads; DWD ICON on its regular grids; Météo-France; JMA; WRF post-processed output) and NetCDF 3, NetCDF 4 and HDF5-based NetCDF (reanalyses, CMIP and CORDEX climate runs, satellite and ocean products, WRF output). Files may be compressed with gzip or bzip2 (DWD's open data comes as `.grib2.bz2`) or packed in a ZIP archive.

**What is the index, and why does it make things cheaper?**
NOAA writes a small `.idx` text file next to each GRIB file, and ECMWF a `.index` file, listing where each field starts. With `variables` set, the tool reads the index and downloads only the matching byte ranges. A full 0.25° GFS file is about 500 MB; one field is about 1 MB. Without an index the whole file is downloaded and the fields are picked after.

**How do I write the variables?**
By name as the file has it (`TMP`, `APCP` for NOAA; `2t`, `tp`, `msl` for ECMWF; `t2m`, `tas`, `pr` in NetCDF), by part of a NOAA index line (`TMP:2 m above ground`, `APCP:surface:0-6 hour acc`), as key=value pairs (`param=t levelist=850`), or as a regular expression (`re:^(UGRD|VGRD):10 m`). Run without variables once to see what a file holds.

**A file has the same variable twice. Which one do I get?**
Both, with their difference in the name: GFS files hold rain over the last 6 hours and since the start of the run, which become `tp (surface, accum, 6-12 h)` and `tp (surface, accum, 0-12 h)`; cloud cover as an instant value and an average become `tcc (entire atmosphere)` and `tcc (entire atmosphere, avg)`. cfgrib on its own keeps only one of such messages.

**What does "outside" mean on a row?**
The point lies outside the file's grid (a regional model such as HRRR covers only the United States), so the value is empty. `distanceKm` says how far the nearest grid cell is; on a 0.25° grid it is at most about 20 km.

**Are winds on projected grids handled?**
Yes. HRRR, NAM and WRF store u and v along their grid's axes, not east and north. The tool turns them with the grid's orientation at each cell before giving wind direction; in the eastern US the difference is about 15 degrees.

**Which time zone are times in?**
UTC, as in the files. `validTime` is when a value is for, `referenceTime` when the forecast started and `stepHours` the hours between.

**Can it read ERA5 straight from the Copernicus Climate Data Store?**
The Data Store needs your own account, so download the file there and upload it here, or give a link to a copy in your own bucket. Public files on AWS, Google Cloud and Azure open-data buckets, NOAA and ECMWF servers, THREDDS file servers, Google Drive and Dropbox links work directly.

**Is my data kept?**
Files are read in a temporary folder that is deleted when the run ends. The values, maps and copies stay in your own Apify storage.

### Input

| Field | What it does |
|---|---|
| `files` | Links to GRIB or NetCDF files; `example` for three built-in GFS files. `{fh}` or `{fh:03d}` in a link is filled from `forecastHours`. Up to 400 per run. |
| `upload` | A file from your computer, read with any links. |
| `forecastHours` | Hours for `{fh}`: `0-48/6`, `0-120/3, 126-240/6` or `0, 12, 24`. |
| `variables` | Fields to read (all when empty). Names, index line parts, key=value pairs or `re:` expressions. |
| `levels` | Levels to keep, such as `850` or `2 m above ground`. |
| `timeFrom`, `timeTo` | Keep valid times in this window (UTC). |
| `points` | Places, one per line: `London: 51.507, -0.128`, `51.5N 0.13W` or `lat 51.5, lon -0.13`. Up to 1,000. |
| `interpolation` | `nearest` grid cell (default) or `bilinear` between the four around the point. |
| `area` | A name (`europe`, `conus`, `japan`, `uk`, `pacific` ...), `lat 35 to 72, lon -25 to 45`, or `west, south, east, north`. |
| `units` | `metric` (°C, hPa, mm, m/s), `imperial` (°F, inHg, in, mph, ft) or `original`. |
| `maps` | `first` (each variable of the first file), `all` or `none`; `maxMaps` (20) and `imageWidth` (1600) limit them. |
| `stats` | Minimum, maximum and mean per variable and time (on by default). |
| `netcdf` | A NetCDF copy of what was picked, per file. |
| `gridCsv` | Every grid cell as a CSV row, up to `maxGridRows`. |
| `windFromComponents` | Add wind speed and direction from u and v (on by default). |
| `maxDatasetRows` | Rows in the dataset (100,000); `values.csv` holds up to a million. |
| `timeLimitSeconds` | The run stops downloading and reading after this long (300 by default, 3,300 at most). |

### Output

- **Dataset**: with points, one row per point, variable and time: `file`, `point`, `lat`, `lon`, `variable`, `name`, `level`, `member`, `validTime`, `referenceTime`, `stepHours`, `value`, `units`, `gridLat`, `gridLon`, `distanceKm`, `outside`, `method`. Without points, one item per file: `status`, `summary`, `format`, `variables`, `grid`, `stats`, `mapUrl`, `mapUrls`, `netcdfUrl`, `unmatchedVariables`, `messageList`, `attributes`, `notes`, `error`.
- **values.csv** and **values-wide.csv**: the values at points, long (one value per row) and wide (one column per variable).
- **stats.csv**: the statistics of every variable and time.
- **Maps**: PNG files named `map-001-t2m` and so on, linked from `mapUrls` and the OUTPUT record.
- **NetCDF copies** (`subset-001-...`) and **grid-values.csv** when asked for.
- **OUTPUT**: the whole run as one JSON object, including each GRIB file's message list.

### How it works

1. Links are checked (only public web addresses), templates are filled and the files are downloaded four at a time. With variables, GRIB files with an index are fetched by byte range.
2. Each file is opened in a separate process as an unprivileged user in a throwaway folder: GRIB messages are listed with ecCodes and grouped by cfgrib, NetCDF files are opened by xarray, and times in any calendar are decoded.
3. The grid is recognised: regular latitude-longitude, curvilinear (projected models, including NetCDF files that only give x, y and a grid mapping) or unstructured cells. Values at points come from the nearest cell or the four around it; global grids wrap around the date line.
4. Units are converted, wind is derived, statistics are weighted by cell area, and maps are drawn with Cartopy and Natural Earth coastlines.

### Pricing

You pay per file read, at the price shown on this page. One file event covers a file of up to 10 MB downloaded and 30 seconds of reading at the default 2 GB memory; a larger download costs one more event for each further 10 MB, and a longer read one more for each further 30 seconds (15 seconds at 4 GB, since the platform's cost follows memory). Fetching only your variables by index usually keeps a file at one event: four fields of a 0.25° GFS file are 3.6 MB, where the whole file is about 500 MB and 50 events. Each file's `events` says what it counted for. Files that can't be downloaded or read are never charged. If you set a maximum cost per run, the Actor stops before files that wouldn't fit, and downloads stop at what it still covers.

### Speed

The built-in example (three GFS files, four cities, three maps) takes about 5 seconds of reading. Two forecast hours from both GFS and ECMWF, fetched by index, with values at two places and six maps of Europe, took 13 seconds including the downloads. Maps take about a second each.

### Tips and limits

- Give `variables` for big GRIB files: it is what makes downloads small.
- Use `area` with `gridCsv`: a global 0.25° grid is a million rows per variable and time.
- Values at points follow the model's grid: a 0.25° cell is about 25 km across, so a mountain town may sit in a cell whose height is the valley's or the peak's.
- Files up to 4 GB; the run's disk is twice its memory, so give big files more memory. Files that don't fit next to others are read in a batch of their own.
- Zarr stores and OPeNDAP endpoints aren't read; give links to the files themselves.

### For AI agents and developers

- **Input**: `files` alone lists what a file holds. Add `variables` and `points` for values, `area` for a region.
- **Output**: rows with `value`, `units`, `validTime` and `point`; `outside: true` when a point isn't on the grid; `mapUrl` for a picture.
- **Errors**: each failed file has `status: "failed"` and an `error` that says what to change (a 404, a web page instead of a file, no variable matching, a file too big for the run). Failed files cost nothing.
- **Cost**: one event per file fetched by index; a whole file costs one per started 10 MB (`events` on each file).

Get the values from one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~grib-netcdf-reader/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"files": ["example"], "points": ["London: 51.507, -0.128"], "variables": ["t2m", "prmsl"]}'
```

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/grib-netcdf-reader").call(run_input={
    "files": ["https://noaa-gfs-bdp-pds.s3.amazonaws.com/gfs.20261118/00/atmos/gfs.t00z.pgrb2.0p25.f{fh:03d}"],
    "forecastHours": "0-48/6",
    "variables": ["TMP:2 m above ground", "APCP:surface"],
    "points": ["Berlin: 52.52, 13.405"],
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["validTime"], row["variable"], row["value"], row["units"])
```

### Credits

- GRIB decoding: [ecCodes](https://confluence.ecmwf.int/display/ECC) (Apache-2.0) and [cfgrib](https://github.com/ecmwf/cfgrib) (Apache-2.0), by ECMWF.
- NetCDF and HDF5: [xarray](https://xarray.dev/) (Apache-2.0), [netCDF4-python](https://github.com/Unidata/netcdf4-python) (MIT) with Unidata's netCDF-C (BSD-3-Clause) and the HDF Group's HDF5 (BSD-style), [cftime](https://github.com/Unidata/cftime) (MIT), [SciPy](https://scipy.org/) (BSD-3-Clause).
- Maps: [Cartopy](https://scitools.org.uk/cartopy/) (BSD-3-Clause), [Matplotlib](https://matplotlib.org/) (PSF-based licence), [PROJ](https://proj.org/) via pyproj (MIT), [Shapely](https://shapely.readthedocs.io/) (BSD-3-Clause) with GEOS (LGPL-2.1), and [Natural Earth](https://www.naturalearthdata.com/) coastlines and borders (public domain).
- The built-in example is NOAA NCEP GFS data (public domain), from the run of 18 November 2026, 00 UTC.

# Actor input Schema

## `files` (type: `array`):

Direct links to .grib2, .grib, .nc or .nc4 files (gzip, bzip2 and ZIP work too): NOAA and ECMWF open data, AWS, Google Cloud and Azure buckets, THREDDS file servers, Google Drive, Dropbox, GitHub. Write {fh} or {fh:03d} in a link and set forecastHours to read a whole run, such as ...gfs.t00z.pgrb2.0p25.f{fh:03d}. Write example for three built-in GFS files. Up to 400 files per run.

## `upload` (type: `string`):

A GRIB or NetCDF file from your computer, read together with any links.

## `forecastHours` (type: `string`):

Fills {fh}, {fh:02d} or {fh:03d} in the links: 0-48/6 is every 6 hours up to 48; 0-120/3, 126-240/6 or a plain list such as 0, 12, 24 work too.

## `variables` (type: `array`):

Which fields to read; all when empty. A name such as TMP, 2t, t2m, msl or tas; a GRIB index line part such as TMP:2 m above ground or APCP:surface; key=value pairs such as param=t levelist=850; or re: and a regular expression. For GRIB links with a .idx or .index file next to them (NOAA, ECMWF open data), only these fields are downloaded.

## `levels` (type: `array`):

Keep only these levels, such as 850 (hPa), 2 m above ground or surface; all when empty.

## `timeFrom` (type: `string`):

Keep times from this one on, in UTC: 2026-11-18 or 2026-11-18T06:00.

## `timeTo` (type: `string`):

Keep times up to this one, in UTC.

## `points` (type: `array`):

Places to read values at, one per line: London: 51.507, -0.128, or 51.5N 0.13W, or lat 51.5, lon -0.13. Latitude first. Up to 1,000. With points, the dataset holds one row per point, variable and time; without, one item per file.

## `interpolation` (type: `string`):

Nearest gives the value of the closest grid cell (and says how far it is); bilinear interpolates between the four around the point.

## `area` (type: `string`):

Cut maps, statistics and exports to an area: a name (europe, conus, japan, uk, australia, pacific ...), lat 35 to 72, lon -25 to 45, or west, south, east, north as in GeoJSON: -25, 35, 45, 72. Areas may cross the date line. The whole grid when empty.

## `units` (type: `string`):

Temperatures, pressures, rain and wind converted for reading; other variables keep the file's units.

## `maps` (type: `string`):

PNG maps with coastlines, borders, a colour scale and isobars on pressure maps.

## `maxMaps` (type: `integer`):

Stop drawing after this many maps.

## `imageWidth` (type: `integer`):

Width of the map pictures.

## `stats` (type: `boolean`):

Minimum, maximum (with where they are) and area-weighted mean of each variable at each time, over the area or the whole grid.

## `netcdf` (type: `boolean`):

A compressed NetCDF file per input file with the variables, levels, times and area picked, in the units chosen. Handy for turning GRIB into NetCDF.

## `gridCsv` (type: `boolean`):

A CSV with one row per grid cell, variable and time (lat, lon, value), for the area. Use an area: a global 0.25° grid is a million rows per field.

## `maxGridRows` (type: `integer`):

The grid CSV stops at this many rows.

## `windFromComponents` (type: `boolean`):

Adds wind speed and direction (where it blows from, degrees from north) for each pair of u and v components. Winds relative to a projected grid (HRRR, NAM) are turned to north first.

## `maxDatasetRows` (type: `integer`):

Values at points beyond this go to values.csv only (which holds up to a million).

## `timeLimitSeconds` (type: `integer`):

Downloading and reading stop after this long; what was read is kept. Each file is billed for its own reading time.

## Actor input object example

```json
{
  "files": [
    "example"
  ],
  "points": [
    "London: 51.507, -0.128",
    "New York: 40.713, -74.006"
  ],
  "interpolation": "nearest",
  "units": "metric",
  "maps": "first",
  "maxMaps": 20,
  "imageWidth": 1600,
  "stats": true,
  "netcdf": false,
  "gridCsv": false,
  "maxGridRows": 1000000,
  "windFromComponents": true,
  "maxDatasetRows": 100000,
  "timeLimitSeconds": 300
}
```

# Actor output Schema

## `values` (type: `string`):

One row per point, variable and time.

## `files` (type: `string`):

One item per file with what it holds, statistics and map links (runs without points).

## `valuesCsv` (type: `string`):

Every value at the points as CSV.

## `valuesWideCsv` (type: `string`):

One row per point and time, one column per variable.

## `statsCsv` (type: `string`):

Minimum, maximum and mean of each variable at each time.

## `output` (type: `string`):

The run's summary: every file, map and table link in one JSON object.

## `store` (type: `string`):

Maps (PNG), NetCDF copies and CSV tables in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "files": [
        "example"
    ],
    "points": [
        "London: 51.507, -0.128",
        "New York: 40.713, -74.006"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/grib-netcdf-reader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "files": ["example"],
    "points": [
        "London: 51.507, -0.128",
        "New York: 40.713, -74.006",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/grib-netcdf-reader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "files": [
    "example"
  ],
  "points": [
    "London: 51.507, -0.128",
    "New York: 40.713, -74.006"
  ]
}' |
apify call jumblemog/grib-netcdf-reader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/grib-netcdf-reader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2if5cb1J5yGcuk0GA/builds/Y6o57DlvieST4zlak/openapi.json
