12 lines
253 B
Python
12 lines
253 B
Python
|
import requests
|
||
|
import json
|
||
|
|
||
|
api_key = "DEMO_KEY"
|
||
|
|
||
|
def get_weather():
|
||
|
url = f"https://api.nasa.gov/insight_weather/?api_key={api_key}&feedtype=json&ver=1.0"
|
||
|
response = requests.get(url)
|
||
|
return json.loads(response.text)
|
||
|
|
||
|
print(get_weather())
|