Not sure if this is the right place to put this. I am trying to understand how i can get a json script to run in HA and output results, once i get the results I can setup a notification.
I want to search certain flights from google flights api. I already have the json from the google playground.
I would like it to check every hour and display the results in a card.;
{
"search_metadata":
{
"id":
"66e4444e0053c71a576c1684",
"status":
"Success",
"json_endpoint":
"https://serpapi.com/searches/a308ad8b26a7171f/66e4444e0053c71a576c1684.json",
"created_at":
"2024-09-13 13:55:26 UTC",
"processed_at":
"2024-09-13 13:55:26 UTC",
"google_flights_url":
"https://www.google.com/travel/flights?hl=en&gl=us&curr=USD&tfs=CBwQAhomEgoyMDI0LTEyLTIwMgJVQUAESAtqBwgBEgNCSUxyBwgBEgNBVEwaIhIKMjAyNC0xMi0yNjICVUFqBwgBEgNBVExyBwgBEgNCSUxCBAEBAgJIAXABmAEB",
"raw_html_file":
"https://serpapi.com/searches/a308ad8b26a7171f/66e4444e0053c71a576c1684.html",
"prettify_html_file":
"https://serpapi.com/searches/a308ad8b26a7171f/66e4444e0053c71a576c1684.prettify",
"total_time_taken":
4.69
},
"search_parameters":
{
"engine":
"google_flights",
"hl":
"en",
"gl":
"us",
"departure_id":
"BIL",
"arrival_id":
"ATL",
"outbound_date":
"2024-12-20",
"return_date":
"2024-12-26",
"adults":
2,
"children":
2,
"include_airlines":
"UA",
"outbound_times":
"4,11",
"currency":
"USD"
},
"other_flights":
[
{
"flights":
[
{
"departure_airport":
{
"name":
"Billings-Logan International Airport",
"id":
"BIL",
"time":
"2024-12-20 07:00"
},
"arrival_airport":
{
"name":
"Denver International Airport",
"id":
"DEN",
"time":
"2024-12-20 08:37"
},
"duration":
97,
"airplane":
"Boeing 737",
"airline":
"United",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"travel_class":
"Economy",
"flight_number":
"UA 671",
"legroom":
"30 in",
"extensions":
[
"Average legroom (30 in)",
"Wi-Fi for a fee",
"Stream media to your device",
"Carbon emissions estimate: 356 kg"
]
},
{
"departure_airport":
{
"name":
"Denver International Airport",
"id":
"DEN",
"time":
"2024-12-20 17:45"
},
"arrival_airport":
{
"name":
"Hartsfield-Jackson Atlanta International Airport",
"id":
"ATL",
"time":
"2024-12-20 22:45"
},
"duration":
180,
"airplane":
"Airbus A319",
"airline":
"United",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"travel_class":
"Economy",
"flight_number":
"UA 1305",
"legroom":
"30 in",
"extensions":
[
"Average legroom (30 in)",
"Wi-Fi for a fee",
"In-seat power outlet",
"Stream media to your device",
"Carbon emissions estimate: 783 kg"
],
"often_delayed_by_over_30_min":
true
}
],
"layovers":
[
{
"duration":
548,
"name":
"Denver International Airport",
"id":
"DEN"
}
],
"total_duration":
825,
"carbon_emissions":
{
"this_flight":
1139000,
"typical_for_this_route":
1333000,
"difference_percent":
-15
},
"price":
4111,
"type":
"Round trip",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"extensions":
[
"Checked baggage for a fee",
"Bag and fare conditions depend on the return flight"
],
"departure_token":
"WyJDalJJVG5abFVFWTNUV28xV0c5QlEwZFJTMEZDUnkwdExTMHRMUzB0TFhCcVltTjFOa0ZCUVVGQlIySnJVa1U0UzFWM1RsVkJFZ3hWUVRZM01YeFZRVEV6TURVYUN3aklpeGtRQWhvRFZWTkVPQnh3eUlzWiIsW1siQklMIiwiMjAyNC0xMi0yMCIsIkRFTiIsbnVsbCwiVUEiLCI2NzEiXSxbIkRFTiIsIjIwMjQtMTItMjAiLCJBVEwiLG51bGwsIlVBIiwiMTMwNSJdXV0="
},
{
"flights":
[
{
"departure_airport":
{
"name":
"Billings-Logan International Airport",
"id":
"BIL",
"time":
"2024-12-20 07:00"
},
"arrival_airport":
{
"name":
"Denver International Airport",
"id":
"DEN",
"time":
"2024-12-20 08:37"
},
"duration":
97,
"airplane":
"Boeing 737",
"airline":
"United",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"travel_class":
"Economy",
"flight_number":
"UA 671",
"legroom":
"30 in",
"extensions":
[
"Average legroom (30 in)",
"Wi-Fi for a fee",
"Stream media to your device",
"Carbon emissions estimate: 356 kg"
]
},
{
"departure_airport":
{
"name":
"Denver International Airport",
"id":
"DEN",
"time":
"2024-12-20 10:02"
},
"arrival_airport":
{
"name":
"Hartsfield-Jackson Atlanta International Airport",
"id":
"ATL",
"time":
"2024-12-20 15:02"
},
"duration":
180,
"airplane":
"Airbus A320",
"airline":
"United",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"travel_class":
"Economy",
"flight_number":
"UA 2415",
"legroom":
"30 in",
"extensions":
[
"Average legroom (30 in)",
"Wi-Fi for a fee",
"Stream media to your device",
"Carbon emissions estimate: 725 kg"
]
}
],
"layovers":
[
{
"duration":
85,
"name":
"Denver International Airport",
"id":
"DEN"
}
],
"total_duration":
362,
"carbon_emissions":
{
"this_flight":
1082000,
"typical_for_this_route":
1333000,
"difference_percent":
-19
},
"price":
4242,
"type":
"Round trip",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"extensions":
[
"Checked baggage for a fee",
"Bag and fare conditions depend on the return flight"
],
"departure_token":
"WyJDalJJVG5abFVFWTNUV28xV0c5QlEwZFJTMEZDUnkwdExTMHRMUzB0TFhCcVltTjFOa0ZCUVVGQlIySnJVa1U0UzFWM1RsVkJFZ3hWUVRZM01YeFZRVEkwTVRVYUN3akE4UmtRQWhvRFZWTkVPQnh3d1BFWiIsW1siQklMIiwiMjAyNC0xMi0yMCIsIkRFTiIsbnVsbCwiVUEiLCI2NzEiXSxbIkRFTiIsIjIwMjQtMTItMjAiLCJBVEwiLG51bGwsIlVBIiwiMjQxNSJdXV0="
},
{
"flights":
[
{
"departure_airport":
{
"name":
"Billings-Logan International Airport",
"id":
"BIL",
"time":
"2024-12-20 10:55"
},
"arrival_airport":
{
"name":
"Denver International Airport",
"id":
"DEN",
"time":
"2024-12-20 12:45"
},
"duration":
110,
"airplane":
"Canadair Reg. Jet",
"airline":
"United",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"travel_class":
"Economy",
"flight_number":
"UA 4728",
"legroom":
"31 in",
"extensions":
[
"Average legroom (31 in)",
"Carbon emissions estimate: 743 kg"
]
},
{
"departure_airport":
{
"name":
"Denver International Airport",
"id":
"DEN",
"time":
"2024-12-20 17:45"
},
"arrival_airport":
{
"name":
"Hartsfield-Jackson Atlanta International Airport",
"id":
"ATL",
"time":
"2024-12-20 22:45"
},
"duration":
180,
"airplane":
"Airbus A319",
"airline":
"United",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"travel_class":
"Economy",
"flight_number":
"UA 1305",
"legroom":
"30 in",
"extensions":
[
"Average legroom (30 in)",
"Wi-Fi for a fee",
"In-seat power outlet",
"Stream media to your device",
"Carbon emissions estimate: 783 kg"
],
"often_delayed_by_over_30_min":
true
}
],
"layovers":
[
{
"duration":
300,
"name":
"Denver International Airport",
"id":
"DEN"
}
],
"total_duration":
590,
"carbon_emissions":
{
"this_flight":
1526000,
"typical_for_this_route":
1333000,
"difference_percent":
14
},
"price":
4615,
"type":
"Round trip",
"airline_logo":
"https://www.gstatic.com/flights/airline_logos/70px/UA.png",
"extensions":
[
"Checked baggage for a fee",
"Bag and fare conditions depend on the return flight"
],
"departure_token":
"WyJDalJJVG5abFVFWTNUV28xV0c5QlEwZFJTMEZDUnkwdExTMHRMUzB0TFhCcVltTjFOa0ZCUVVGQlIySnJVa1U0UzFWM1RsVkJFZzFWUVRRM01qaDhWVUV4TXpBMUdnc0lxSlVjRUFJYUExVlRSRGdjY0tpVkhBPT0iLFtbIkJJTCIsIjIwMjQtMTItMjAiLCJERU4iLG51bGwsIlVBIiwiNDcyOCJdLFsiREVOIiwiMjAyNC0xMi0yMCIsIkFUTCIsbnVsbCwiVUEiLCIxMzA1Il1dXQ=="
}
],
"airports":
[
{
"departure":
[
{
"airport":
{
"id":
"BIL",
"name":
"Billings-Logan International Airport"
},
"city":
"Billings",
"country":
"United States",
"country_code":
"US",
"image":
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQgKpYTShD8Y1ajvIxvTn5UJUgbuPMpR04SeugPD51G1xB9xy7kfcd-6ttDN4_8olBl5Nbcxxsp7WfoXQ",
"thumbnail":
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRJAF5D7WB_lySVbDR69lNHKhPuxA0s3r4y6Twfz0Xkb0F3TcR1lz8qTa985V575PNvetZGtjw36gvwRtZ2qwiXX5mTTG-mtOIierqTXbM"
}
],
"arrival":
[
{
"airport":
{
"id":
"ATL",
"name":
"Hartsfield-Jackson Atlanta International Airport"
},
"city":
"Atlanta",
"country":
"United States",
"country_code":
"US",
"image":
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQYBXd-jsaFCOrq3Ftbagud_RXYRp8gK_jeDmxAfPmI5pP7SIRedYhExpUTLErX68PeHFvOzs8P_D0v_w",
"thumbnail":
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRJh6WEANkd6cril2a8Csnk2i_WTs-ZTUE-pamQ4iTfpTi0hlx5P9xhDKrUeBWRPb-4hiLgvoegdgPZ2t2R8qpkN_a7BzJjUNSnSonV664"
}
]
},
{
"departure":
[
{
"airport":
{
"id":
"ATL",
"name":
"Hartsfield-Jackson Atlanta International Airport"
},
"city":
"Atlanta",
"country":
"United States",
"country_code":
"US",
"image":
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQYBXd-jsaFCOrq3Ftbagud_RXYRp8gK_jeDmxAfPmI5pP7SIRedYhExpUTLErX68PeHFvOzs8P_D0v_w",
"thumbnail":
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRJh6WEANkd6cril2a8Csnk2i_WTs-ZTUE-pamQ4iTfpTi0hlx5P9xhDKrUeBWRPb-4hiLgvoegdgPZ2t2R8qpkN_a7BzJjUNSnSonV664"
}
],
"arrival":
[
{
"airport":
{
"id":
"BIL",
"name":
"Billings-Logan International Airport"
},
"city":
"Billings",
"country":
"United States",
"country_code":
"US",
"image":
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQgKpYTShD8Y1ajvIxvTn5UJUgbuPMpR04SeugPD51G1xB9xy7kfcd-6ttDN4_8olBl5Nbcxxsp7WfoXQ",
"thumbnail":
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRJAF5D7WB_lySVbDR69lNHKhPuxA0s3r4y6Twfz0Xkb0F3TcR1lz8qTa985V575PNvetZGtjw36gvwRtZ2qwiXX5mTTG-mtOIierqTXbM"
}
]
}
]
}