Stars API
The Stars API provides key statistics for thousands of stars discovered in the known universe.
From 9,702 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 343ms | 390ms | 436ms | 837ms | 1062ms |
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.
nameoptionalThe name of the star. Note that many of the star names contain Greek characters.
constellationoptionalThe constellation that the star belongs to.
min_apparent_magnitudeoptionalMinimum apparent magnitude brightness of the star.
max_apparent_magnitudeoptionalMaximum apparent magnitude brightness of the star.
min_absolute_magnitudeoptionalMinimum absolute magnitude brightness of the star.
max_absolute_magnitudeoptionalMaximum absolute magnitude brightness of the star.
min_distance_light_yearoptionalMinimum distance the star is from Earth in light years.
max_distance_light_yearoptionalMaximum distance the star is from Earth in light years.
offsetoptionalNumber of results to offset for pagination.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
Returns an array of star objects, each containing:
nameThe name of the star.
constellationThe constellation that the star belongs to.
right_ascensionThe right ascension coordinate of the star.
declinationThe declination coordinate of the star.
apparent_magnitudeThe apparent magnitude (brightness as seen from Earth) of the star.
absolute_magnitudeThe absolute magnitude (intrinsic brightness) of the star.
distance_light_yearThe distance from Earth in light years.
spectral_classThe spectral classification of the star.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/stars?name=vegaHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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.