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

Planets API

The Planets API provides key statistics for thousands of planets and exoplanets discovered in the known universe.

(4.7)

From 6,924 users

4,300+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
289ms317ms350ms692ms1070ms

Similar APIs

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


/v1/planets GET

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

Get a list of planets 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) must be set:

  • name  optional

    The name of the planet.

  • min_mass  optional

    Minimum mass of the planet in Jupiters (1 Jupiter = 1.898 × 1027 kg).

  • max_mass  optional

    Maximum mass of the planet in Jupiters (1 Jupiter = 1.898 × 1027 kg).

  • min_radius  optional

    Minimum average radius of the planet in Jupiters (1 Jupiter = 69911 km).

  • max_radius  optional

    Maximum average radius of the planet in Jupiters (1 Jupiter = 69911 km).

  • min_period  optional

    Minimum orbital period of the planet in Earth days.

  • max_period  optional

    Maximum orbital period of the planet in Earth days.

  • min_temperature  optional

    Minimum average surface temperature of the planet in Kelvin.

  • max_temperature  optional

    Maximum average surface temperature of the planet in Kelvin.

  • min_distance_light_year  optional

    Minimum distance the planet is from Earth in light years.

  • max_distance_light_year  optional

    Maximum distance the planet is from Earth in light years.

  • min_semi_major_axis  optional

    Minimum semi major axis of planet in astronomical units (AU).

  • max_semi_major_axis  optional

    Maximum semi major axis of planet in astronomical units (AU).

  • offset  optional

    Number of results to offset for pagination.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

  • name

    The name of the planet.

  • mass

    Mass of the planet in Jupiters (1 Jupiter = 1.898 × 1027 kg).

  • radius

    Average radius of the planet in Jupiters (1 Jupiter = 69911 km).

  • period

    Orbital period of the planet in Earth days.

  • semi_major_axis

    Semi-major axis of the planet's orbit in astronomical units (AU).

  • temperature

    Average surface temperature of the planet in Kelvin.

  • distance_light_year

    Distance from Earth in light years.

  • host_star_mass

    Mass of the host star in solar masses.

  • host_star_temperature

    Temperature of the host star in Kelvin.

Sample Request Live Demo!

name
min_mass
max_mass
min_radius
max_radius

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

https://api.api-ninjas.com/v1/planets?name=Neptune

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 13 [ { "name": "Neptune", "mass": 0.0537, "radius": 0.346, "period": 59800, "semi_major_axis": 30.07, "temperature": 72, "distance_light_year": 0.000478, "host_star_mass": 1, "host_star_temperature": 6000 } ]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/planets?name=Neptune" \ -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.