Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- import requests
- # requesting the API NASA
- apod_api_request = requests.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY")
- # Parsing data json
- apod = apod_api_request.json()
- # print(apod)
- # Display the data
- print(f"Copyright: {apod['copyright']}")
- print(f"Date : {apod['date']}")
- print(f"Explain : {apod['explanation']}")
- print(f"HURL : {apod['hdurl']}")
- print(f"Media : {apod['media_type']}")
- print(f"Title : {apod['title']}")
- print(f"URL : {apod['url']}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement