DEV Community

Cover image for Stars API ⭐🌟
Junaid
Junaid

Posted on

Stars API ⭐🌟

Stars API , get all stars in universe at one place .

This is the latest version of Stars-API . [version- 2]

This Stars API is made by Junaid . It also includes images .
demo1
Star Data by Junaid .

Stars API is Now online at https://starsapi.abujuni.dev (or) https://stars-api.onrender.com .

Index

Star Data API

demo1
Star Data by Junaid .

Index page is the API which shows all stars in json format , every star data is in a array format .

http://127.0.0.1:5000/
Enter fullscreen mode Exit fullscreen mode

Tip : This API is easy to make a flatlist react app .

Star Data Search API

demo3

http://127.0.0.1:5000/stars?name=Proxima Centauri
Enter fullscreen mode Exit fullscreen mode

or

http://127.0.0.1:5000/stars?name=sun
Enter fullscreen mode Exit fullscreen mode

Return

{"data":{"Distance":1.5813e-05,"Gravity":274.2691614596,"Mass":1.0,"Radius":1.0,"Star_name":"Sun"},"message":"Success !"}
Enter fullscreen mode Exit fullscreen mode

Star Images Search API

demo2

http://127.0.0.1:5000/stars-img?name=Proxima Centauri
Enter fullscreen mode Exit fullscreen mode

or

http://127.0.0.1:5000/stars-img?name=sun
Enter fullscreen mode Exit fullscreen mode

Return

{"img_url":"http://images-assets.nasa.gov/image/PIA18906/PIA18906~thumb.jpg","message":"Success !"}
Enter fullscreen mode Exit fullscreen mode

Installation

GitHub logo junaidcodingmaster / Stars-API

Stars API , get all stars in universe at one place .

logo Made with Python Version

Stars API ⭐🌟

Get all the stars in the universe at one place with the Stars API.

This is the latest version of the Stars API : Stars API Version

This API was created by Junaid and includes images.

Check out a demo:

Star Data Demo Star Data by Junaid

The API is now live at:

Table of Contents

Star Data API

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.

Star Data Search API

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 !"}

Star Images Search API

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 !"}

Installation

To use the Stars API on your…

  • Go to this repo(given above), download the latest version of Stars-API as Zip.
  • Extract zip file and open terminal in that extracted folder.
  • Install all requirements using -> pip install -r requirements.txt
  • Than type -> flask run
  • heyy ! , Star API is running at http://127.0.0.1:5000/

Where is the API ?

Stars API is hosted at https://starsapi.abujuni.dev or https://stars-api.onrender.com


Made By Junaid .

Top comments (0)