### Install Meteostat CLI with uvx Source: https://dev.meteostat.net/cli Alternative installation method for Meteostat CLI using uvx. ```bash uvx meteostat-cli [YOUR_COMMAND] ``` -------------------------------- ### Install Meteostat CLI Source: https://dev.meteostat.net/cli Install the Meteostat CLI using uv tool. For plotting capabilities, install the 'plot' extra. ```bash uv tool install meteostat-cli ``` ```bash uv tool install "meteostat-cli[plot]" ``` -------------------------------- ### Meteostat CLI Configuration Examples Source: https://dev.meteostat.net/cli/configuration Common commands for listing settings and updating specific configuration keys. ```bash meteo config --list # Show all current settings meteo config cache_enable false # Disable caching meteo config interpolation_radius 25000 # Set interpolation radius to 25 km ``` -------------------------------- ### Climate Normals CLI Examples Source: https://dev.meteostat.net/cli/timeseries/normals Various examples for fetching climate normals, including short-form flags, multiple stations, parameter filtering, and CSV output. ```bash meteo normals 10637 --start 1991 --end 2020 meteo n 10637 -s 1991 -e 2020 # Short form meteo normals 10637 10635 -s 1991 -e 2020 # Multiple stations meteo normals 10637 -s 1991 -e 2020 --parameters tavg,prcp meteo normals 10637 -s 1991 -e 2020 --output normals.csv ``` -------------------------------- ### Example Output DataFrame Source: https://dev.meteostat.net/python/providers This is an example of the DataFrame output when fetching hourly temperature data. ```text time 2018-01-01 00:00:00 11.3 2018-01-01 01:00:00 10.8 2018-01-01 02:00:00 10.5 2018-01-01 03:00:00 10.0 2018-01-01 04:00:00 9.6 ... ... 2018-12-31 19:00:00 7.3 2018-12-31 20:00:00 7.3 2018-12-31 21:00:00 7.1 2018-12-31 22:00:00 6.8 2018-12-31 23:00:00 6.6 [8760 rows x 1 columns] ``` -------------------------------- ### Install Meteostat Python Package Source: https://dev.meteostat.net/python Install the Meteostat Python package using pip. This command downloads and installs the latest version from PyPI. ```bash pip install meteostat ``` -------------------------------- ### Nearby stations output example Source: https://dev.meteostat.net/python/stations/nearby Example output showing the station data returned by the nearby method. ```text name country region latitude longitude elevation timezone distance id D1424 Frankfurt Westend DE HE 50.1269 8.6694 124 Europe/Berlin 1649.3 10640 Offenbach am Main DE HE 50.1167 8.7333 98 Europe/Berlin 3503.5 10641 Offenbach Wetterpark DE HE 50.0894 8.7864 119 Europe/Berlin 7845.6 10637 Frankfurt Airport DE HE 50.0500 8.6000 111 Europe/Berlin 9441.4 ``` -------------------------------- ### Example Daily Weather Data Output Source: https://dev.meteostat.net/python/timeseries/daily This is an example of the DataFrame output when fetching daily weather data. It includes various weather parameters for each day. ```text temp tmin tmax rhum prcp snwd wspd wpgt pres tsun cldc time 2018-01-01 8.1 6.6 11.2 70 1.1 0 26.6 59.8 1005.0 42 7 2018-01-02 6.4 5.2 8.0 74 5.8 0 22.0 50.8 1011.9 12 7 2018-01-03 8.1 5.3 10.4 72 6.3 0 36.4 83.9 999.1 144 6 2018-01-04 7.6 5.9 10.9 83 8.4 0 20.9 58.7 999.9 0 6 2018-01-05 8.5 7.1 10.2 83 4.8 0 18.7 59.4 1001.8 0 7 ... ... ... ... ... ... ... ... ... ... ... ... 2018-12-27 -1.4 -2.1 -0.4 96 0.0 0 6.5 22.3 1030.7 0 8 2018-12-28 -0.5 -1.0 0.3 94 0.0 0 9.7 24.1 1031.8 0 8 2018-12-29 1.3 -0.7 4.6 92 0.8 0 16.9 45.7 1033.8 0 8 2018-12-30 7.2 4.5 8.3 76 0.0 0 17.3 48.6 1033.2 0 8 2018-12-31 6.8 5.6 9.0 94 0.0 0 9.7 43.9 1034.5 0 8 [365 rows x 11 columns] ``` -------------------------------- ### Install AI Skill for Kiro (wget) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for Kiro when using wget. Ensure the .kiro/skills/meteo directory exists. ```bash wget -O .kiro/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.kiro/skills/meteo/SKILL.md ``` -------------------------------- ### Meteostat CLI Inventory Examples Source: https://dev.meteostat.net/cli/stations/inventory Demonstrates how to use the meteo inventory command with different options. Filter by granularity and specific parameters to see available records. ```bash meteo inventory 10637 ``` ```bash meteo inventory 10637 --granularity daily ``` ```bash meteo inventory 10637 --granularity daily --parameters tavg,tmin,tmax ``` -------------------------------- ### Install AI Skill for OpenCode (wget) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for OpenCode when using wget. Ensure the .opencode/skills/meteo directory exists. ```bash wget -O .opencode/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.opencode/skills/meteo/SKILL.md ``` -------------------------------- ### Get Station Inventory Data Source: https://dev.meteostat.net/python/stations/inventory Use the `stations.inventory` method to retrieve the start and end dates of available data for a given station. Ensure the meteostat library is imported. ```python import meteostat as ms STATION = '71624' # Toronto Pearson International Airport # Get station inventory inventory = ms.stations.inventory(STATION) print(f"Data available from {inventory.start} to {inventory.end}.") ``` ```text Data available from 1937-11-01 to 2025-12-31. ``` -------------------------------- ### Install AI Skill for Claude (wget) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for Claude when using wget. Ensure the .claude/skills/meteo directory exists. ```bash wget -O .claude/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.claude/skills/meteo/SKILL.md ``` -------------------------------- ### Install AI Skill for Kiro (curl) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for Kiro when using curl. Ensure the .kiro/skills/meteo directory exists. ```bash curl -o .kiro/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.kiro/skills/meteo/SKILL.md ``` -------------------------------- ### Install AI Skill for GitHub Copilot (wget) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for GitHub Copilot when using wget. Ensure the .copilot/skills/meteo directory exists. ```bash wget -O .copilot/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.copilot/skills/meteo/SKILL.md ``` -------------------------------- ### Fetch Daily Data with Short Options Source: https://dev.meteostat.net/cli/timeseries/daily Uses short-form options for start and end dates to fetch daily weather data. ```bash meteo d 10637 -s 2024-01-01 -e 2024-12-31 # Short form ``` -------------------------------- ### Install AI Skill for OpenCode (curl) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for OpenCode when using curl. Ensure the .opencode/skills/meteo directory exists. ```bash curl -o .opencode/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.opencode/skills/meteo/SKILL.md ``` -------------------------------- ### Request Hourly Data via cURL Source: https://dev.meteostat.net/api/point/hourly Example request using cURL. Replace {key} with your valid RapidAPI key. ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/point/hourly?lat=43.6667&lon=-79.4&start=2020-01-01&end=2020-01-01&alt=113&tz=America%2FToronto' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` -------------------------------- ### Install AI Skill for Claude (curl) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for Claude when using curl. Ensure the .claude/skills/meteo directory exists. ```bash curl -o .claude/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.claude/skills/meteo/SKILL.md ``` -------------------------------- ### Execute API Request via cURL Source: https://dev.meteostat.net/api Example command to retrieve station metadata using a RapidAPI key. ```bash 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: {key}' ``` -------------------------------- ### GET /monthly Source: https://dev.meteostat.net/cli/timeseries/monthly Fetch monthly weather summaries for one or more weather stations. ```APIDOC ## GET /monthly ### Description Fetch monthly weather summaries for one or more weather stations. ### Method GET ### Endpoint meteo monthly STATIONS... [OPTIONS] ### Parameters #### Path Parameters - **STATIONS** (string) - Required - One or more weather station identifiers. #### Query Parameters - **--start** (string) - Optional - Start year for the data range. - **--end** (string) - Optional - End year for the data range. - **--parameters** (string) - Optional - Comma-separated list of weather parameters (e.g., tavg, prcp). - **--output** (string) - Optional - File path to save the output (e.g., data.xlsx). ### Request Example meteo monthly 10637 --start 2020 --end 2024 ### Response #### Success Response (200) - **data** (array) - Returns a list of monthly weather records for the specified stations. ``` -------------------------------- ### Install AI Skill for GitHub Copilot (curl) Source: https://dev.meteostat.net/cli/skill Use this command to download the AI skill for GitHub Copilot when using curl. Ensure the .copilot/skills/meteo directory exists. ```bash curl -o .copilot/skills/meteo/SKILL.md \ https://raw.githubusercontent.com/meteostat/cli/refs/heads/main/.copilot/skills/meteo/SKILL.md ``` -------------------------------- ### Nearby Stations CLI Examples Source: https://dev.meteostat.net/cli/stations/nearby Common usage patterns for finding stations, including limiting results, adjusting search radius, and formatting output. ```bash meteo nearby 50.1109 8.6821 # Nearest stations (default: 5 within 5 km) meteo nearby 50.1109 8.6821 --limit 10 # Return up to 10 stations meteo nearby 50.1109 8.6821 --radius 20000 # Search within 20 km meteo nearby 50.1109 8.6821 --format json # JSON output ``` -------------------------------- ### Query Hourly Data with cURL Source: https://dev.meteostat.net/api/stations/hourly Example using cURL to request hourly data for a specific station and date. Replace {key} with your actual API key. ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/stations/hourly?station=10637&start=2020-01-01&end=2020-01-01&tz=Europe%2FBerlin' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` -------------------------------- ### Interpolate Daily Weather Data Source: https://dev.meteostat.net/python/interpolation Fetches daily weather data from nearby stations and interpolates it for a specific point. Ensure you have the 'meteostat' library installed. ```python from datetime import date import meteostat as ms # Specify location and time range POINT = ms.Point(50.1155, 8.6842, 113) # Try with your location START = date(2018, 1, 1) END = date(2018, 12, 31) # Get nearby weather stations stations = ms.stations.nearby(POINT, limit=4) # Get daily data & perform interpolation ts = ms.daily(stations, START, END) df = ms.interpolate(ts, POINT).fetch() print(df) ``` -------------------------------- ### Request Climate Normals via cURL Source: https://dev.meteostat.net/api/stations/normals Example command to fetch climate normals for a specific station and time period. Replace {key} with your actual API key. ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/stations/normals?station=10637&start=1961&end=1990' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` -------------------------------- ### Fetch Daily Weather Data as DataFrame Source: https://dev.meteostat.net/python/api/meteostat.TimeSeries.fetch Use this snippet to retrieve daily weather data for a specified location and time range. Ensure you have the meteostat library installed and import necessary modules like datetime and meteostat. ```python from datetime import date import meteostat as ms # Specify time range START = date(2018, 1, 1) END = date(2018, 12, 31) # Get daily data ts = ms.daily('10637', START, END) # Fetch the data df = ts.fetch() # Print the DataFrame print(df) ``` -------------------------------- ### Plot 2018 Temperature Data for Frankfurt Source: https://dev.meteostat.net/python This example demonstrates how to retrieve and plot daily temperature data for a specific location in 2018. It requires specifying a geographical point, a time range, fetching nearby weather stations, interpolating data, and then plotting the results using matplotlib. ```python from datetime import date import matplotlib.pyplot as plt import meteostat as ms # Specify location and time range POINT = ms.Point(50.1155, 8.6842, 113) # Try with your location START = date(2018, 1, 1) END = date(2018, 12, 31) # Get nearby weather stations stations = ms.stations.nearby(POINT, limit=4) # Get daily data & perform interpolation ts = ms.daily(stations, START, END) df = ms.interpolate(ts, POINT).fetch() # Plot line chart including average, minimum and maximum temperature df.plot(y=[ms.Parameter.TEMP, ms.Parameter.TMIN, ms.Parameter.TMAX]) plt.show() ``` -------------------------------- ### Fetch Monthly Weather Data with cURL Source: https://dev.meteostat.net/api/stations/monthly Use this cURL command to query the Meteostat API for monthly weather data. Replace `{key}` with your actual API key. Ensure you have the cURL command-line interface installed. ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/stations/monthly?station=10637&start=2020-01-01&end=2020-12-31' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` -------------------------------- ### Query Daily Weather Data with cURL Source: https://dev.meteostat.net/api/point/daily Use this cURL command to fetch daily weather data for a specific location and date range. Replace {key} with your personal RapidAPI key. Ensure you have cURL installed. ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/point/daily?lat=43.6667&lon=-79.4&start=2020-01-01&end=2020-01-31&alt=184' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` -------------------------------- ### GET meteostat.stations.inventory Source: https://dev.meteostat.net/python/stations/inventory Retrieves the start and end dates for which data is available at a specific weather station. ```APIDOC ## GET meteostat.stations.inventory ### Description Retrieves information about the time range for which data is available at the specified station. Inventory data is both provider and parameter specific. ### Endpoint meteostat.stations.inventory(station_id) ### Parameters #### Path Parameters - **station_id** (string) - Required - The unique identifier for the weather station. ### Response - **start** (date) - The start date of available data. - **end** (date) - The end date of available data. ### Request Example ```python import meteostat as ms STATION = '71624' inventory = ms.stations.inventory(STATION) ``` ### Response Example ```json { "start": "1937-11-01", "end": "2025-12-31" } ``` -------------------------------- ### GET /stations/normals Source: https://dev.meteostat.net/api/stations/normals Fetches climate normals for a specified weather station. You can optionally provide a start and end year to define the reference period and choose the unit system for the returned meteorological parameters. ```APIDOC ## GET /stations/normals ### Description Retrieves climate normals for a specified weather station. Climate normals represent the typical monthly weather at a given location, calculated over a reference period. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/stations/normals ### Parameters #### Query Parameters - **station** (String) - Required - The weather station ID. - **start** (String) - Optional - The start year (YYYY) of the period. Defaults to null. - **end** (String) - Optional - The end year (YYYY) of the period. Defaults to null. - **units** (String) - Optional - The unit system of the meteorological parameters. Accepted values: `metric`, `imperial`, `scientific`. Defaults to `metric`. ### Request Example ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/stations/normals?station=10637&start=1961&end=1990' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` ### Response #### Success Response (200) - **data** (Array) - An array containing twelve objects, one for each month, with the following properties: - **month** (Integer) - The integer number of the month (1 to 12). - **tavg** (Float) - The mean temperature in °C (or Fahrenheit/Kelvin based on `units`). - **tmin** (Float) - The average minimum temperature in °C (or Fahrenheit/Kelvin based on `units`). - **tmax** (Float) - The average maximum temperature in °C (or Fahrenheit/Kelvin based on `units`). - **prcp** (Integer) - The average total precipitation in mm (or Inches based on `units`). - **pres** (Float) - The average sea-level air pressure in hPa. - **tsun** (Integer) - The average sunshine duration in minutes. - **meta** (Object) - Metadata about the request. - **exec_time** (Float) - Execution time of the request in seconds. - **generated** (String) - Timestamp when the data was generated. #### Response Example ```json { "meta": { "exec_time": 0.885, "generated": "2021-06-23 12:14:35" }, "data": [ { "month": 1, "tavg": 0.5, "tmin": -2.2, "tmax": 3.2, "prcp": 43.8, "pres": 1018, "tsun": 2454 }, { "month": 2, "tavg": 1.7, "tmin": -1.6, "tmax": 5, "prcp": 39.8, "pres": 1017.5, "tsun": 4494 } // ... more months ] } ``` ``` -------------------------------- ### Run All Tests Source: https://dev.meteostat.net/python/contributing/testing Execute the entire test suite for unit and integration tests. Navigate to the repository root and use this command. ```bash poetry run pytest tests/unit/ tests/integration/ ``` -------------------------------- ### GET /point/normals Source: https://dev.meteostat.net/api/point/normals Fetches climate normals for a specific geographic point. ```APIDOC ## GET /point/normals ### Description Retrieves climate normals (long-term average weather data) for a specified geographic location. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/point/normals ### Parameters #### Query Parameters - **lat** (Float) - Required - The latitude of the geographic location. - **lon** (Float) - Required - The longitude of the geographic location. - **alt** (Integer) - Optional - The elevation of the geographic location. If not set, Meteostat will use its own elevation model. - **units** (String) - Optional - The unit system for meteorological parameters. Accepted values: `metric`, `imperial`, `scientific`. Defaults to `metric`. - **start** (Integer) - Optional - The first year (YYYY) of the reference period for calculating normals. - **end** (Integer) - Optional - The last year (YYYY) of the reference period for calculating normals. ### Request Example ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/point/normals?lat=59.9127&lon=10.7461&alt=26&start=1961&end=1990' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` ### Response #### Success Response (200) - **start** (Integer) - The first year (YYYY) of the period. - **end** (Integer) - The last year (YYYY) of the period. - **month** (Integer) - The month (1-12). - **tavg** (Float) - The average daily air temperature (°C). - **tmin** (Float) - The average daily minimum air temperature (°C). - **tmax** (Float) - The average daily maximum air temperature (°C). - **prcp** (Float) - The monthly precipitation total (mm). - **wspd** (Float) - The average wind speed (km/h). - **pres** (Float) - The average sea-level air pressure (hPa). - **tsun** (Integer) - The monthly sunshine total (minutes). #### Response Example ```json { "month": 1, "tavg": -3.8, "tmin": -6.3, "tmax": -1.3, "prcp": 50.9, "wspd": null, "pres": 1011.3, "tsun": 2400 } ``` ``` -------------------------------- ### GET /stations/meta Source: https://dev.meteostat.net/api Retrieves metadata for a specific weather station using its ID. ```APIDOC ## GET /stations/meta ### Description Retrieves metadata information for a specific weather station. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/stations/meta ### Parameters #### Query Parameters - **id** (string) - Required - The unique identifier for the weather station. ### Request Example 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: {key}' ### Response #### Success Response (200) - **meta** (object) - General information about the data output. - **data** (object) - The actual station metadata output. ``` -------------------------------- ### GET /stations/nearby Source: https://dev.meteostat.net/api/stations/nearby Finds weather stations near a specified geographic location. ```APIDOC ## GET /stations/nearby ### Description This endpoint enables users to find nearby weather stations by geo location. When calling this endpoint, make sure to provide valid geographic coordinates (decimal degrees) using the `lat` (latitude) and `lon` (longitude) parameters. The `limit` parameter allows us to specify the maximum number of weather stations returned by this endpoint. By default, the endpoint only returns weather stations which are closer than 100 kilometers to the specified geo location. If you want to limit your query to a certain radius, just set the `radius` parameter to any integer value. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/stations/nearby ### Parameters #### Query Parameters - **lat** (Float) - Required - The latitude of the location - **lon** (Float) - Required - The longitude of the location - **limit** (Integer) - Optional - The maximum number of results (Default: 10) - **radius** (Integer) - Optional - The radius of the query in meters (Default: 100000) ### Request Example ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/stations/nearby?lat=51.5085&lon=-0.1257&limit=5' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` ### Response #### Success Response (200) - **meta** (Object) - Metadata about the request. - **exec_time** (Float) - Execution time of the request in seconds. - **generated** (String) - Timestamp when the response was generated. - **data** (Array) - An array of nearby weather stations. - **id** (String) - The Meteostat ID of the weather station. - **name** (Object) - Name of the weather station in different languages. - **distance** (Float) - The distance to the provided geo location in meters. #### Response Example ```json { "meta": { "exec_time": 0.172, "generated": "2021-06-23 18:36:46" }, "data": [ { "id": "03779", "name": { "en": "London Weather Centre" }, "distance": 1104.3 }, { "id": "EGLC0", "name": { "en": "London / Abbey Wood" }, "distance": 16804.1 }, { "id": "03672", "name": { "en": "Northolt" }, "distance": 20652.3 }, { "id": "03772", "name": { "en": "London Heathrow Airport" }, "distance": 22624.4 }, { "id": "03781", "name": { "en": "Kenley" }, "distance": 23370 } ] } ``` ``` -------------------------------- ### Load configuration from environment variables Source: https://dev.meteostat.net/python/api/meteostat.config.load_env Demonstrates setting environment variables before calling load_env to update the Meteostat configuration. ```python import os import meteostat as ms # Set environment variables os.environ['MS_CACHE_DIRECTORY'] = '/custom/cache' os.environ['MS_CACHE_TTL'] = '86400' os.environ['MS_BLOCK_LARGE_REQUESTS'] = 'false' # Load configuration from environment ms.config.load_env() # Configuration is now updated from environment variables print(ms.config.cache_directory) # Output: /custom/cache print(ms.config.cache_ttl) # Output: 86400 print(ms.config.block_large_requests) # Output: False ``` -------------------------------- ### GET /stations/daily Source: https://dev.meteostat.net/api/stations/daily Retrieves historical daily weather statistics for a specific weather station. ```APIDOC ## GET https://meteostat.p.rapidapi.com/stations/daily ### Description Provides historical daily statistics for a particular weather station. Data is aggregated from multiple governmental interfaces. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/stations/daily ### Parameters #### Query Parameters - **station** (String) - Required - The weather station ID - **start** (String) - Required - The start date of the query (YYYY-MM-DD) - **end** (String) - Required - The end date of the query (YYYY-MM-DD) - **model** (String) - Optional - Substitute missing records with statistically optimized model data (Default: true) - **freq** (String) - Optional - The time frequency of the records - **units** (String) - Optional - The unit system (metric, imperial, scientific) (Default: metric) ### Response #### Success Response (200) - **date** (String) - The date string (YYYY-MM-DD) - **tavg** (Float) - The average air temperature in °C - **tmin** (Float) - The minimum air temperature in °C - **tmax** (Float) - The maximum air temperature in °C - **prcp** (Float) - The daily precipitation total in mm - **snow** (Integer) - The maximum snow depth in mm - **wdir** (Integer) - The average wind direction in degrees (°) - **wspd** (Float) - The average wind speed in km/h - **wpgt** (Float) - The peak wind gust in km/h - **pres** (Float) - The average sea-level air pressure in hPa - **tsun** (Integer) - The daily sunshine total in minutes (m) #### Response Example { "date": "2020-02-01", "tavg": 11.4, "tmin": 7.8, "tmax": 12.8, "prcp": 10.1, "snow": 0, "wdir": 210, "wspd": 22.3, "wpgt": 126, "pres": 1009.6, "tsun": 0 } ``` -------------------------------- ### GET /point/daily Source: https://dev.meteostat.net/api/point/daily Retrieves historical daily weather statistics for a specific geographic location. ```APIDOC ## GET https://meteostat.p.rapidapi.com/point/daily ### Description Provides historical daily statistics for any geographic location. Data can be queried for a maximum of 10 years per request. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/point/daily ### Parameters #### Query Parameters - **lat** (Float) - Required - The latitude of the geographic location - **lon** (Float) - Required - The longitude of the geographic location - **alt** (Integer) - Optional - The elevation of the geographic location - **start** (String) - Required - The start date of the query (YYYY-MM-DD) - **end** (String) - Required - The end date of the query (YYYY-MM-DD) - **model** (String) - Optional - Substitute missing records with statistically optimized model data (default: true) - **freq** (String) - Optional - The time frequency of the records - **units** (String) - Optional - The unit system (metric, imperial, scientific) (default: metric) ### Request Example curl --request GET \ --url 'https://meteostat.p.rapidapi.com/point/daily?lat=43.6667&lon=-79.4&start=2020-01-01&end=2020-01-31&alt=184' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ### Response #### Success Response (200) - **date** (String) - The date string (YYYY-MM-DD) - **tavg** (Float) - The average air temperature in °C - **tmin** (Float) - The minimum air temperature in °C - **tmax** (Float) - The maximum air temperature in °C - **prcp** (Float) - The daily precipitation total in mm - **snow** (Integer) - The maximum snow depth in mm - **wdir** (Integer) - The average wind direction in degrees (°) - **wspd** (Float) - The average wind speed in km/h - **wpgt** (Float) - The peak wind gust in km/h - **pres** (Float) - The average sea-level air pressure in hPa - **tsun** (Integer) - The daily sunshine total in minutes (m) #### Response Example { "date": "2020-02-01", "tavg": 11.4, "tmin": 7.8, "tmax": 12.8, "prcp": 10.1, "snow": 0, "wdir": 210, "wspd": 22.3, "wpgt": 126, "pres": 1009.6, "tsun": 0 } ``` -------------------------------- ### GET meteostat.stations.nearby Source: https://dev.meteostat.net/python/stations/nearby Retrieves a list of weather stations near a specified latitude and longitude point. ```APIDOC ## GET meteostat.stations.nearby ### Description Finds weather stations near a specific geographical point defined by latitude and longitude. ### Method GET ### Endpoint meteostat.stations.nearby ### Parameters #### Path Parameters - **point** (Point object) - Required - The geographical location defined by latitude, longitude, and optional elevation. #### Query Parameters - **limit** (integer) - Optional - The maximum number of stations to return. ### Request Example ```python import meteostat as ms POINT = ms.Point(50.1155, 8.6842, 113) stations = ms.stations.nearby(POINT, limit=4) ``` ### Response #### Success Response (200) - **stations** (DataFrame) - A list of nearby weather stations including name, country, region, latitude, longitude, elevation, timezone, and distance. ``` -------------------------------- ### Nearby Stations Endpoint URL Source: https://dev.meteostat.net/api/stations/nearby The base URL for the GET request to retrieve nearby weather stations. ```text GET https://meteostat.p.rapidapi.com/stations/nearby ``` -------------------------------- ### Format the codebase Source: https://dev.meteostat.net/python/contributing/linting Execute this command to automatically fix linting issues and format the entire codebase according to Ruff's standards. ```bash poetry run ruff format ``` -------------------------------- ### Nearby Stations cURL Request Source: https://dev.meteostat.net/api/stations/nearby Example request using cURL. Replace {key} with your personal API key. ```bash curl --request GET \ --url 'https://meteostat.p.rapidapi.com/stations/nearby?lat=51.5085&lon=-0.1257&limit=5' \ --header 'x-rapidapi-host: meteostat.p.rapidapi.com' \ --header 'x-rapidapi-key: {key}' ``` -------------------------------- ### GET /stations/meta Source: https://dev.meteostat.net/api/stations/meta Retrieves metadata for a specific weather station identified by its Meteostat ID, WMO ID, or ICAO ID. ```APIDOC ## GET https://meteostat.p.rapidapi.com/stations/meta ### Description Provides information describing a specific weather station, including latitude, longitude, elevation, and data availability. ### Method GET ### Endpoint https://meteostat.p.rapidapi.com/stations/meta ### Parameters #### Query Parameters - **id** (String) - Optional - The Meteostat ID of the weather station - **wmo** (Integer) - Optional - The WMO ID of the weather station - **icao** (String) - Optional - The ICAO ID of the weather station ### Response #### Success Response (200) - **id** (String) - Meteostat ID - **name** (Object) - Name in different languages - **country** (String) - ISO 3166-1 alpha-2 country code - **region** (String) - ISO 3166-2 state or region code - **identifiers** (Object) - National, WMO, and ICAO IDs - **location** (Object) - Latitude, longitude, and elevation - **timezone** (String) - Time zone - **inventory** (Object) - Available data by frequency (model, hourly, daily, monthly, normals) #### Response Example { "meta": { "exec_time": 0.003, "generated": "2021-06-21 18:23:58" }, "data": { "id": "10637", "name": { "de": "Frankfurt Flughafen", "es": "Aeropuerto de Fráncfort", "en": "Frankfurt Airport" }, "country": "DE", "region": "HE", "identifier": { "national": "01420", "wmo": "10637", "icao": "EDDF" }, "location": { "latitude": 50.05, "longitude": 8.6, "elevation": 111 }, "timezone": "Europe/Berlin", "inventory": { "model": { "start": "2018-01-28", "end": "2021-06-29" }, "hourly": { "start": "1926-01-01", "end": "2021-06-20" }, "daily": { "start": "1934-05-01", "end": "2021-06-18" }, "monthly": { "start": 1934, "end": 2021 }, "normals": { "start": 1961, "end": 2020 } } } } ``` -------------------------------- ### Fetch Monthly Data with Specific Parameters Source: https://dev.meteostat.net/cli/timeseries/monthly Retrieve monthly weather summaries for a station, specifying the desired parameters (e.g., average temperature, precipitation). ```bash meteo monthly 10637 -s 2020 -e 2024 --parameters tavg,prcp ``` -------------------------------- ### Meteostat CLI Configuration Usage Source: https://dev.meteostat.net/cli/configuration General syntax for configuring Meteostat CLI settings. ```bash meteo config [KEY VALUE] [OPTIONS] ``` -------------------------------- ### GET Monthly Data Source: https://dev.meteostat.net/data/timeseries/monthly Retrieves a GZ compressed CSV file containing monthly weather data for a specified weather station. ```APIDOC ## GET /monthly/{station}.csv.gz ### Description This endpoint provides one GZ compressed CSV file per weather station, including model data as a substitute for missing observations. ### Method GET ### Endpoint https://data.meteostat.net/monthly/{station}.csv.gz ### Parameters #### Path Parameters - **station** (string) - Required - The ID of the weather station. ### Request Example (No request body for this endpoint) ### Response #### Success Response (200) A GZ compressed CSV file containing monthly weather data. #### Response Example (Binary data - CSV content) ### Data Structure CSV files use commas as separators and include a header row. Each data column has a corresponding source column with the `_source` suffix. Monthly data may be aggregated from multiple sources; in such cases, the source column will list the data source IDs separated by a single whitespace. ``` -------------------------------- ### Hourly Data API Endpoint Source: https://dev.meteostat.net/api/stations/hourly Use this GET endpoint to retrieve hourly weather observations. The maximum query range is 30 days. ```http GET https://meteostat.p.rapidapi.com/stations/hourly ``` -------------------------------- ### Lint the entire codebase Source: https://dev.meteostat.net/python/contributing/linting Run this command in the root directory to analyze the entire codebase for linting issues. ```bash poetry run ruff check ``` -------------------------------- ### Fetch Monthly Data and Output to Excel Source: https://dev.meteostat.net/cli/timeseries/monthly Retrieve monthly weather summaries and export the data directly to an Excel file. ```bash meteo monthly 10637 -s 2020 -e 2024 --output data.xlsx ``` -------------------------------- ### Fetch Specific Daily Data Parameters Source: https://dev.meteostat.net/cli/timeseries/daily Retrieve specific weather parameters (e.g., average temperature, min/max temperature, precipitation) for a station within a date range. ```bash meteo daily 10637 -s 2024-01-01 -e 2024-12-31 --parameters tavg,tmin,tmax,prcp ``` -------------------------------- ### Configure MCP Server in Agent Source: https://dev.meteostat.net/api/mcp Add this configuration to your AI agent's settings to connect to the Meteostat MCP server. Replace 'YOUR_RAPIDAPI_KEY' with your actual RapidAPI key. ```json { "mcpServers": { "meteostat": { "command": "npx", "args": [ "mcp-remote", "https://mcp.rapidapi.com", "--header", "x-api-host: meteostat.p.rapidapi.com", "--header", "x-api-key: YOUR_RAPIDAPI_KEY" ] } } } ``` -------------------------------- ### Fetch Hourly Weather Data with Python Source: https://dev.meteostat.net/python/timeseries/hourly Uses the Meteostat library to retrieve and display hourly weather observations for a specific station and date range. ```python # Import Meteostat library and dependencies from datetime import datetime import meteostat as ms # Set time period start = datetime(2018, 1, 1) end = datetime(2018, 12, 31, 23, 59) # Get hourly data ts = ms.hourly(ms.Station(id='72219'), start, end) df = ts.fetch() # Print DataFrame print(df) ```