Connectors

Connectors

Weather Data

I looked through the community forums and it appears that there is very few discussions about adding weather data to an existing dataset. The few discussions I found didn't seem to offer a solution for my scenario. I have a dataset that contains GPS location information of the property related to the customer. I would like to connect the weather based on the date the property was entered into the system. I would have to call for the weather data each time there is a new entry. What is the best way to accomplish this task?

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Best Answer

  • Coach
    Answer ✓

    Opps….that code example is Python. As @MarkSnodgrass answered, you can find Jupyter Notebooks by going to Data and then follow the three dots. If you want a basic overview, post in questions and one of us will give you a few steps to follow.

    There are also ways to make JSON calls for weather that I have used to do hurricane tracking in a blank brick. But that doesn't seem applicable to your senario.

    image.png

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

Answers

  • @Glory711 There are a few NOAA weather connectors in the app store. I'd suggest checking those out to see if they give you what you need.

  • @MichelleH I pulled in their connectors but they don't seem to have a connector that will allow me to grab data instantly. My need is that a property is entered on a specific date. I need the weather on that date. If a person makes a visit to that property the next day or later, a new line of data will appear in the dataset with the date of that visit. I want the weather for that visit also. Maybe I need to find an API connector that will communicate with the weather database but NOAA doesn't seem to have that capability or I just don't understand what they have out there. On a side note, this is a side project I am working on that gets a backseat to the other things I am handling.

  • I haven't found very many good pre-built weather connectors myself. If you find a good API to query, you can use something like the Jupyter Notebook to pull in the data and create a weather dataset and then use Magic ETL to join that to your property data based on date and location.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • There are various sites that offer current and historical weather data. But most of the historic data requires a paid plan.

    OpenWeatherMap:
    Endpoints for current weather: /weather
    Historic: /timemachine
    Parameters: lat, lon for location, dt for the specific timestamp (Unix format)
    Limit on requests per minute; historic requires paid plan

    Weatherstack:
    Endpoints for historic: /historic
    Parameters: historical_date for the desired date and GPS coordinates
    Limited to real-time data in free tier. Historical data requires paid plan.

    Visual Crossing Weather API
    Historic endpoints: /history
    Parameters: lat and lon for location, and startdate/enddate for the date range.
    URL for API documentation: https://www.visualcrossing.com/weather-api

    Others:
    Meteostat
    Weather API by Tomorrow.io

    1. GET https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/history
    2. ?location=37.7749,-122.4194
    3. &startDate=2024-11-01
    4. &endDate=2024-11-05
    5. &unitGroup=metric
    6. &key=YOUR_API_KEY
    7. &contentType=json
    1. import requests
    2.  


    3. # Define API endpoint and parameters
    4. api_key = "YOUR_API_KEY"
    5. base_url = "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/history"

    6. params = {
    7. "location": "37.7749,-122.4194", # Example: San Francisco
    8. "startDate": "2024-11-01",
    9. "endDate": "2024-11-05",
    10. "unitGroup": "metric",
    11. "key": api_key,
    12. "contentType": "json"
    13. }
    14.  


    15. # Make the API request
    16. response = requests.get(base_url, params=params)
    17.  


    18. # Check the response
    19. if response.status_code == 200:
    20. weather_data = response.json()
    21. print(weather_data)
    22. else:
    23. print(f"Error: {response.status_code}, {response.text}")

    Test in browser (replace the API key):

    1. https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/history?location=37.7749,-122.4194&startDate=2024-11-01&endDate=2024-11-05&unitGroup=metric&key=YOUR_API_KEY&contentType=json

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • Coach
    Answer ✓

    Opps….that code example is Python. As @MarkSnodgrass answered, you can find Jupyter Notebooks by going to Data and then follow the three dots. If you want a basic overview, post in questions and one of us will give you a few steps to follow.

    There are also ways to make JSON calls for weather that I have used to do hurricane tracking in a blank brick. But that doesn't seem applicable to your senario.

    image.png

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In