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?

Best Answer

  • ArborRose
    ArborRose 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.

    ** 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

    GET 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
    import requests
    
    

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

    params = {
    "location": "37.7749,-122.4194", # Example: San Francisco
    "startDate": "2024-11-01",
    "endDate": "2024-11-05",
    "unitGroup": "metric",
    "key": api_key,
    "contentType": "json"
    }

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

    # Check the response
    if response.status_code == 200:
    weather_data = response.json()
    print(weather_data)
    else:
    print(f"Error: {response.status_code}, {response.text}")

    Test in browser (replace the API key):

    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! **

  • ArborRose
    ArborRose 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.

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