Skip to content

Commit f4790e9

Browse files
committed
update
1 parent d1f74eb commit f4790e9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Working_With_APIs/API_Practice.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import requests
2+
import json
23

3-
response = requests.get("http://api.open-notify.org/astros.json")
4-
with open("data.json", "w") as f:
5-
f.write(str(response.json()))
4+
parameters = {
5+
"lat": 40.71,
6+
"lon": -74
7+
}
8+
response = requests.get("https://api.open-notify.org/iss-pass.json", params=parameters)
69

10+
string = json.dumps(response.json(), indent=4, sort_keys=True)
11+
12+
print(string)

0 commit comments

Comments
 (0)