influxdata / influxdata/telegraf
[inputs.openweathermap] Version 2.5 of the API is no longer supported
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Relevant telegraf.conf
```toml
[[inputs.openweathermap]]
## OpenWeatherMap API key.
app_id = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
## City ID's to collect weather data from.
city_id = ["0000000"]
## 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".
units = "imperial"
## Query interval; OpenWeatherMap weather data is updated every 10
## minutes.
interval = "10m"
```
### Logs from Telegraf
```text
2025-08-29T05:40:00Z E! [inputs.openweathermap] Error in plugin: querying "https://api.openweathermap.org/data/2.5/group?APPID=xxxxxxxxxxxxxxxxx&id=0000000&lang=en&units=imperial" failed: https://api.openweathermap.org/data/2.5/group?APPID=xxxxxxxxxxxxxxxxx&id=0000000&lang=en&units=imperial returned HTTP status 401 Unauthorized
```
### System info
telegraf:1.35.4-alpine, Debian 13, k8s v1.33.3
### Docker
_No response_
### Steps to reproduce
1. Attempt to create and run the openweathermap input with any valid configuration
### Expected behavior
Input is able to hit and retrieve data from OpenWeathermap
### Actual behavior
Telegraf returns a 401 error as version 2.5 of the API is no longer being hosted
### Additional info
It seems that access to the 2.5 version of the API has been closed since June 2024, but the endpoint was still functional until today: https://openweathermap.org/one-call-transfer
Seems that the input will need to be fixed to utilize the 3.0 version of the API, as described in the linked blog post.
Contributor guide
Research direction
Start at the inputs.openweathermap entry point and inspect how it builds the current OpenWeatherMap 2.5 requests. Compare those requests with the OpenWeatherMap 3.0 API documentation, then reproduce the supplied configuration and verify that weather and forecast collection no longer returns HTTP 401.】【。
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100