<p>Not really an answer to your question, but you may still find some of these resources helpful/interesting:</p>
<ul>
<li><a href="https://astronomy.stackexchange.com/q/13488/7982">Where can I find the positions of the planets, stars, moons, artificial satellites, etc. and visualize them?</a></li>
</ul>
<h3>How to find the numerical positions of (moons, planets, stars and artificial satellites) in the sky?</h3>
<p><strong>The positions and velocities of moons and planets</strong> os first calculated by a big program that uses <a href="https://en.wikipedia.org/wiki/Numerical_integration" rel="nofollow noreferrer">numerical integration</a> to solve the <a href="https://en.wikipedia.org/wiki/N-body_problem" rel="nofollow noreferrer">n-body problem</a> using an <a href="https://en.wikipedia.org/wiki/N-body_simulation" rel="nofollow noreferrer">n-body simulation</a> for thousands of years into the past and into the future.</p>
<p>The positions and velocities at lots of points in time are stored as a giant table in a computer file called an ephemeris. The most commonly used ones now are the <a href="https://en.wikipedia.org/wiki/Jet_Propulsion_Laboratory_Development_Ephemeris" rel="nofollow noreferrer">Jet Propulsion Laboratory (JPL) Development Ephemerides</a></p>
<p><strong>Star positions and distances, and their <a href="https://en.wikipedia.org/wiki/Proper_motion" rel="nofollow noreferrer">proper motions</a></strong> are stored in a variety of <a href="https://en.wikipedia.org/wiki/Star_catalogue#Full-sky_catalogues_(in_chronological_order)" rel="nofollow noreferrer">star catalogs</a> the most famous of which is recently the <a href="https://en.wikipedia.org/wiki/Gaia_catalogues" rel="nofollow noreferrer">GAIA catalogs</a>.</p>
<p><strong>Artificial satellites of Earth</strong> are constantly tracked by radar and optical observations by government agencies and <em>short-term</em> ephemerides are generated by <a href="https://en.wikipedia.org/wiki/Two-line_element_set" rel="nofollow noreferrer">Two Line Element Sets (TLEs)</a> that are regularly updated<sup>1</sup> because the orbits of artificial satellites of Earth are constantly changing primarily due to atmospheric drag, Earth's lumpy gravity field, and propulsive maneuvers that they might be commanded to do to adjust their orbits. (same goes for the larger pieces of space junk)</p>
<p>TLEs and more info can be found at <a href="https://celestrak.org/" rel="nofollow noreferrer">Celestrak.org</a> (open access) and <a href="https://www.space-track.org/auth/login" rel="nofollow noreferrer">Space-Track.org</a> which requires (free) registration and a working email address.</p>
<p>TLEs are most useful for a few days to a few weeks - maybe longer for those that are higher up and away from atmospheric drag, but they are never super-accurate - a few kilometers at best, usually tens of kilometers off after several days.</p>
<hr />
<p><sup>1</sup>generally by the US government, but see also</p>
<ul>
<li><a href="https://space.stackexchange.com/q/18300/12102">How (the heck) are military satellites with (apparently) classified TLEs still showing up on sat map websites?</a></li>
</ul>
<hr />
<h3>...is there an API that can be interacted in JavaScript or Python?</h3>
<p>For Python for almost all of these the best one-stop shopping solution is <a href="https://rhodesmill.org/skyfield/" rel="nofollow noreferrer">Skyfield</a>.</p>
<p>There are Skyfield tagged questions in:</p>
<ul>
<li><a href="https://astronomy.stackexchange.com/questions/tagged/skyfield">Astronomy SE</a> (16 questions)</li>
<li><a href="https://space.stackexchange.com/questions/tagged/skyfield">Space Exploration SE</a> (40 questions)</li>
<li><a href="https://stackoverflow.com/questions/tagged/skyfield">Stack Overflow</a> (92 questions)</li>
</ul>
<p>The &quot;main place&quot; to go is JPL's <a href="https://ssd.jpl.nasa.gov/horizons/app.html#/" rel="nofollow noreferrer">Horizions</a> which is based on the JPL Development Ephemerides and also has calculated trajectories for deep space missions from some Apollo missions all the way to an occasional projected (planned) trajectory for a future mission.</p>
<p>There are API interfaces for Horizons as well, both from NASA (I think) and some home-grown ones discussed here in Astronomy SE and in <a href="https://space.stackexchange.com/">Space Exploration SE</a>.</p>

CC BY-SA 4.0
2023-05-27T11:00:04.497Z
2023-05-27T11:00:04.497Z
uhoh
<p>Astronomical objects, including stars, planets and the surface of the Earth, move in a very regular and predictable way.  This means that their positions can be calculated and predicted years (sometimes millennia) in advance.</p>
<p>An observer on Earth with move with the surface of the Earth.  The Earth is rotating (at a very regular rate) and moving around the sun in an orbit that mostly obey's Kepler's laws and so can be calculated</p>
<p>Satellites orbit the Earth, they do so in elliptical orbits that obey Kepler's laws. So to find the position of a satellite you must use the description of its orbit, solve Kepler's equations and combine this with a calculated position of the observer.</p>
<p>Planets move around the sun in orbits that mostly obey Kepler's laws. Again this allows you to calculate the relative position of the planet to the Earth.  These calculations are called astronomical algorithms and are described in a famous book by Meeus (and elsewhere).</p>
<p>Stars hardly move at all. Their apparent motion is entirely due to the movement of the Earth.</p>
<p>Apps that display the positions of astronomical bodies implement these algorithms.</p>

CC BY-SA 4.0
2023-05-26T19:59:37.037Z
2023-05-26T19:59:37.037Z
James K
<p>How do star locator applications such as SkyGuide, SkySafari and Stellarium get the current and future positions of
moons, planets, stars and artificial satellites in the sky?</p>
<p>Is there a public database that keeps track of all the positions of celestial objects in the sky that they call access to?
If so is there an API that can be interacted in JavaScript or Python?
For context I’m trying to make a website the tracks the positions of artificial satellites.</p>

CC BY-SA 4.0
2023-05-26T14:26:47.540Z
We tend to focus on natural bodies on this site, although satellites that carry astronomical instruments are on-topic here. There's info about artificial satellites on Space.SE, eg https://space.stackexchange.com/q/24444/38535
PM 2Ring
CC BY-SA 4.0
2023-05-26T14:29:47.127Z
For natural Solar System bodies, see Horizons: https://ssd.jpl.nasa.gov/horizons/ (which also has data for various spacecraft).
PM 2Ring
CC BY-SA 4.0
2023-05-26T15:36:21.173Z
Search for the Hipparcos and Tycho catalogs.  There are a lot of different catalogs, but that's a descent place to start.  This has the Hipparcos catalog in some easy to use formats: https://github.com/gmiller123456/hip2000
Greg Miller
<orbit><coordinate><artificial-satellite>
How to find the numerical positions of objects in the sky?
User44356
# How to find the numerical positions of objects in the sky?

(Asked by: username_0 on 2023-05-26)

How do star locator applications such as SkyGuide, SkySafari and Stellarium get the current and future positions of
moons, planets, stars and artificial satellites in the sky?

Is there a public database that keeps track of all the positions of celestial objects in the sky that they call access to?
If so is there an API that can be interacted in JavaScript or Python?
For context I’m trying to make a website the tracks the positions of artificial satellites.

**Tags:** orbit, coordinate, artificial-satellite

> **Comments:**
> **username_1**: We tend to focus on natural bodies on this site, although satellites that carry astronomical instruments are on-topic here. There's info about artificial satellites on Space.SE, eg https://space.stackexchange.com/q/24444/38535  
> **username_1**: For natural Solar System bodies, see Horizons: https://ssd.jpl.nasa.gov/horizons/ (which also has data for various spacecraft).  
> **username_2**: Search for the Hipparcos and Tycho catalogs.  There are a lot of different catalogs, but that's a descent place to start.  This has the Hipparcos catalog in some easy to use formats: https://github.com/gmiller123456/hip2000  

---

## 2 answers

### Answer by username_3 on 2023-05-27. Score: 2 | Accepted answer

Not really an answer to your question, but you may still find some of these resources helpful/interesting:

* [Where can I find the positions of the planets, stars, moons, artificial satellites, etc. and visualize them?](https://astronomy.stackexchange.com/q/13488/7982)

### How to find the numerical positions of (moons, planets, stars and artificial satellites) in the sky?

**The positions and velocities of moons and planets** os first calculated by a big program that uses [numerical integration](https://en.wikipedia.org/wiki/Numerical_integration) to solve the [n-body problem](https://en.wikipedia.org/wiki/N-body_problem) using an [n-body simulation](https://en.wikipedia.org/wiki/N-body_simulation) for thousands of years into the past and into the future.

The positions and velocities at lots of points in time are stored as a giant table in a computer file called an ephemeris. The most commonly used ones now are the [Jet Propulsion Laboratory (JPL) Development Ephemerides](https://en.wikipedia.org/wiki/Jet_Propulsion_Laboratory_Development_Ephemeris)

**Star positions and distances, and their [proper motions](https://en.wikipedia.org/wiki/Proper_motion)** are stored in a variety of [star catalogs](https://en.wikipedia.org/wiki/Star_catalogue#Full-sky_catalogues_(in_chronological_order)) the most famous of which is recently the [GAIA catalogs](https://en.wikipedia.org/wiki/Gaia_catalogues).

**Artificial satellites of Earth** are constantly tracked by radar and optical observations by government agencies and *short-term* ephemerides are generated by [Two Line Element Sets (TLEs)](https://en.wikipedia.org/wiki/Two-line_element_set) that are regularly updated1 because the orbits of artificial satellites of Earth are constantly changing primarily due to atmospheric drag, Earth's lumpy gravity field, and propulsive maneuvers that they might be commanded to do to adjust their orbits. (same goes for the larger pieces of space junk)

TLEs and more info can be found at [Celestrak.org](https://celestrak.org/) (open access) and [Space-Track.org](https://www.space-track.org/auth/login) which requires (free) registration and a working email address.

TLEs are most useful for a few days to a few weeks - maybe longer for those that are higher up and away from atmospheric drag, but they are never super-accurate - a few kilometers at best, usually tens of kilometers off after several days.

---

1generally by the US government, but see also

* [How (the heck) are military satellites with (apparently) classified TLEs still showing up on sat map websites?](https://space.stackexchange.com/q/18300/12102)

---

### ...is there an API that can be interacted in JavaScript or Python?

For Python for almost all of these the best one-stop shopping solution is [Skyfield](https://rhodesmill.org/skyfield/).

There are Skyfield tagged questions in:

* [Astronomy SE](https://astronomy.stackexchange.com/questions/tagged/skyfield) (16 questions)
* [Space Exploration SE](https://space.stackexchange.com/questions/tagged/skyfield) (40 questions)
* [Stack Overflow](https://stackoverflow.com/questions/tagged/skyfield) (92 questions)

The "main place" to go is JPL's [Horizions](https://ssd.jpl.nasa.gov/horizons/app.html#/) which is based on the JPL Development Ephemerides and also has calculated trajectories for deep space missions from some Apollo missions all the way to an occasional projected (planned) trajectory for a future mission.

There are API interfaces for Horizons as well, both from NASA (I think) and some home-grown ones discussed here in Astronomy SE and in [Space Exploration SE](https://space.stackexchange.com/).


---

### Answer by username_4 on 2023-05-26. Score: 1

Astronomical objects, including stars, planets and the surface of the Earth, move in a very regular and predictable way. This means that their positions can be calculated and predicted years (sometimes millennia) in advance.

An observer on Earth with move with the surface of the Earth. The Earth is rotating (at a very regular rate) and moving around the sun in an orbit that mostly obey's Kepler's laws and so can be calculated

Satellites orbit the Earth, they do so in elliptical orbits that obey Kepler's laws. So to find the position of a satellite you must use the description of its orbit, solve Kepler's equations and combine this with a calculated position of the observer.

Planets move around the sun in orbits that mostly obey Kepler's laws. Again this allows you to calculate the relative position of the planet to the Earth. These calculations are called astronomical algorithms and are described in a famous book by Meeus (and elsewhere).

Stars hardly move at all. Their apparent motion is entirely due to the movement of the Earth.

Apps that display the positions of astronomical bodies implement these algorithms.


---

