Skip to content

Commit

Permalink
Switch OneCall to API 3.0 (#110)
Browse files Browse the repository at this point in the history
Switching from the discontinued 2.5 to using the 3.0 OneCall API works
for a lot of calls. Needs more work to be fully compatible.
Other 2.5 API's are still available.
  • Loading branch information
kvij authored Jul 1, 2024
1 parent 409f46d commit 4f2d761
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openweathermap.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
var DataUnits = map[string]string{"C": "metric", "F": "imperial", "K": "internal"}
var (
baseURL = "https://api.openweathermap.org/data/2.5/weather?%s"
onecallURL = "https://api.openweathermap.org/data/2.5/onecall?%s"
onecallURL = "https://api.openweathermap.org/data/3.0/onecall?%s"
iconURL = "https://openweathermap.org/img/w/%s"
groupURL = "http://api.openweathermap.org/data/2.5/group?%s"
stationURL = "https://api.openweathermap.org/data/2.5/station?id=%d"
Expand Down Expand Up @@ -185,8 +185,8 @@ type Clouds struct {
All int `json:"all"`
}

// return key
// }
// return key
// }
func setKey(key string) (string, error) {
if err := ValidAPIKey(key); err != nil {
return "", err
Expand Down

0 comments on commit 4f2d761

Please sign in to comment.