# Planets API
> Physical and orbital data for the solar system and beyond: every planet, dwarf planet, major moon and the Sun with NASA fact-sheet values (mass, radius, surface gravity, density, escape velocity, mean temperature, orbital and rotation period, semi-major axis, moon count and rings), plus a searchable catalogue of more than 6,000 confirmed exoplanets from the NASA Exoplanet Archive (radius, mass, orbital period, equilibrium temperature, distance in light-years, host star, discovery year and method). Filter exoplanets by host star, discovery method, year, size or distance, compare solar-system bodies side by side, and look up any single body or exoplanet by name. Every endpoint accepts input via the query string or the request body and returns lean JSON. Pure server-side data (no third-party upstream), so responses are instant and always available. Ideal for education, EdTech, astronomy apps, data visualisation and science tools.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/planets-api/..."
```

## Pricing
- **Free** (Free) — 30,000 calls/Mo, 3 req/s
- **Basic** ($7/Mo) — 450,000 calls/Mo, 12 req/s
- **Pro** ($21/Mo) — 3,200,000 calls/Mo, 35 req/s
- **Mega** ($52/Mo) — 15,000,000 calls/Mo, 90 req/s

## Endpoints

### Planets

#### `GET /v1/bodies` — List solar-system bodies

**Parameters:**
- `type` (query, optional, string) — planet|dwarf_planet|moon|star Example: `planet`
- `parent` (query, optional, string) — Parent body (for moons) Example: `Jupiter`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/planets-api/v1/bodies?type=planet&parent=Jupiter"
```

#### `GET /v1/body` — Single solar-system body

**Parameters:**
- `name` (query, required, string) — Body name Example: `Jupiter`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/planets-api/v1/body?name=Jupiter"
```

#### `GET /v1/compare` — Compare solar-system bodies

**Parameters:**
- `bodies` (query, required, string) — Comma-separated names (max 8) Example: `Earth,Mars,Jupiter`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/planets-api/v1/compare?bodies=Earth%2CMars%2CJupiter"
```

#### `GET /v1/exoplanet` — Single exoplanet by name

**Parameters:**
- `name` (query, required, string) — Exoplanet name Example: `Proxima Cen b`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/planets-api/v1/exoplanet?name=Proxima+Cen+b"
```

#### `GET /v1/exoplanets` — Search exoplanet catalogue

**Parameters:**
- `q` (query, optional, string) — Name contains Example: `Kepler`
- `host` (query, optional, string) — Host star Example: `TRAPPIST-1`
- `method` (query, optional, string) — Discovery method Example: `Transit`
- `year` (query, optional, string) — Discovery year Example: `2017`
- `min_radius` (query, optional, string) — Min radius (Earth radii) Example: `0.5`
- `max_radius` (query, optional, string) — Max radius Example: `2`
- `max_distance_ly` (query, optional, string) — Max distance (ly) Example: `50`
- `sort` (query, optional, string) — name|distance|year|radius|mass Example: `distance`
- `limit` (query, optional, string) — 1..100 (default 20) Example: `20`
- `offset` (query, optional, string) — Offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/planets-api/v1/exoplanets?q=Kepler&host=TRAPPIST-1&method=Transit&year=2017&min_radius=0.5&max_radius=2&max_distance_ly=50&sort=distance&limit=20&offset=0"
```

#### `GET /v1/meta` — Catalogue facets

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/planets-api/v1/meta"
```


---
Marketplace page: https://www.oanor.com/api/planets-api
OpenAPI spec: https://www.oanor.com/api/planets-api/openapi.json
