Meteostat Documentation

website·Indexed 34 days ago

https://dev.meteostat.net

Open weather and climate data provider offering a JSON API, Python library, and CLI for accessing historical meteorological time series, climate normals, and weather station metadata from thousands of stations worldwide.

Tokens
31.3K
Snippets
143
Records
219
Agent score
61%

What's inside Meteostat

  1. Overview of Meteostat data access interfaces

    Meteostat provides open weather and climate data, focusing on historical, observation-based datasets measured on-site by weather stations worldwide. Users can retrieve raw station observations or use point-data queries to fetch data by geographic location. Data is available through four primary entry points:

    1. Meteostat Python: The core library upon which other tools are built.
    2. API: A programmatic interface for retrieving data via HTTP requests.
    3. CLI: A command-line interface for data access.
    4. Datasets: Direct access to the underlying normalized weather datasets.
  2. Understand Meteostat data sources and quality

    Meteostat is an aggregation platform that normalizes data from national weather services and other sources. All listed stations adhere to international WMO standards where applicable. The platform prioritizes official observations from national weather services, followed by international historical databases, synoptic observations, and METAR reports. Model data is used only as a last resort when no observation sources are available.
  3. Use the Meteostat CLI Skill for local AI agents

    Meteostat provides a free skill based on the Meteostat CLI that allows users to query weather and climate data using natural language. This interface is designed for local integration with AI agents such as Claude, GitHub Copilot, OpenCode, and Kiro.
  4. Query weather data using the Meteostat MCP server

    After configuring the Meteostat MCP server, you can ask your AI agent questions about historical weather and climate data in natural language. The agent will use the MCP server to query the Meteostat API and return a factual answer.
    Example query: "What was the hottest day in Frankfurt in the 2020s?"
  5. Understand the Meteostat Point data model and interpolation

    The Point API allows users to retrieve weather data for any geographic location without needing to know specific weather station IDs. Instead of returning data from a single station, Meteostat projects observations from multiple nearby stations and interpolates them based on geographical distance and the reference point of the query. To improve the precision of the model output, users should provide the elevation of the target location using the alt parameter.

    Note: Point data is only returned if there is at least one nearby weather station that reported observations during the requested period. The quality of the resulting data depends on the number and proximity of these stations.

  6. Access the global weather station database using meteostat.stations

    The meteostat.stations module is a Singleton API that provides access to a comprehensive database of weather stations worldwide. It allows developers to retrieve station metadata, find stations near specific coordinates, and check data availability.
  7. Query weather data using the Meteostat AI skill

    Once the Meteostat AI skill is installed for your AI agent (such as Claude, Copilot, OpenCode, or Kiro), you can ask questions about weather and climate data in natural language. The AI agent uses the skill to execute the necessary Meteostat CLI commands and return a formatted answer.
    User: "What was the hottest day in Frankfurt in the 2020s?"
    AI: "The hottest day in Frankfurt in the 2020s was August 4, 2022, with a maximum temperature of 38.5°C, recorded at the Frankfurt Westend station."
  8. Use the TimeSeries class to manage meteorological data

    The TimeSeries class represents a time series of weather or climate data for one or multiple weather stations. It is not instantiated directly but is created through granularity-specific interfaces: meteostat.hourly, meteostat.daily, meteostat.monthly, or meteostat.normals.
  9. Retrieve weather station metadata

    Use the /stations/meta endpoint to get descriptive information about a specific weather station, such as its name, geographic location (latitude, longitude, elevation), timezone, and the date ranges for available data (hourly, daily, monthly, etc.).

    To identify a station, you must provide one of the following query parameters:

    • id: The Meteostat ID (String)
    • wmo: The WMO ID (Integer)
    • icao: The ICAO ID (String)
    curl --request GET \
        --url 'https://meteostat.p.rapidapi.com/stations/meta?id=10637' \
        --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \
        --header 'x-rapidapi-key: {YOUR_API_KEY}'
  10. Get started with the Meteostat JSON API

    The Meteostat JSON API provides access to historical weather and climate data queried by weather station or geo location. The API is hosted on RapidAPI. To use the API, you must sign up for a RapidAPI account and subscribe to a Meteostat plan (a free plan with 500 monthly calls is available). All endpoints use HTTP GET requests and return a JSON object containing meta (general/debugging info) and data (the actual output).
  11. Understand Meteostat Python test suite organization

    The Meteostat Python library uses Pytest as its testing framework. The test suite is categorized into four types based on their scope and purpose:

    • Unit Tests: Test individual components or functions in isolation. Located in tests/unit/.
    • Integration Tests: Verify that multiple components work together correctly. Located in tests/integration/.
    • System Tests: Validate overall library functionality in real-world scenarios. Located in tests/system/.
    • Provider Tests: Verify the functionality of external data providers. Located in tests/provider/. These are run in a separate pipeline and are not intended to run on every code change.
  12. Access weather data via the Meteostat MCP Server

    For scalable solutions, Meteostat offers a remote Model Context Protocol (MCP) server hosted via RapidAPI. This allows AI agents that support the MCP protocol to retrieve historical weather and climate data using natural language queries.