This might get you started. I shows how to use the Wikipedia api. Using NASA api's would be similar.
Try the example, then try one of NASA's api's. If you have trouble, show us what you tried and someone will help
Be aware NASA api's require an api key. It is free from Nasa for the asking.
Which api are you trying to access?
Here is an example showing how to use the api of the NWS (USA National Weather Service) ☂️ NWS 🌩️ Weather ❄️ App