---
title: ''
description: Telegraf plugin for collecting metrics from OpenWeatherMap
url: https://docs.influxdata.com/telegraf/v1/input-plugins/openweathermap/
estimated_tokens: 1117
product: Telegraf Enterprise
version: v1
publisher: InfluxData
canonical: https://docs.influxdata.com/telegraf/v1/input-plugins/openweathermap/
date: '2026-06-29T20:06:49+01:00'
lastmod: '2026-06-29T20:06:49+01:00'
---

==========

* Telegraf v1.11.0+

[Plugin source](https://github.com/influxdata/telegraf/tree/v1.39.1/plugins/inputs/openweathermap/)[Download configuration](https://raw.githubusercontent.com/influxdata/telegraf/refs/tags/v1.39.1/plugins/inputs/openweathermap/sample.conf)

# OpenWeatherMap Input Plugin

This plugin collects weather and forecast data from the[OpenWeatherMap](https://openweathermap.org) service.

> [!Important]
> To use this plugin you will need an [APP-ID](https://openweathermap.org/appid) to work.

**Introduced in:** Telegraf v1.11.0**Tags:** applications, web**OS support:** all

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks
such as modifying metrics, tags, and fields, creating aliases, and configuring
plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# Read current weather and forecasts data from openweathermap.org
[[inputs.openweathermap]]
  ## OpenWeatherMap API key.
  app_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

  ## City ID's to collect weather data from.
  city_id = ["5391959"]

  ## Language of the description field. Can be one of "ar", "bg",
  ## "ca", "cz", "de", "el", "en", "fa", "fi", "fr", "gl", "hr", "hu",
  ## "it", "ja", "kr", "la", "lt", "mk", "nl", "pl", "pt", "ro", "ru",
  ## "se", "sk", "sl", "es", "tr", "ua", "vi", "zh_cn", "zh_tw"
  # lang = "en"

  ## APIs to fetch; can contain "weather" or "forecast".
  # fetch = ["weather", "forecast"]

  ## OpenWeatherMap base URL
  # base_url = "https://api.openweathermap.org/"

  ## Timeout for HTTP response.
  # response_timeout = "5s"

  ## Preferred unit system for temperature and wind speed. Can be one of
  ## "metric", "imperial", or "standard".
  ## The default is "metric" if not specified.
  # units = "metric"

  ## Query interval to fetch data.
  ## By default the global 'interval' setting is used. You should override the
  ## interval here if the global setting is shorter than 10 minutes as
  ## OpenWeatherMap weather data is only updated every 10 minutes.
  # interval = "10m"
```

City identifiers can be found in the [city list file](http://bulk.openweathermap.org/sample/city.list.json.gz) or you search
your city by name on the [OpenWeatherMap website](https://openweathermap.org) and use the
numeric last element of the resulting URL.
Language identifiers can be found in the [API documentation](https://openweathermap.org/current#multi).

## Metrics

* weather
  * tags:
    * city\_id
    * forecast
    * condition\_id
    * condition\_main

  * fields:
    * cloudiness (int, percent)
    * humidity (int, percent)
    * pressure (float) - atmospheric pressure hPa
    * rain (float) - rain volume in mm for the last 1-3h
      (depending on API response)
    * snow (float) - snow volume in mm for the last 1-3h
      (depending on API response)
    * sunrise (int) - nanoseconds since unix epoch
    * sunset (int) - nanoseconds since unix epoch
    * temperature (float, degrees)
    * feels\_like (float, degrees)
    * visibility (int, meters) - not available on forecast data
    * wind\_degrees (float) - wind direction in degrees
    * wind\_speed (float) - wind speed in meters/sec or miles/sec
    * condition\_description (string, localized long description)
    * condition\_icon

Documentation for condition ID, icon, and main is can be found in the[documentation](https://openweathermap.org/weather-conditions).

## Example Output

```text
weather,city=San\ Francisco,city_id=5391959,condition_id=803,condition_main=Clouds,country=US,forecast=114h,host=robot pressure=1027,temperature=10.09,wind_degrees=34,wind_speed=1.24,condition_description="broken clouds",cloudiness=80i,humidity=67i,rain=0,feels_like=8.9,condition_icon="04n" 1645952400000000000
weather,city=San\ Francisco,city_id=5391959,condition_id=804,condition_main=Clouds,country=US,forecast=117h,host=robot humidity=65i,rain=0,temperature=10.12,wind_degrees=31,cloudiness=90i,pressure=1026,feels_like=8.88,wind_speed=1.31,condition_description="overcast clouds",condition_icon="04n" 1645963200000000000
weather,city=San\ Francisco,city_id=5391959,condition_id=804,condition_main=Clouds,country=US,forecast=120h,host=robot cloudiness=100i,humidity=61i,rain=0,temperature=10.28,wind_speed=1.94,condition_icon="04d",pressure=1027,feels_like=8.96,wind_degrees=16,condition_description="overcast clouds" 1645974000000000000
```
