MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / get_apod_data

Function get_apod_data

web_programming/nasa_data.py:11–17  ·  view source on GitHub ↗

Get the APOD(Astronomical Picture of the day) data Get your API Key from: https://api.nasa.gov/

(api_key: str)

Source from the content-addressed store, hash-verified

9
10
11def get_apod_data(api_key: str) -> dict:
12 """
13 Get the APOD(Astronomical Picture of the day) data
14 Get your API Key from: https://api.nasa.gov/
15 """
16 url = "https://api.nasa.gov/planetary/apod"
17 return httpx.get(url, params={"api_key": api_key}, timeout=10).json()
18
19
20def save_apod(api_key: str, path: str = ".") -> dict:

Callers 1

save_apodFunction · 0.85

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected