Code Monkey home page Code Monkey logo

openmeteo's Introduction

Open-Meteo for Golang

Open-Meteo is an open-source weather API with free access for non-commercial use. No API key is required. You can use it immediately!

Install

go get github.com/innotechdevops/openmeteo

How to use

API Document https://open-meteo.com/en/docs

param := openmeteo.Parameter{
    Latitude:       openmeteo.Float32(13.7248785),
    Longitude:      openmeteo.Float32(100.4683022),
    Hourly:         &[]string{
        openmeteo.HourlyTemperature2m,
        openmeteo.HourlyRelativeHumidity2m,
        openmeteo.HourlyWindSpeed10m,
    },
    CurrentWeather: openmeteo.Bool(true),
}

m := openmeteo.New()
resp, err := m.Execute(param)

Output

{
  "latitude":13.75,
  "longitude":100.5,
  "generationtime_ms":0.18894672393798828,
  "utc_offset_seconds":0,
  "timezone":"GMT",
  "timezone_abbreviation":"GMT",
  "elevation":5.0,
  "current_weather":{
    "temperature":30.6,
    "windspeed":5.6,
    "winddirection":195.0,
    "weathercode":3,
    "is_day":0,
    "time":"2023-06-02T15:00"
  },
  "hourly_units":{
    "time":"iso8601",
    "temperature_2m":"°C",
    "relativehumidity_2m":"%",
    "windspeed_10m":"km/h"
  },
  "hourly":{
    "time":["2023-06-02T00:00"],
    "temperature_2m":[28.8],
    "relativehumidity_2m":[77],
    "windspeed_10m":[3.3]
  }
}

openmeteo's People

Contributors

mladblum avatar prongbang avatar innotechdevops avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.