# SpaceX API
> Latest, next and recent SpaceX launches with mission details, success status, mission patches, webcasts and articles, a single-launch lookup by id, and the full rocket fleet with specs, success rates and imagery. Great for space dashboards, trackers, education and hobby projects.

## 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/spacex-api/..."
```

## Pricing
- **Free** (Free) — 8,000 calls/Mo, 2 req/s
- **Basic** ($6/Mo) — 120,000 calls/Mo, 8 req/s
- **Pro** ($19/Mo) — 600,000 calls/Mo, 25 req/s
- **Mega** ($49/Mo) — 2,500,000 calls/Mo, 80 req/s

## Endpoints

### Launches

#### `GET /v1/latest` — Most recent launch

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

**Response:**
```json
{
    "data": {
        "id": "62dd70d5202306255024d139",
        "name": "Crew-5",
        "patch": "https://images2.imgbox.com/eb/d8/D1Yywp0w_o.png",
        "rocket": "5e9d0d95eda69973a809d1ec",
        "article": null,
        "details": null,
        "success": true,
        "webcast": "https://youtu.be/5EwW8ZkArL4",
        "date_utc": "2022-10-05T16:00:00.000Z",
        "upcoming": false,
        "wikipedia": "https://en.wikipedia.org/wiki/SpaceX_Crew-5",
        "flight_number": 187
    },
    "meta": {
        "timestamp": "2026-05-30T04:32:24.951Z",
        "request_id": "5e52c88b-dfe3-4de8-b452-c788f0a99dcf"
    },
    "status": "ok",
    "message": "Latest launch retrieved",
    "success": true
}
```

#### `GET /v1/launch` — Launch by id

**Parameters:**
- `id` (query, required, string) — 24-char launch id Example: `62dd70d5202306255024d139`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spacex-api/v1/launch?id=62dd70d5202306255024d139"
```

**Response:**
```json
{
    "data": {
        "id": "62dd70d5202306255024d139",
        "name": "Crew-5",
        "patch": "https://images2.imgbox.com/eb/d8/D1Yywp0w_o.png",
        "rocket": "5e9d0d95eda69973a809d1ec",
        "article": null,
        "details": null,
        "success": true,
        "webcast": "https://youtu.be/5EwW8ZkArL4",
        "date_utc": "2022-10-05T16:00:00.000Z",
        "upcoming": false,
        "wikipedia": "https://en.wikipedia.org/wiki/SpaceX_Crew-5",
        "flight_number": 187
    },
    "meta": {
        "timestamp": "2026-05-30T04:32:25.475Z",
        "request_id": "b7ef1b2d-247b-480e-af6a-666438ab4efb"
    },
    "status": "ok",
    "message": "Launch retrieved",
    "success": true
}
```

#### `GET /v1/launches` — Recent launches

**Parameters:**
- `limit` (query, optional, string) — Max 1-50 Example: `10`
- `upcoming` (query, optional, string) — true for upcoming

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/spacex-api/v1/launches?limit=10"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "total": 205,
        "results": [
            {
                "id": "6243ae7daf52800c6e91925b",
                "name": "O3b mPower 3.4",
                "patch": null,
                "rocket": "5e9d0d95eda69973a809d1ec",
                "article": null,
                "details": null,
                "success": null,
                "webcast": null,
                "date_utc": "2022-12-01T00:00:00.000Z",
                "upcoming": true,
                "wikipedia": null,
                "flight_number": 203
            },
            {
                "id": "633f72130531f07b4fdf59c3",
                "name": "Viasat-3 & Arcturus",
                "patch": null,
                "rocket": "5e9d0d95eda69974db09d1ed",
                "article": null,
                "details": null,
                "success": null,
                "webcast": null,
                "date_utc": "2022-12-01T00:00:00.000Z",
                "upcoming": true,
                "wikipedia": null,
                "flight_number": 202
            },
            {
                "id": "6243ae58af52800c6e91925a",
                "name": "WorldView Legion 1 & 2",
                "patch": null,
                "rocket": "5e9d0d95eda69973a809d1ec",
                "article": null,
                "details": null,
                "success": null,
                "webcast": null,
                "date_utc": "2022-12-01T00:00:00.000Z",
                "upcoming": 
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/next` — Next upcoming launch

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

**Response:**
```json
{
    "data": {
        "id": "6243aec2af52800c6e91925d",
        "name": "USSF-44",
        "patch": null,
        "rocket": "5e9d0d95eda69974db09d1ed",
        "article": null,
        "details": null,
        "success": null,
        "webcast": "https://youtu.be/pY628jRd6gM",
        "date_utc": "2022-11-01T13:41:00.000Z",
        "upcoming": true,
        "wikipedia": null,
        "flight_number": 188
    },
    "meta": {
        "timestamp": "2026-05-30T04:32:26.413Z",
        "request_id": "777ec8ba-ef1e-4860-8f3f-6db297591781"
    },
    "status": "ok",
    "message": "Next launch retrieved",
    "success": true
}
```

### Rockets

#### `GET /v1/rockets` — All rockets

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

**Response:**
```json
{
    "data": {
        "count": 4,
        "results": [
            {
                "id": "5e9d0d95eda69955f709d1eb",
                "name": "Falcon 1",
                "type": "rocket",
                "image": "https://imgur.com/DaCfMsj.jpg",
                "active": false,
                "stages": 2,
                "company": "SpaceX",
                "country": "Republic of the Marshall Islands",
                "mass_kg": 30146,
                "boosters": 0,
                "height_m": 22.25,
                "wikipedia": "https://en.wikipedia.org/wiki/Falcon_1",
                "description": "The Falcon 1 was an expendable launch system privately developed and manufactured by SpaceX during 2006-2009. On 28 September 2008, Falcon 1 became the first privately-developed liquid-fuel launch vehicle to go into orbit around the Earth.",
                "first_flight": "2006-03-24",
                "cost_per_launch": 6700000,
                "success_rate_pct": 40
            },
            {
                "id": "5e9d0d95eda69973a809d1ec",
                "name": "Falcon 9",
                "type": "rocket",
                "image": "https://farm1.staticflickr.com/929/28787338307_3453a11a77_b.jpg",
                "active": true,
                "stages": 2,
                "company": "SpaceX",
                "country": "United States",
                "mass_kg": 549054,
                "boosters": 0,
                "height_m": 70,
                "wikipedia": "http
…(truncated, see openapi.json for full schema)
```


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