From a90d964129482c53ee778e154e6a10cb0f2d40bc Mon Sep 17 00:00:00 2001 From: Uma2197 <124685592+Uma2197@users.noreply.github.com> Date: Sun, 21 Apr 2024 10:08:39 +0200 Subject: [PATCH] Restaurant data main.py Getting hold of the piece of the data that is required for the final output into a variable called restaurant_data --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 06ce130..7434949 100644 --- a/main.py +++ b/main.py @@ -5,5 +5,7 @@ 'User-Agent': 'Mozilla/5.0' } response = requests.get(url=api_endpoint, headers=headers) +response.raise_for_status() api_data = response.json() -print(api_data) \ No newline at end of file +restaurant_data = response.json()["restaurants"] +print(restaurant_data)