[Integrations](https://spiral.ai/integrations) › [Gemini CLI](https://spiral.ai/integrations/gemini-cli) › [JPL Horizons state vectors](https://spiral.ai/integrations/gemini-cli/jpl-horizons-state-vectors)

# How to Use JPL Horizons state vectors in Gemini CLI

Returns Cartesian position and velocity relative to a chosen origin at specified times. Use it for three-dimensional plots, distance and speed calculations, or simulation comparisons.

|  |  |
| --- | --- |
| Model | JPL Horizons state vectors |
| Available through | Alexandria |
| Category | Industry Data |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with JPL Horizons state vectors in Gemini CLI

- Use JPL Horizons state vectors for Voyager 1 relative to the Sun each day from December 1 through December 8, 2026. Add a script that calculates distance and speed from the returned components.
- Use JPL Horizons state vectors to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from JPL Horizons state vectors and tell me what changed since last week.
- Check JPL Horizons state vectors and summarize what you find in three bullet points.
- Pull the newest data from JPL Horizons state vectors and give me the result as a table.

## How to set up JPL Horizons state vectors in Gemini CLI

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Or add it to `~/.gemini/settings.json` yourself:

```bash
gemini mcp add --scope user --transport http spiral https://api.spiral.ai/mcp
```

2. **Sign in**: Start `gemini` and run:

```text
/mcp auth spiral
```

3. **Check it**: In Gemini CLI, run `/mcp`. From your shell:

```bash
gemini mcp list
```

### Use the Spiral skill

1. **Send Gemini CLI this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run JPL Horizons state vectors**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "ssd-jpl-nasa-gov/ephemerides/state_vectors",
    "input": {
      "target": "<target>"
    }
  }'
```

Then paste one of the prompts above: Gemini CLI finds JPL Horizons state vectors on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/gemini-cli

## JPL Horizons state vectors tools and prices

- [JPL Horizons ephemerides · State vectors](https://spiral.ai/tools/alexandria/ssd-jpl-nasa-gov/ephemerides/state_vectors) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| step |  | — | Step between rows: 30 m, 1 h, 6 h, 1 d, 1 mo, 1 y (default 1 d). At most 500 rows per call. |
| stop |  | — | Stop time. Omit for one row at start. UTC for observer tables, TDB for vectors and elements: YYYY-MM-DD, YYYY-MM-DD HH:MM or YYYY-MM-DDTHH:MM:SSZ, years 1000 to 3000. |
| start |  | — | Start time (or the single instant when stop is omitted; default now). UTC for observer tables, TDB for vectors and elements: YYYY-MM-DD, YYYY-MM-DD HH:MM or YYYY-MM-DDTHH:MM:SSZ, years 1000 to 3000. |
| units | km_s, au_d | — | km_s or au_d. |
| center |  | — | Coordinate origin: 10 Sun center (default), 0 solar system barycenter, 399 Earth, 301 Moon, 5 Jupiter barycenter, or site@body (500@399). |
| reference_plane | ecliptic, equator | — | ecliptic (J2000 ecliptic, default) or equator (ICRF equatorial). |

## What can you do with JPL Horizons state vectors in Gemini CLI?

Build a sky-position viewer, target catalog, or orbital simulation comparison using JPL Horizons data. A coding agent can turn object identities, physical summaries, and calculated motion into project files and charts.

### Prepare a planetarium presentation

Identify Mars, collect its physical summary, and calculate its sky position for the presentation date. Use orbital geometry and three-dimensional coordinates to connect the audience's view with Mars's position around the Sun.

### Build an asteroid briefing

Resolve Apophis and its historical designation, summarize available physical and orbit information, and calculate its sky position for a chosen date. Add orbit elements and Earth-relative vectors to explain its geometry and distance.

### Create a lesson on orbit geometry

Identify Earth and Mars, compare their physical summaries, and examine their orbit elements and positions on matching dates. Contrast the resulting spatial diagram with their apparent sky positions as seen from Earth.

### Check an orbital simulation

Confirm the simulated target's identity and inspect its source summary. Compare modeled orbital elements and Cartesian positions and velocities with Horizons results at the same epochs.

### Explain a spacecraft's journey

Identify Voyager 1 and read its trajectory notes before building a dated mission explainer. Use Earth-view coordinates, heliocentric orbit geometry, and position and velocity vectors to describe its direction, distance, and motion.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All Gemini CLI guides](https://spiral.ai/integrations/gemini-cli)

## JPL Horizons state vectors in other agents

- [Amp](https://spiral.ai/integrations/amp/jpl-horizons-state-vectors)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/jpl-horizons-state-vectors)
- [Claude](https://spiral.ai/integrations/claude-desktop/jpl-horizons-state-vectors)
- [Claude Code](https://spiral.ai/integrations/claude-code/jpl-horizons-state-vectors)
- [Cline](https://spiral.ai/integrations/cline/jpl-horizons-state-vectors)
- [Codex](https://spiral.ai/integrations/codex/jpl-horizons-state-vectors)
- [Cursor](https://spiral.ai/integrations/cursor/jpl-horizons-state-vectors)
- [Devin](https://spiral.ai/integrations/devin/jpl-horizons-state-vectors)
- [dots](https://spiral.ai/integrations/dots/jpl-horizons-state-vectors)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/jpl-horizons-state-vectors)
- [Gemini](https://spiral.ai/integrations/gemini/jpl-horizons-state-vectors)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/jpl-horizons-state-vectors)
- [goose](https://spiral.ai/integrations/goose/jpl-horizons-state-vectors)
- [Grok](https://spiral.ai/integrations/grok/jpl-horizons-state-vectors)
- [Grok Build](https://spiral.ai/integrations/grok-build/jpl-horizons-state-vectors)
- [Hermes](https://spiral.ai/integrations/hermes/jpl-horizons-state-vectors)
- [Instinct](https://spiral.ai/integrations/instinct/jpl-horizons-state-vectors)
- [Manus](https://spiral.ai/integrations/manus/jpl-horizons-state-vectors)
- [Muse](https://spiral.ai/integrations/muse/jpl-horizons-state-vectors)
- [Muse Code](https://spiral.ai/integrations/muse-code/jpl-horizons-state-vectors)
- [n8n](https://spiral.ai/integrations/n8n/jpl-horizons-state-vectors)
- [Notion](https://spiral.ai/integrations/notion/jpl-horizons-state-vectors)
- [OpenClaw](https://spiral.ai/integrations/openclaw/jpl-horizons-state-vectors)
- [opencode](https://spiral.ai/integrations/opencode/jpl-horizons-state-vectors)
- [Perplexity](https://spiral.ai/integrations/perplexity/jpl-horizons-state-vectors)
- [Raycast](https://spiral.ai/integrations/raycast/jpl-horizons-state-vectors)
- [VS Code](https://spiral.ai/integrations/vscode/jpl-horizons-state-vectors)
- [Windsurf](https://spiral.ai/integrations/windsurf/jpl-horizons-state-vectors)
- [Zapier](https://spiral.ai/integrations/zapier/jpl-horizons-state-vectors)

## More Gemini CLI guides

- [JPL Horizons orbital elements](https://spiral.ai/integrations/gemini-cli/jpl-horizons-orbital-elements)
- [MIT Election Lab dataset details](https://spiral.ai/integrations/gemini-cli/mit-election-lab-dataset-details)
- [JPL Horizons observer ephemeris](https://spiral.ai/integrations/gemini-cli/jpl-horizons-observer-ephemeris)
- [MIT Election Lab dataset search](https://spiral.ai/integrations/gemini-cli/mit-election-lab-dataset-search)
- [JPL Horizons object lookup](https://spiral.ai/integrations/gemini-cli/jpl-horizons-object-lookup)
- [MIT Election Lab election returns](https://spiral.ai/integrations/gemini-cli/mit-election-lab-election-returns)

## Questions about JPL Horizons state vectors in Gemini CLI

**Can Gemini CLI use JPL Horizons state vectors?**

Yes. Add Spiral to Gemini CLI as an MCP server, and Gemini CLI can find and run JPL Horizons state vectors like any built-in tool.

**How much does JPL Horizons state vectors cost in Gemini CLI?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Gemini CLI plan is separate.

**Do I need an Alexandria account to use JPL Horizons state vectors in Gemini CLI?**

No. Spiral runs JPL Horizons state vectors on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up JPL Horizons state vectors in Gemini CLI?**

About two minutes: add the server, then sign in, then check it.

**Does Gemini CLI wait while JPL Horizons state vectors runs?**

JPL Horizons state vectors runs in the background. Gemini CLI starts the run, checks on it and gives you the json when it's ready.

**Which objects does Horizons cover?**

Horizons covers planets, natural satellites, asteroids, comets, the Sun, selected spacecraft, dynamical points, and system barycenters. Its spacecraft catalog covers selected missions.

**How fresh are the data?**

The small-body database updates hourly with new objects and orbit solutions. Spacecraft trajectories may update weekly or monthly and represent tracking fits and predictions.

**Can one name identify several objects?**

Yes. Juno can match spacecraft and an asteroid, while Halley can match both a comet and an asteroid; confirm the object category and identifier before interpreting its data.

**How far into the past or future does coverage extend?**

Each target has its own available trajectory interval. JPL reports coverage boundaries in Barycentric Dynamical Time, so there is no single date range that applies to every object.

**Can I extrapolate an orbit indefinitely from one set of elements?**

No. JPL warns that two-body extrapolation from osculating elements can produce large errors, especially for planetary satellites and comets, with error generally increasing farther from the elements' epoch.

