Get all the stars in the universe at one place with the Stars API.
This is the latest version of the Stars API :
This API was created by Junaid and includes images.
Check out a demo:
Star Data by Junaid
The API is now live at:
Get a JSON list of all the stars in the universe by visiting the index page:
http://127.0.0.1:5000
This API is perfect for creating a flatlist in a React app.
Get specific star data by searching by name:
http://127.0.0.1:5000/stars?name=proxima centauri
Or
http://127.0.0.1:5000/stars?name=sun
Example return:
{"data":{"Distance":1.5813e-05,"Gravity":274.2691614596,"Mass":1.0,"Radius":1.0,"Star_name":"Sun"},"message":"Success !"}
Get an image of a specific star by searching by name:
http://127.0.0.1:5000/stars-img?name=proxima centauri
Or
http://127.0.0.1:5000/stars-img?name=sun
Example return:
{"img_url":"http://images-assets.nasa.gov/image/PIA18906/PIA18906~thumb.jpg","message":"Success !"}
To use the Stars API on your local machine, follow these steps:
- Clone this repo
- Open terminal in the cloned folder
- Install requirements using
pip install -r requirements.txt
- Run the API using
flask run
- The API will be live at http://127.0.0.1:5000/
Made with ❤️ by Junaid.