Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com

    API Requests in Python

    Windy API v4
    5
    4
    2818
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Drakiro last edited by

      Hello

      I'm looking for a piece of code, an example of code to retrieve weather data (temperature, pressure ...) with a windy API in Python.

      I find examples with open weather map but never for windy.

      Can you help me?

      Thank you

      Korina 1 Reply Last reply Reply Quote 1
      • Korina
        Korina Administrator @Drakiro last edited by

        @drakiro Hello, all the information can be found in our API documentation.

        Korina

        1 Reply Last reply Reply Quote 0
        • G
          g.martins last edited by

          data = {"lat": -39.809,
                  "lon": -16.787,
                  "model": "gfs",
                  "parameters": ["wind"],
                  "key": "abcd1234"
                  }
          header = {"Content-Type" :"application/json"}
          s= requests.post("https://api.windy.com/api/point-forecast/v2", json = data, headers = header)
          print(s.text)
          
          L 1 Reply Last reply Reply Quote 8
          • L
            llandudnocam @g.martins last edited by

            @Korina

            The point-weather API documentation does not make any reference to include application/json content-type header. Please update the so people don't have stumble around trying to find out why their posts are returning 400.

            https://api.windy.com/point-forecast/docs

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
            NodeBB & contributors, OSM & contributors, HERE maps
            Terms and Conditions     Privacy Policy