Holiday Sale! Get over 30% off when you subscribe to an annual plan!

Stars API

The Stars API provides key statistics for thousands of stars discovered in the known universe.

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
422ms454ms478ms714ms1083ms

Didn't find what you were looking for? Suggest an improvement


/v1/stars GET

https://api.api-ninjas.com/v1/stars

Get a list of stars matching specified parameters. Returns at most 30 results. To access more than 30 results, use the offset parameter to offset results in multiple API calls.

Parameters

At least one of the following parameters (other than offset) is required.

  • name  optional

    The name of the star. Note that many of the star names contain Greek characters.

  • constellation  optional

    The constellation that the star belongs to.

  • min_apparent_magnitude  optional

    Minimum apparent magnitude brightness of the star.

  • max_apparent_magnitude  optional

    Maximum apparent magnitude brightness of the star.

  • min_absolute_magnitude  optional

    Minimum absolute magnitude brightness of the star.

  • max_absolute_magnitude  optional

    Maximum absolute magnitude brightness of the star.

  • min_distance_light_year  optional

    Minimum distance the star is from Earth in light years.

  • max_distance_light_year  optional

    Maximum distance the star is from Earth in light years.

  • offset  optional

    Number of results to offset for pagination.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

name
constellation
min_apparent_magnitude
max_apparent_magnitude
min_absolute_magnitude

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/stars?name=vega

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 6 7 8 9 10 11 12 [ { "name": "Vega", "constellation": "Lyra", "right_ascension": "18h 36m 56.19s", "declination": "+38° 46′ 58.8″", "apparent_magnitude": "0.03", "absolute_magnitude": "0.58", "distance_light_year": "25", "spectral_class": "A0Vvar" } ]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/stars?name=vega" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.