Skip to main content

JPL HORIZONS System client

Project description


A python client for the JPL HORIZONS System.

This is an ugly regex fueled API. JPL has a much cleaner SSD/CNEOS API Service that overlaps with HORIZONS in some places. HORIZONS' orbital element data on "Major Bodies" (i.e. planets, moons, and some others) are not available yet in this other collection of APIs. This project only aims to cover those features.

Only getting position and velocity vectors of major bodies is supported. This project could be extended to pull from other features of HORIZONS, like retrieving orbital elements.


from horizons import Horizons

with Horizons() as h:
    bodies = h.get_major_bodies() # equivalent to 'MB' in HORIZONS
    # [
    #   ...,
    #   horizons.BodyResult(
    #     id='301',
    #     name='Moon',
    #     designation='',
    #     other='Luna'
    #   ),
    #   ...
    # ]

    moon_vectors = h.get_vectors('301', center='399')
    # horizons.VectorsResult(
    #   epoch_jd_tdb=2458642.5,
    #   calendar_date_tdb='A.D. 2019-Jun-08 00:00:00.0000',
    #   pos_km=(
    #     -268370.0664760619,
    #     252047.1714898835,
    #     16377.37006983293
    #   ),
    #   vel_kmps=(
    #     -0.7239795957732902,
    #     -0.7759062564667508,
    #     0.08457449888090685
    #   )
    # )

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for horizons, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size horizons-0.2.2.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View
Filename, size horizons-0.2.2-py3-none-any.whl (7.7 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page