# Planet Positions API

> Planet Positions locates solar system bodies for any observer coordinates on Earth. It checks if the sun, moon, or planets sit below the horizon, while paid plans add celestial coordinates and distance.

**Endpoint:** `POST https://api.apiverve.com/v1/planetpositions`  
**Category:** Astrology  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/planetpositions

## Overview

Pass observer latitude, longitude, and a chosen planet from Pluto to the Moon. The API calculates observation geometry with optional observer altitude and observation time, returning whether the target sits below the local horizon. Paid plans let you set specific dates and return where to look (altitude above the horizon and compass bearing), right ascension, declination, distances, sidereal time, and Cartesian position vectors.

## 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 -X POST "https://api.apiverve.com/v1/planetpositions" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat":37.7749,"lon":-122.4194,"planet":"Moon","date":"2025-04-15 10:37:00","time":"value","timezone":"value","alt":52}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string | No | The date to get planetary position data for (MM-DD-YYYY). An ISO date-time such as 2026-11-17T20:00:00 is also accepted and supplies the time; with Z or an offset it is read as that exact instant. datetime. Premium field |
| `time` | string | No | The time of day for the calculation (HH:mm, 24-hour; HH:mm:ss and 12-hour times such as 9:00 PM are also accepted, seconds are ignored), read as UTC unless timezone is given. Defaults to 00:00 if not provided. time |
| `timezone` | string | No | IANA timezone to read the date and time in, such as America/Los_Angeles. Defaults to UTC. timezone |
| `lat` | number | Yes | The latitude of the observer. range -90-90 |
| `lon` | number | Yes | The longitude of the observer. range -180-180 |
| `alt` | number | No | The altitude of the observer in meters. default 0. range 0-inf |
| `planet` | string | Yes | The planet to get position data for. One of: sun, moon, mercury, venus, mars, jupiter, saturn, uranus, neptune, pluto |

## Response fields

- `planet` — string · Name of the celestial body being observed
- `isBelowHorizon` — boolean · Whether the planet is below horizon at observation location
- `date` — string · Observation date and time in ISO 8601 format
- `observer` — object · The location the position was calculated for
  - `observer.latitude` — number · Observer latitude in decimal degrees
  - `observer.longitude` — number · Observer longitude in decimal degrees
- `rightAscension` — object · Right ascension coordinates of the planet · (premium)
  - `rightAscension.hours` — number · Right ascension hours component (0-23) · (premium)
  - `rightAscension.minutes` — number · Right ascension minutes component (0-59) · (premium)
  - `rightAscension.seconds` — number · Right ascension seconds component (0-59) · (premium)
- `declination` — object · Declination coordinates of the planet · (premium)
  - `declination.degrees` — number · Declination degrees component (-90 to 90) · (premium)
  - `declination.minutes` — number · Declination minutes component (0-59) · (premium)
  - `declination.seconds` — number · Declination seconds component (0-59) · (premium)
- `distance` — object · Distance to the planet in various units · (premium)
  - `distance.km` — number · Distance to planet in kilometers · (premium)
  - `distance.lightTravelSeconds` — number · Light travel time in seconds from planet · (premium)
  - `distance.astronomicalUnits` — number · Distance in astronomical units (AU) · (premium)
- `siderealTime` — object · Local sidereal time at observation · (premium)
  - `siderealTime.hours` — number · Local sidereal time hours component (0-23) · (premium)
  - `siderealTime.minutes` — number · Local sidereal time minutes component (0-59) · (premium)
  - `siderealTime.seconds` — number · Local sidereal time seconds component (0-59) · (premium)
- `hourAngle` — object · Hour angle from the meridian · (premium)
  - `hourAngle.hours` — number · Hour angle hours component from meridian · (premium)
  - `hourAngle.minutes` — number · Hour angle minutes component from meridian · (premium)
  - `hourAngle.seconds` — number · Hour angle seconds component from meridian · (premium)
- `vectors` — object · Position vector components · (premium)
  - `vectors.x` — number · X component of planet position vector · (premium)
  - `vectors.y` — number · Y component of planet position vector · (premium)
  - `vectors.z` — number · Z component of planet position vector · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "planet": "Moon",
    "isBelowHorizon": false,
    "date": "2025-04-15T10:37:00Z",
    "observer": {
      "latitude": 37.7749,
      "longitude": -122.4194
    },
    "rightAscension": {
      "hours": 15,
      "minutes": 13,
      "seconds": 11
    },
    "declination": {
      "degrees": -23,
      "minutes": 10,
      "seconds": 56
    },
    "distance": {
      "km": 402457.36,
      "lightTravelSeconds": 1.342,
      "astronomicalUnits": 0.003
    },
    "siderealTime": {
      "hours": 16,
      "minutes": 2,
      "seconds": 42
    },
    "hourAngle": {
      "hours": 0,
      "minutes": 49,
      "seconds": 31
    },
    "vectors": {
      "x": -0.0016452947779903913,
      "y": -0.0018463324771434563,
      "z": -0.0010590407236111441
    }
  }
}
```

## Use cases

- **Stargazing Tour Scheduling** — When planning evening viewing sessions, astronomy guides check if target planets sit below the horizon at their field camp location and scheduled observation time.
- **Telescope Mount Pointing** — Astrophotographers on paid plans calculate exact right ascension and declination coordinates to aim automated tracking mounts toward visible solar system targets.
- **Astrology Chart Generation** — Natal chart software queries planetary bodies across specific dates on paid plans to map celestial positions for birth chart generation.
- **Planetarium Display Sync** — To project accurate night sky exhibits, science museum kiosks query live planetary coordinates based on local building coordinates and viewing time.

## SDKs

- **npm** — `npm install @apiverve/planetpositions` (https://www.npmjs.com/package/@apiverve/planetpositions)
- **NuGet** — `dotnet add package APIVerve.API.PlanetPositions` (https://www.nuget.org/packages/APIVerve.API.PlanetPositions)
- **Source** — https://github.com/apiverve/planetpositions-api

## More

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