# Stars Lookup API

> Stars Lookup retrieves physical and positional stellar data by star name or astronomical classification. Query individual stars or filter by spectral class to obtain mass in kilograms, distance in light-years, and stellar type.

**Endpoint:** `GET https://api.apiverve.com/v1/starslookup`  
**Category:** Science  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/starslookup

## Overview

A star lookup API for physical and positional data on named stars. Requests accept a specific star name such as Sirius or Betelgeuse, or an astronomical classification, such as spectral codes, spectral classes, or categories like red dwarf and supergiant. Classification queries return up to ten matching entries. Each record supplies mass in kilograms, distance in light-years, and stellar classification.

Education apps, planetarium and stargazing tools, games with real star maps and science content sites use it to show facts about a star without maintaining their own catalogue. Searching by type makes it easy to list example main sequence stars or white dwarfs for a lesson or quiz.

The Free plan returns the star name, mass, distance and spectral type. Paid plans add surface temperature, diameter, hex color codes for drawing the star in its true tint, 3D galactic coordinates for plotting positions, and the HYG catalogue fields: apparent and absolute magnitude, right ascension and declination, constellation, Hipparcos and HD numbers, and Bayer, Flamsteed and IAU proper names.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/starslookup?name=Sirius" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | The name of the star (e.g., Sirius). IAU proper names (Rigil Kentaurus), Bayer designations (Alpha Orionis or alf Ori), Flamsteed numbers (58 Ori), HD and HIP numbers (HD 48915) and common names (Sun, North Star) are also accepted |

## Response fields

- `starName` — string · The name of the star
- `mass` — number · Mass of the star in kilograms; null when no mass is recorded
- `diameter` — number · Diameter of the star in kilometers · (premium)
- `galX` — number · Galactic X coordinate position · (premium)
- `galY` — number · Galactic Y coordinate position · (premium)
- `galZ` — number · Galactic Z coordinate position · (premium)
- `dist` — number · Distance to star in light-years
- `starType` — string · Stellar classification type (e.g., A1V)
- `temp` — number · Surface temperature of the star in Kelvin · (premium)
- `color` — string · Color representation as hex code · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "starName": "Sirius",
    "mass": 4.674385e+30,
    "diameter": 2825760,
    "galX": -5.895,
    "galY": -6.152,
    "galZ": -1.167,
    "dist": 8.6,
    "starType": "A1(V)",
    "temp": 9500,
    "color": "0xbaccff"
  }
}
```

## Use cases

- **Planetarium Display Systems** — Stargazing apps query star names to show visitors distance from Earth, stellar classification, and real celestial mass during live sky tours.
- **Sci-Fi Worldbuilding** — To build believable galaxy maps, game developers pull spectral classes like red dwarf or main sequence to seed star systems with authentic physics.
- **Astronomy Curriculum Portals** — When students compare celestial bodies, digital textbooks pull mass in kilograms and stellar types to demonstrate the Hertzsprung-Russell relationship.
- **Telescope Calibration Software** — Align optical tracking mounts by looking up known reference stars to verify catalog identity and light-year distance against visual field observations.

## SDKs

- **npm** — `npm install @apiverve/starslookup` (https://www.npmjs.com/package/@apiverve/starslookup)
- **PyPI** — `pip install apiverve-starslookup` (https://pypi.org/project/apiverve-starslookup/)
- **NuGet** — `dotnet add package APIVerve.API.StarsLookup` (https://www.nuget.org/packages/APIVerve.API.StarsLookup)
- **Source** — https://github.com/apiverve/starslookup-api

## More

- Full reference: https://docs.apiverve.com/ref/starslookup
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
