Python, RapidAPI Terms

APIs and tooling like Jupyter docs allows many opportunities in fields like Data Science. As more and more developers use APIs, they build standards in how you setup a client, send requests and receive information...

Covid19 RapidAPI Example

To begin the API journey. You need to find an API provider.

  • RapidAPI is a great option. You must setup and account, but there are many free options.
  • Goto this page for starters, the Corona virus World and India data- Under Code Snippets pick Python - Requests

RapidAPI, you will select Python Requests type of code to work with you Notebook.

  • The url is the endpoint to which the API is directed
  • The headers is a dictionary data structure to send special messaging to the endpoint
  • The requests.request() python function is used to send a request and retrieve their responses
  • The response variable receives result of of the request in JSON text

Next step, is to format the response according to your data science needs

"""
Requests is a HTTP library for the Python programming language. 
The goal of the project is to make HTTP requests simpler and more human-friendly. 
"""
import requests

"""
RapidAPI is the world's largest API Marketplace. 
Developers use Rapid API to discover and connect to thousands of APIs. 
"""
url = "https://corona-virus-world-and-india-data.p.rapidapi.com/api"
headers = {
    'x-rapidapi-key': "dec069b877msh0d9d0827664078cp1a18fajsn2afac35ae063",
    'x-rapidapi-host': "corona-virus-world-and-india-data.p.rapidapi.com"
}

# Request Covid Data
response = requests.request("GET", url, headers=headers)
# print(response.text)  # uncomment this line to see raw data

# This code looks for "world data"
print("World Totals")
world = response.json().get('world_total')  # turn response to json() so we can extract "world_total"
for key, value in world.items():  # this finds key, value pairs in country
    print(key, value)

print()

# This code looks for USA in "countries_stats"
print("Country Totals")
countries = response.json().get('countries_stat')
for country in countries:  # countries is a list
    if country["country_name"] == "USA":  # this filters for USA
        for key, value in country.items():  # this finds key, value pairs in country
            print(key, value)
World Totals
total_cases 509,268,964
new_cases 204,268
total_deaths 6,242,509
new_deaths 630
total_recovered 461,827,849
active_cases 41,198,606
serious_critical 42,510
total_cases_per_1m_population 65,334
deaths_per_1m_population 800.9
statistic_taken_at 2022-04-24 11:18:01

Country Totals
country_name USA
cases 82,649,779
deaths 1,018,316
region 
total_recovered 80,434,925
new_deaths 0
new_cases 0
serious_critical 1,465
active_cases 1,196,538
total_cases_per_1m_population 247,080
deaths_per_1m_population 3,044
total_tests 1,000,275,726
tests_per_1m_population 2,990,303

Digital Coin Example

This example provides digital coin feedback (ie Bitcoin). It include popularity, price, symbols, etc.

  • A valid X-RapidAPI-Key is required. Look in code for link to RapidAPI page
  • Read all comments in code for further guidance
# RapidAPI page https://rapidapi.com/Coinranking/api/coinranking1/

# Begin Rapid API Code
import requests

url = "https://coinranking1.p.rapidapi.com/coins"
querystring = {"referenceCurrencyUuid":"yhjMzLPhuIDl","timePeriod":"24h","tiers[0]":"1","orderBy":"marketCap","orderDirection":"desc","limit":"50","offset":"0"}
headers = {
	"X-RapidAPI-Key": "jcmbea0fa2ff5msh7f14bf69be38ca6p175482jsn6c4988114560",  # place your key here
	"X-RapidAPI-Host": "coinranking1.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
# End Rapid API Code
json = response.json()  # convert response to python json object

# Observe data from an API.  This is how data transports over the internet in a "JSON" text form
# - The JSON "text" is formed in dictionary {} and list [] divisions
# - To read the result, Data Scientist of  Developer converts JSON into human readable form
# - Review the first line, look for the keys --  "status" and "data"
{"message":"You are not subscribed to this API."}

Formatting Digital Coin example

JSON text transferred from the API in the previous cell was converted to a Python Dictionary called json. The "coins" in the dictionary contain a list of the most relevant data. Look at the code and comments to see how the original text is turned into something understandable. Additionally, there are error check to make sure we are starting the code with the expectation that the API was run correctly.

"""
This cell is dependent on valid run of API above.
- try and except code is making sure "json" was properly run above
- inside second try is code that is used to process Coin API data

Note.  Run this cell repeatedly to format data without re-activating API
"""

try:
    print("JSON data is Python type: " + str(type(json)))
    try:
        # Extracting Coins JSON status, if the API worked
        status = json.get('status')
        print("API status: " + status)
        print()
        
        # Extracting Coins JSON data, data about the coins
        data = json.get('data')
        
        # Procedural abstraction of Print code for coins
        def print_coin(c):
            print(c["symbol"], c["price"])
            print("Icon Url: " + c["iconUrl"])
            print("Rank Url: " + c["coinrankingUrl"])

        # Coins data was observed to be a list
        for coin in data['coins']:
            print_coin(coin)
            print()
            
    except:
        print("Did you insert a valid key in X-RapidAPI-Key of API cell above?")
        print(json)
except:
    print("This cell is dependent on running API call in cell above!")
JSON data is Python type: <class 'dict'>
Did you insert a valid key in X-RapidAPI-Key of API cell above?
{'message': 'You are not subscribed to this API.'}

Go deeper into APIs

Web Development vs Jupyter Notebook. A notebook is certainly a great place to start. But, for your end of Trimester project we want you to build the skill to reference APIs using a Web Interface. Here are some resources to get you started with this journey.

  • In the Nighthawk Coders APCSP you can find an Overview and Examples using APIs:APCSP APIs menu- Using Covid RapidAPI
    • Frontend. JavaScript frontend code in APCSP Fastpages GitHub repo: https://github.com/nighthawkcoders/APCSP/blob/master/_posts/2022-07-10-PBL-rapidapi.md
    • Backend. </li> </ul> </li>
    • Making a Jokes API
    • </ul> </div> </div> </div>
      import requests
      import json
      
      url = "https://weatherbit-v1-mashape.p.rapidapi.com/forecast/3hourly"
      
      querystring = {"lat":"33.0144484","lon":"-117.1214139","units":"imperial"}
      
      headers = {
      	"X-RapidAPI-Key": "e955c5ce4emsh9bea3b91975a2e4p12a645jsnb1be2d19fa12",
      	"X-RapidAPI-Host": "weatherbit-v1-mashape.p.rapidapi.com"
      }
      
      res = requests.request("GET", url, headers=headers, params=querystring)
      res_json = res.json()
      
      res_str = json.dumps(res_json, indent=2)
      
      print(res_str)
      
      {
        "state_code": "CA",
        "lon": -117.1214,
        "city_name": "Fairbanks Ranch",
        "lat": 33.0144,
        "timezone": "America/Los_Angeles",
        "country_code": "US",
        "data": [
          {
            "ghi": 725.98,
            "dhi": 111.26,
            "precip": 0,
            "weather": {
              "description": "Few clouds",
              "code": 801,
              "icon": "c02d"
            },
            "temp": 71.9,
            "app_temp": 71.9,
            "pop": 0,
            "ozone": 297.5,
            "clouds_hi": 0,
            "clouds_low": 9,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 880.46,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-11T21:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-11T14:00:00",
            "pres": 995.5,
            "clouds": 9,
            "vis": 15,
            "wind_spd": 9.9,
            "rh": 65,
            "wind_cdir_full": "west",
            "slp": 1014.5,
            "datetime": "2022-10-11:21",
            "ts": 1665522000,
            "snow": 0,
            "wind_gust_spd": 10.5,
            "dewpt": 59.5,
            "uv": 5.1,
            "solar_rad": 693.8841,
            "wind_dir": 280
          },
          {
            "ghi": 219.49,
            "dhi": 67.55,
            "precip": 0,
            "weather": {
              "description": "Few clouds",
              "code": 801,
              "icon": "c02d"
            },
            "temp": 69.6,
            "app_temp": 69.8,
            "pop": 0,
            "ozone": 298.5,
            "clouds_hi": 0,
            "clouds_low": 6,
            "clouds_mid": 1,
            "snow_depth": 0,
            "dni": 601.91,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-12T00:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-11T17:00:00",
            "pres": 995,
            "clouds": 6,
            "vis": 12.1,
            "wind_spd": 7.5,
            "rh": 74,
            "wind_cdir_full": "west-southwest",
            "slp": 1014,
            "datetime": "2022-10-12:00",
            "ts": 1665532800,
            "snow": 0,
            "wind_gust_spd": 7.7,
            "dewpt": 61,
            "uv": 1.7,
            "solar_rad": 209.8431,
            "wind_dir": 256
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Few clouds",
              "code": 801,
              "icon": "c02n"
            },
            "temp": 64.7,
            "app_temp": 64.7,
            "pop": 0,
            "ozone": 295.3,
            "clouds_hi": 0,
            "clouds_low": 19,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "NW",
            "timestamp_utc": "2022-10-12T03:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-11T20:00:00",
            "pres": 996.5,
            "clouds": 19,
            "vis": 8.3,
            "wind_spd": 3.5,
            "rh": 90,
            "wind_cdir_full": "northwest",
            "slp": 1015,
            "datetime": "2022-10-12:03",
            "ts": 1665543600,
            "snow": 0,
            "wind_gust_spd": 3.8,
            "dewpt": 61.6,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 306
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 63.9,
            "app_temp": 63.9,
            "pop": 0,
            "ozone": 291.5,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "WNW",
            "timestamp_utc": "2022-10-12T06:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-11T23:00:00",
            "pres": 997.5,
            "clouds": 100,
            "vis": 7.6,
            "wind_spd": 3,
            "rh": 95,
            "wind_cdir_full": "west-northwest",
            "slp": 1016.5,
            "datetime": "2022-10-12:06",
            "ts": 1665554400,
            "snow": 0,
            "wind_gust_spd": 3.7,
            "dewpt": 62.5,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 292
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Broken clouds",
              "code": 803,
              "icon": "c03n"
            },
            "temp": 63.2,
            "app_temp": 63.2,
            "pop": 0,
            "ozone": 289.8,
            "clouds_hi": 0,
            "clouds_low": 55,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-12T09:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-12T02:00:00",
            "pres": 998.5,
            "clouds": 55,
            "vis": 8.1,
            "wind_spd": 3.4,
            "rh": 92,
            "wind_cdir_full": "west",
            "slp": 1016.5,
            "datetime": "2022-10-12:09",
            "ts": 1665565200,
            "snow": 0,
            "wind_gust_spd": 4.2,
            "dewpt": 60.9,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 263
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 63.5,
            "app_temp": 63.5,
            "pop": 0,
            "ozone": 286.5,
            "clouds_hi": 0,
            "clouds_low": 78,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "NW",
            "timestamp_utc": "2022-10-12T12:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-12T05:00:00",
            "pres": 997.5,
            "clouds": 78,
            "vis": 8,
            "wind_spd": 1.5,
            "rh": 92,
            "wind_cdir_full": "northwest",
            "slp": 1016.5,
            "datetime": "2022-10-12:12",
            "ts": 1665576000,
            "snow": 0,
            "wind_gust_spd": 3.3,
            "dewpt": 61.1,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 324
          },
          {
            "ghi": 182.81,
            "dhi": 62.33,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04d"
            },
            "temp": 64.1,
            "app_temp": 64.1,
            "pop": 0,
            "ozone": 282.3,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 559.58,
            "wind_cdir": "NNE",
            "timestamp_utc": "2022-10-12T15:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-12T08:00:00",
            "pres": 999.5,
            "clouds": 100,
            "vis": 8,
            "wind_spd": 1.1,
            "rh": 91,
            "wind_cdir_full": "north-northeast",
            "slp": 1017.5,
            "datetime": "2022-10-12:15",
            "ts": 1665586800,
            "snow": 0,
            "wind_gust_spd": 1.8,
            "dewpt": 61.4,
            "uv": 0.5,
            "solar_rad": 71.47335,
            "wind_dir": 33
          },
          {
            "ghi": 705.29,
            "dhi": 110.03,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04d"
            },
            "temp": 70,
            "app_temp": 70.4,
            "pop": 0,
            "ozone": 278,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 874.32,
            "wind_cdir": "WNW",
            "timestamp_utc": "2022-10-12T18:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-12T11:00:00",
            "pres": 1000,
            "clouds": 100,
            "vis": 10.6,
            "wind_spd": 6.6,
            "rh": 79,
            "wind_cdir_full": "west-northwest",
            "slp": 1018,
            "datetime": "2022-10-12:18",
            "ts": 1665597600,
            "snow": 0,
            "wind_gust_spd": 6.9,
            "dewpt": 63.2,
            "uv": 1.6,
            "solar_rad": 145.4136,
            "wind_dir": 285
          },
          {
            "ghi": 720.92,
            "dhi": 110.99,
            "precip": 0,
            "weather": {
              "description": "Broken clouds",
              "code": 803,
              "icon": "c03d"
            },
            "temp": 70.8,
            "app_temp": 71.4,
            "pop": 0,
            "ozone": 275.8,
            "clouds_hi": 0,
            "clouds_low": 66,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 879.26,
            "wind_cdir": "WNW",
            "timestamp_utc": "2022-10-12T21:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-12T14:00:00",
            "pres": 998.5,
            "clouds": 66,
            "vis": 9.6,
            "wind_spd": 9.5,
            "rh": 82,
            "wind_cdir_full": "west-northwest",
            "slp": 1016.5,
            "datetime": "2022-10-12:21",
            "ts": 1665608400,
            "snow": 0,
            "wind_gust_spd": 10.2,
            "dewpt": 65,
            "uv": 3,
            "solar_rad": 526.4877,
            "wind_dir": 289
          },
          {
            "ghi": 214.79,
            "dhi": 66.93,
            "precip": 0,
            "weather": {
              "description": "Scattered clouds",
              "code": 802,
              "icon": "c02d"
            },
            "temp": 68.9,
            "app_temp": 69.4,
            "pop": 20,
            "ozone": 275.3,
            "clouds_hi": 0,
            "clouds_low": 23,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 597.08,
            "wind_cdir": "WNW",
            "timestamp_utc": "2022-10-13T00:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-12T17:00:00",
            "pres": 997.5,
            "clouds": 23,
            "vis": 9.7,
            "wind_spd": 12.9,
            "rh": 83,
            "wind_cdir_full": "west-northwest",
            "slp": 1016,
            "datetime": "2022-10-13:00",
            "ts": 1665619200,
            "snow": 0,
            "wind_gust_spd": 14.9,
            "dewpt": 63.5,
            "uv": 1.5,
            "solar_rad": 203.25128,
            "wind_dir": 289
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 64.9,
            "app_temp": 64.9,
            "pop": 0,
            "ozone": 273.8,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "NW",
            "timestamp_utc": "2022-10-13T03:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-12T20:00:00",
            "pres": 999,
            "clouds": 100,
            "vis": 7.6,
            "wind_spd": 3.6,
            "rh": 95,
            "wind_cdir_full": "northwest",
            "slp": 1017.5,
            "datetime": "2022-10-13:03",
            "ts": 1665630000,
            "snow": 0,
            "wind_gust_spd": 4.4,
            "dewpt": 63.5,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 326
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 64.1,
            "app_temp": 64.1,
            "pop": 0,
            "ozone": 273.8,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "NNW",
            "timestamp_utc": "2022-10-13T06:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-12T23:00:00",
            "pres": 999,
            "clouds": 100,
            "vis": 7.6,
            "wind_spd": 3.5,
            "rh": 96,
            "wind_cdir_full": "north-northwest",
            "slp": 1017.5,
            "datetime": "2022-10-13:06",
            "ts": 1665640800,
            "snow": 0,
            "wind_gust_spd": 4.1,
            "dewpt": 63,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 332
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 63.2,
            "app_temp": 63.2,
            "pop": 0,
            "ozone": 276.5,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "NNW",
            "timestamp_utc": "2022-10-13T09:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-13T02:00:00",
            "pres": 998,
            "clouds": 100,
            "vis": 0.1,
            "wind_spd": 3.9,
            "rh": 98,
            "wind_cdir_full": "north-northwest",
            "slp": 1016.5,
            "datetime": "2022-10-13:09",
            "ts": 1665651600,
            "snow": 0,
            "wind_gust_spd": 6.8,
            "dewpt": 62.7,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 348
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 62.4,
            "app_temp": 62.4,
            "pop": 0,
            "ozone": 276.5,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "NW",
            "timestamp_utc": "2022-10-13T12:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-13T05:00:00",
            "pres": 997,
            "clouds": 100,
            "vis": 0.1,
            "wind_spd": 2.5,
            "rh": 100,
            "wind_cdir_full": "northwest",
            "slp": 1016,
            "datetime": "2022-10-13:12",
            "ts": 1665662400,
            "snow": 0,
            "wind_gust_spd": 3.9,
            "dewpt": 62.4,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 304
          },
          {
            "ghi": 179.91,
            "dhi": 61.91,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04d"
            },
            "temp": 62.6,
            "app_temp": 62.6,
            "pop": 20,
            "ozone": 273,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 556.1,
            "wind_cdir": "NNE",
            "timestamp_utc": "2022-10-13T15:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-13T08:00:00",
            "pres": 998,
            "clouds": 100,
            "vis": 0.1,
            "wind_spd": 1.8,
            "rh": 98,
            "wind_cdir_full": "north-northeast",
            "slp": 1016.5,
            "datetime": "2022-10-13:15",
            "ts": 1665673200,
            "snow": 0,
            "wind_gust_spd": 1.8,
            "dewpt": 62,
            "uv": 0.5,
            "solar_rad": 70.659904,
            "wind_dir": 13
          },
          {
            "ghi": 701.05,
            "dhi": 109.8,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04d"
            },
            "temp": 67.8,
            "app_temp": 68.3,
            "pop": 0,
            "ozone": 271,
            "clouds_hi": 0,
            "clouds_low": 98,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 873.33,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-13T18:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-13T11:00:00",
            "pres": 997.5,
            "clouds": 98,
            "vis": 8.8,
            "wind_spd": 6,
            "rh": 87,
            "wind_cdir_full": "west",
            "slp": 1016,
            "datetime": "2022-10-13:18",
            "ts": 1665684000,
            "snow": 0,
            "wind_gust_spd": 6,
            "dewpt": 63.8,
            "uv": 1.7,
            "solar_rad": 186.21608,
            "wind_dir": 275
          },
          {
            "ghi": 715.85,
            "dhi": 110.72,
            "precip": 0,
            "weather": {
              "description": "Scattered clouds",
              "code": 802,
              "icon": "c02d"
            },
            "temp": 71.5,
            "app_temp": 71.8,
            "pop": 0,
            "ozone": 270.3,
            "clouds_hi": 0,
            "clouds_low": 23,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 878.06,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-13T21:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-13T14:00:00",
            "pres": 994.5,
            "clouds": 23,
            "vis": 15,
            "wind_spd": 9.3,
            "rh": 74,
            "wind_cdir_full": "west",
            "slp": 1014.5,
            "datetime": "2022-10-13:21",
            "ts": 1665694800,
            "snow": 0,
            "wind_gust_spd": 9.4,
            "dewpt": 62.8,
            "uv": 4.5,
            "solar_rad": 678.1279,
            "wind_dir": 277
          },
          {
            "ghi": 210.14,
            "dhi": 66.32,
            "precip": 0,
            "weather": {
              "description": "Few clouds",
              "code": 801,
              "icon": "c02d"
            },
            "temp": 67.5,
            "app_temp": 67.8,
            "pop": 0,
            "ozone": 269,
            "clouds_hi": 0,
            "clouds_low": 20,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 592.19,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-14T00:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-13T17:00:00",
            "pres": 993,
            "clouds": 20,
            "vis": 15,
            "wind_spd": 7.9,
            "rh": 82,
            "wind_cdir_full": "west",
            "slp": 1013,
            "datetime": "2022-10-14:00",
            "ts": 1665705600,
            "snow": 0,
            "wind_gust_spd": 7.8,
            "dewpt": 61.8,
            "uv": 1.6,
            "solar_rad": 199.88396,
            "wind_dir": 274
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01n"
            },
            "temp": 67.1,
            "app_temp": 67,
            "pop": 0,
            "ozone": 267.5,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "WNW",
            "timestamp_utc": "2022-10-14T03:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-13T20:00:00",
            "pres": 978,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 2.4,
            "rh": 73,
            "wind_cdir_full": "west-northwest",
            "slp": 1013,
            "datetime": "2022-10-14:03",
            "ts": 1665716400,
            "snow": 0,
            "wind_gust_spd": 2.2,
            "dewpt": 58.2,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 302
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01n"
            },
            "temp": 65,
            "app_temp": 65,
            "pop": 0,
            "ozone": 271,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-14T06:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-13T23:00:00",
            "pres": 978,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 1.8,
            "rh": 80,
            "wind_cdir_full": "west",
            "slp": 1013,
            "datetime": "2022-10-14:06",
            "ts": 1665727200,
            "snow": 0,
            "wind_gust_spd": 1.6,
            "dewpt": 58.7,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 269
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01n"
            },
            "temp": 63.3,
            "app_temp": 63.3,
            "pop": 0,
            "ozone": 269.8,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "SSW",
            "timestamp_utc": "2022-10-14T09:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-14T02:00:00",
            "pres": 976.5,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 1.2,
            "rh": 83,
            "wind_cdir_full": "south-southwest",
            "slp": 1011.5,
            "datetime": "2022-10-14:09",
            "ts": 1665738000,
            "snow": 0,
            "wind_gust_spd": 1.4,
            "dewpt": 58,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 212
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01n"
            },
            "temp": 61.6,
            "app_temp": 61.6,
            "pop": 0,
            "ozone": 270.5,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "SW",
            "timestamp_utc": "2022-10-14T12:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-14T05:00:00",
            "pres": 975.5,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 1.2,
            "rh": 86,
            "wind_cdir_full": "southwest",
            "slp": 1010.5,
            "datetime": "2022-10-14:12",
            "ts": 1665748800,
            "snow": 0,
            "wind_gust_spd": 1.4,
            "dewpt": 57.4,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 233
          },
          {
            "ghi": 176.99,
            "dhi": 61.48,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01d"
            },
            "temp": 65.4,
            "app_temp": 65.4,
            "pop": 0,
            "ozone": 272.5,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 552.54,
            "wind_cdir": "S",
            "timestamp_utc": "2022-10-14T15:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-14T08:00:00",
            "pres": 976,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 1.5,
            "rh": 79,
            "wind_cdir_full": "south",
            "slp": 1011.5,
            "datetime": "2022-10-14:15",
            "ts": 1665759600,
            "snow": 0,
            "wind_gust_spd": 1.6,
            "dewpt": 58.8,
            "uv": 1.7,
            "solar_rad": 169.82019,
            "wind_dir": 190
          },
          {
            "ghi": 696.78,
            "dhi": 109.57,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01d"
            },
            "temp": 74.7,
            "app_temp": 74.4,
            "pop": 0,
            "ozone": 272.3,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 872.33,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-14T18:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-14T11:00:00",
            "pres": 975.5,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 5.7,
            "rh": 54,
            "wind_cdir_full": "west-southwest",
            "slp": 1010.5,
            "datetime": "2022-10-14:18",
            "ts": 1665770400,
            "snow": 0,
            "wind_gust_spd": 3.6,
            "dewpt": 57,
            "uv": 5.2,
            "solar_rad": 670.506,
            "wind_dir": 244
          },
          {
            "ghi": 710.79,
            "dhi": 110.44,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01d"
            },
            "temp": 78.2,
            "app_temp": 77.9,
            "pop": 0,
            "ozone": 275,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 876.83,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-14T21:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-14T14:00:00",
            "pres": 974,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 11.1,
            "rh": 47,
            "wind_cdir_full": "west-southwest",
            "slp": 1008.5,
            "datetime": "2022-10-14:21",
            "ts": 1665781200,
            "snow": 0,
            "wind_gust_spd": 7,
            "dewpt": 56.3,
            "uv": 5.3,
            "solar_rad": 684.62256,
            "wind_dir": 254
          },
          {
            "ghi": 205.54,
            "dhi": 65.7,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01d"
            },
            "temp": 73,
            "app_temp": 72.6,
            "pop": 0,
            "ozone": 274.3,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 587.26,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-15T00:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-14T17:00:00",
            "pres": 974,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 7.6,
            "rh": 56,
            "wind_cdir_full": "west-southwest",
            "slp": 1008.5,
            "datetime": "2022-10-15:00",
            "ts": 1665792000,
            "snow": 0,
            "wind_gust_spd": 4.9,
            "dewpt": 56.4,
            "uv": 1.8,
            "solar_rad": 197.96332,
            "wind_dir": 257
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01n"
            },
            "temp": 65.6,
            "app_temp": 65.4,
            "pop": 0,
            "ozone": 277.3,
            "clouds_hi": 0,
            "clouds_low": 0,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-15T03:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-14T20:00:00",
            "pres": 975,
            "clouds": 0,
            "vis": 15,
            "wind_spd": 3.9,
            "rh": 76,
            "wind_cdir_full": "west",
            "slp": 1010,
            "datetime": "2022-10-15:03",
            "ts": 1665802800,
            "snow": 0,
            "wind_gust_spd": 3.4,
            "dewpt": 57.8,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 270
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Few clouds",
              "code": 801,
              "icon": "c02n"
            },
            "temp": 62.6,
            "app_temp": 62.6,
            "pop": 0,
            "ozone": 279,
            "clouds_hi": 0,
            "clouds_low": 11,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-15T06:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-14T23:00:00",
            "pres": 976,
            "clouds": 11,
            "vis": 15,
            "wind_spd": 3.1,
            "rh": 87,
            "wind_cdir_full": "west",
            "slp": 1011,
            "datetime": "2022-10-15:06",
            "ts": 1665813600,
            "snow": 0,
            "wind_gust_spd": 2.7,
            "dewpt": 58.7,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 264
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 60.9,
            "app_temp": 60.9,
            "pop": 0,
            "ozone": 279.3,
            "clouds_hi": 0,
            "clouds_low": 81,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-15T09:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-15T02:00:00",
            "pres": 975.5,
            "clouds": 81,
            "vis": 15,
            "wind_spd": 2,
            "rh": 91,
            "wind_cdir_full": "west",
            "slp": 1011,
            "datetime": "2022-10-15:09",
            "ts": 1665824400,
            "snow": 0,
            "wind_gust_spd": 1.8,
            "dewpt": 58.2,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 265
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 63.3,
            "app_temp": 63.3,
            "pop": 0,
            "ozone": 283,
            "clouds_hi": 0,
            "clouds_low": 98,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-15T12:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-15T05:00:00",
            "pres": 976,
            "clouds": 98,
            "vis": 15,
            "wind_spd": 0.9,
            "rh": 80,
            "wind_cdir_full": "west",
            "slp": 1011,
            "datetime": "2022-10-15:12",
            "ts": 1665835200,
            "snow": 0,
            "wind_gust_spd": 0.9,
            "dewpt": 57.1,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 262
          },
          {
            "ghi": 174.06,
            "dhi": 61.05,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04d"
            },
            "temp": 63.6,
            "app_temp": 63.6,
            "pop": 0,
            "ozone": 287.3,
            "clouds_hi": 0,
            "clouds_low": 97,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 548.89,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-15T15:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-15T08:00:00",
            "pres": 977,
            "clouds": 97,
            "vis": 15,
            "wind_spd": 1.7,
            "rh": 76,
            "wind_cdir_full": "west-southwest",
            "slp": 1012,
            "datetime": "2022-10-15:15",
            "ts": 1665846000,
            "snow": 0,
            "wind_gust_spd": 1.6,
            "dewpt": 55.9,
            "uv": 0.6,
            "solar_rad": 87.99133,
            "wind_dir": 247
          },
          {
            "ghi": 692.48,
            "dhi": 109.34,
            "precip": 0.025,
            "weather": {
              "description": "Drizzle",
              "code": 301,
              "icon": "d02d"
            },
            "temp": 65.8,
            "app_temp": 65.4,
            "pop": 45,
            "ozone": 289.3,
            "clouds_hi": 1,
            "clouds_low": 56,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 871.3,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-15T18:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-15T11:00:00",
            "pres": 977.5,
            "clouds": 56,
            "vis": 14.1,
            "wind_spd": 4.7,
            "rh": 72,
            "wind_cdir_full": "west",
            "slp": 1012.5,
            "datetime": "2022-10-15:18",
            "ts": 1665856800,
            "snow": 0,
            "wind_gust_spd": 2.7,
            "dewpt": 56.5,
            "uv": 3.1,
            "solar_rad": 577.68884,
            "wind_dir": 280
          },
          {
            "ghi": 705.74,
            "dhi": 110.17,
            "precip": 0.066,
            "weather": {
              "description": "Clear Sky",
              "code": 800,
              "icon": "c01d"
            },
            "temp": 69.9,
            "app_temp": 69.6,
            "pop": 65,
            "ozone": 288.5,
            "clouds_hi": 76,
            "clouds_low": 70,
            "clouds_mid": 14,
            "snow_depth": 0,
            "dni": 875.6,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-15T21:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-15T14:00:00",
            "pres": 976,
            "clouds": 70,
            "vis": 4.3,
            "wind_spd": 10,
            "rh": 65,
            "wind_cdir_full": "west",
            "slp": 1011,
            "datetime": "2022-10-15:21",
            "ts": 1665867600,
            "snow": 0,
            "wind_gust_spd": 6.5,
            "dewpt": 57.6,
            "uv": 2.7,
            "solar_rad": 482.5961,
            "wind_dir": 268
          },
          {
            "ghi": 201,
            "dhi": 65.08,
            "precip": 0.098,
            "weather": {
              "description": "Light shower rain",
              "code": 520,
              "icon": "r04d"
            },
            "temp": 64,
            "app_temp": 64,
            "pop": 75,
            "ozone": 292.8,
            "clouds_hi": 100,
            "clouds_low": 73,
            "clouds_mid": 96,
            "snow_depth": 0,
            "dni": 582.27,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-16T00:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-15T17:00:00",
            "pres": 976,
            "clouds": 96,
            "vis": 13.5,
            "wind_spd": 5.1,
            "rh": 80,
            "wind_cdir_full": "west",
            "slp": 1011.5,
            "datetime": "2022-10-16:00",
            "ts": 1665878400,
            "snow": 0,
            "wind_gust_spd": 5,
            "dewpt": 57.7,
            "uv": 0.6,
            "solar_rad": 82.54489,
            "wind_dir": 275
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0.02,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 62.6,
            "app_temp": 62.6,
            "pop": 40,
            "ozone": 298,
            "clouds_hi": 96,
            "clouds_low": 99,
            "clouds_mid": 99,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-16T03:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-15T20:00:00",
            "pres": 978,
            "clouds": 99,
            "vis": 15,
            "wind_spd": 3.1,
            "rh": 81,
            "wind_cdir_full": "west",
            "slp": 1013,
            "datetime": "2022-10-16:03",
            "ts": 1665889200,
            "snow": 0,
            "wind_gust_spd": 2,
            "dewpt": 56.7,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 273
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 62.2,
            "app_temp": 62.2,
            "pop": 0,
            "ozone": 297.8,
            "clouds_hi": 0,
            "clouds_low": 51,
            "clouds_mid": 100,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "SSW",
            "timestamp_utc": "2022-10-16T06:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-15T23:00:00",
            "pres": 977,
            "clouds": 100,
            "vis": 15,
            "wind_spd": 4.4,
            "rh": 83,
            "wind_cdir_full": "south-southwest",
            "slp": 1012,
            "datetime": "2022-10-16:06",
            "ts": 1665900000,
            "snow": 0,
            "wind_gust_spd": 4.8,
            "dewpt": 56.9,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 203
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 62.3,
            "app_temp": 62.3,
            "pop": 0,
            "ozone": 294,
            "clouds_hi": 5,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "SSW",
            "timestamp_utc": "2022-10-16T09:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-16T02:00:00",
            "pres": 977,
            "clouds": 100,
            "vis": 15,
            "wind_spd": 2.4,
            "rh": 82,
            "wind_cdir_full": "south-southwest",
            "slp": 1012.5,
            "datetime": "2022-10-16:09",
            "ts": 1665910800,
            "snow": 0,
            "wind_gust_spd": 2.5,
            "dewpt": 56.7,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 212
          },
          {
            "ghi": 0,
            "dhi": 0,
            "precip": 0.002,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04n"
            },
            "temp": 61.5,
            "app_temp": 61.5,
            "pop": 20,
            "ozone": 293,
            "clouds_hi": 0,
            "clouds_low": 100,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 0,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-16T12:00:00",
            "pod": "n",
            "timestamp_local": "2022-10-16T05:00:00",
            "pres": 978,
            "clouds": 100,
            "vis": 15,
            "wind_spd": 3.7,
            "rh": 83,
            "wind_cdir_full": "west-southwest",
            "slp": 1013,
            "datetime": "2022-10-16:12",
            "ts": 1665921600,
            "snow": 0,
            "wind_gust_spd": 3.4,
            "dewpt": 56.3,
            "uv": 0,
            "solar_rad": 0,
            "wind_dir": 252
          },
          {
            "ghi": 171.11,
            "dhi": 60.6,
            "precip": 0.002,
            "weather": {
              "description": "Overcast clouds",
              "code": 804,
              "icon": "c04d"
            },
            "temp": 61.4,
            "app_temp": 61.4,
            "pop": 10,
            "ozone": 297,
            "clouds_hi": 0,
            "clouds_low": 93,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 545.16,
            "wind_cdir": "WSW",
            "timestamp_utc": "2022-10-16T15:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-16T08:00:00",
            "pres": 979.5,
            "clouds": 93,
            "vis": 15,
            "wind_spd": 3.4,
            "rh": 85,
            "wind_cdir_full": "west-southwest",
            "slp": 1014.5,
            "datetime": "2022-10-16:15",
            "ts": 1665932400,
            "snow": 0,
            "wind_gust_spd": 3.4,
            "dewpt": 56.9,
            "uv": 0.6,
            "solar_rad": 105.14698,
            "wind_dir": 245
          },
          {
            "ghi": 688.16,
            "dhi": 109.11,
            "precip": 0.001,
            "weather": {
              "description": "Broken clouds",
              "code": 803,
              "icon": "c03d"
            },
            "temp": 65.2,
            "app_temp": 64.9,
            "pop": 20,
            "ozone": 295.8,
            "clouds_hi": 0,
            "clouds_low": 50,
            "clouds_mid": 0,
            "snow_depth": 0,
            "dni": 870.25,
            "wind_cdir": "W",
            "timestamp_utc": "2022-10-16T18:00:00",
            "pod": "d",
            "timestamp_local": "2022-10-16T11:00:00",
            "pres": 980,
            "clouds": 50,
            "vis": 15,
            "wind_spd": 3.6,
            "rh": 73,
            "wind_cdir_full": "west",
            "slp": 1015,
            "datetime": "2022-10-16:18",
            "ts": 1665943200,
            "snow": 0,
            "wind_gust_spd": 2.7,
            "dewpt": 56.4,
            "uv": 3.3,
            "solar_rad": 603.02216,
            "wind_dir": 275
          }
        ]
      }
      
      </div>