# Deep-Sky Objects API
> The OpenNGC (NGC/IC) catalogue of deep-sky objects as an API — 13,000+ galaxies, nebulae and star clusters. Look up any object by its catalogue name (NGC224, IC434), Messier number (M31 → Andromeda Galaxy, M42 → Orion Nebula, M1 → Crab Nebula) or common name; browse the full 110-object Messier catalogue; or search by type (galaxy, planetary nebula, globular cluster…) and constellation. Each record carries the object type, J2000 coordinates (sexagesimal + decimal), V/B magnitude, angular size, surface brightness, Hubble morphological type, constellation and cross-catalogue identifiers. Ideal for astronomy apps, telescope planners, planetarium software and education.

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

## Pricing
- **Free** (Free) — 4,000 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 50,000 calls/Mo, 8 req/s
- **Pro** ($18/Mo) — 260,000 calls/Mo, 20 req/s
- **Mega** ($45/Mo) — 1,250,000 calls/Mo, 50 req/s

## Endpoints

### Deep-Sky

#### `GET /v1/messier` — A Messier object, or the full Messier catalogue

**Parameters:**
- `number` (query, optional, string) — Messier number 1-110 (omit to list all) Example: `31`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/deepsky-api/v1/messier?number=31"
```

**Response:**
```json
{
    "data": {
        "ra": "00:42:44.35",
        "dec": "+41:16:08.6",
        "name": "NGC0224",
        "type": "G",
        "b_mag": 4.29,
        "v_mag": 3.44,
        "ra_deg": 10.68479,
        "dec_deg": 41.26906,
        "messier": "M31",
        "type_name": "Galaxy",
        "common_name": "Andromeda Galaxy",
        "hubble_type": "Sb",
        "identifiers": "2MASX J00424433+4116074,IRAS 00400+4059,MCG +07-02-016,PGC 002557,UGC 00454",
        "constellation": "And",
        "messier_number": 31,
        "major_axis_arcmin": 177.83,
        "minor_axis_arcmin": 69.66,
        "constellation_name": "Andromeda",
        "surface_brightness": 23.63
    },
    "meta": {
        "timestamp": "2026-05-31T05:48:02.658Z",
        "request_id": "84b09cdc-d0d0-494c-b8ad-0e577bcbd82f"
    },
    "status": "ok",
    "message": "Messier object retrieved",
    "success": true
}
```

#### `GET /v1/object` — An object by catalogue name, Messier number or common name

**Parameters:**
- `name` (query, optional, string) — Catalogue name (NGC224), M31 or a common name Example: `NGC224`
- `messier` (query, optional, string) — Messier number, e.g. 31

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

**Response:**
```json
{
    "data": {
        "ra": "00:42:44.35",
        "dec": "+41:16:08.6",
        "name": "NGC0224",
        "type": "G",
        "b_mag": 4.29,
        "v_mag": 3.44,
        "ra_deg": 10.68479,
        "dec_deg": 41.26906,
        "messier": "M31",
        "type_name": "Galaxy",
        "common_name": "Andromeda Galaxy",
        "hubble_type": "Sb",
        "identifiers": "2MASX J00424433+4116074,IRAS 00400+4059,MCG +07-02-016,PGC 002557,UGC 00454",
        "constellation": "And",
        "messier_number": 31,
        "major_axis_arcmin": 177.83,
        "minor_axis_arcmin": 69.66,
        "constellation_name": "Andromeda",
        "surface_brightness": 23.63
    },
    "meta": {
        "timestamp": "2026-05-31T05:48:02.731Z",
        "request_id": "998de67e-d3d0-4c72-9079-2e1c1eac408f"
    },
    "status": "ok",
    "message": "Object retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search by name/common name with type & constellation filters

**Parameters:**
- `q` (query, optional, string) — Name / common name search, e.g. nebula
- `type` (query, optional, string) — G, PN, OCl, GCl, Neb, HII, SNR … Example: `PN`
- `constellation` (query, optional, string) — Constellation (abbr or name), e.g. Orion
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/deepsky-api/v1/search?type=PN&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "query": null,
        "total": 130,
        "offset": 0,
        "filters": {
            "type": "PN",
            "constellation": null
        },
        "results": [
            {
                "name": "IC0289",
                "type": "PN",
                "v_mag": 13.2,
                "messier": null,
                "type_name": "Planetary Nebula",
                "common_name": null,
                "constellation": "Cas"
            },
            {
                "name": "IC0351",
                "type": "PN",
                "v_mag": 11.9,
                "messier": null,
                "type_name": "Planetary Nebula",
                "common_name": null,
                "constellation": "Per"
            },
            {
                "name": "IC0418",
                "type": "PN",
                "v_mag": 9.44,
                "messier": null,
                "type_name": "Planetary Nebula",
                "common_name": null,
                "constellation": "Lep"
            },
            {
                "name": "IC0972",
                "type": "PN",
                "v_mag": 13.9,
                "messier": null,
                "type_name": "Planetary Nebula",
                "common_name": null,
                "constellation": "Vir"
            },
            {
                "name": "IC1266",
                "type": "PN",
                "v_mag": 11.2,
                "messier":
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Totals & object-type breakdown

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

**Response:**
```json
{
    "data": {
        "note": "Galaxies, nebulae and star clusters. Coordinates are J2000 (sexagesimal + decimal degrees); magnitudes V/B; size in arcminutes.",
        "total": 13308,
        "types": [
            {
                "code": "G",
                "name": "Galaxy",
                "count": 10481
            },
            {
                "code": "OCl",
                "name": "Open Cluster",
                "count": 652
            },
            {
                "code": "*",
                "name": "Star",
                "count": 546
            },
            {
                "code": "Other",
                "name": "Other",
                "count": 419
            },
            {
                "code": "**",
                "name": "Double Star",
                "count": 243
            },
            {
                "code": "GPair",
                "name": "Galaxy Pair",
                "count": 231
            },
            {
                "code": "GCl",
                "name": "Globular Cluster",
                "count": 204
            },
            {
                "code": "PN",
                "name": "Planetary Nebula",
                "count": 130
            },
            {
                "code": "Neb",
                "name": "Nebula",
                "count": 94
            },
            {
                "code": "HII",
                "name": "HII Ionised Region",
                "count": 82
            },
            {
       
…(truncated, see openapi.json for full schema)
```


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