Astro-Phys.com Ephemeris API

This is a JSON API for querying the de406 ephemeris records.


Notes:

/api/de406/coefficients
URL for querying coefficient sets for ephemeris.
Returned in JSON format.
Parameter Default Description
date Current date/time Date of interest.
Scalar dates will be interpreted as julian days.
Structured dates will be parsed using dateutil
bodies

Comma separated list of body names.

Valid:
sun, mercury, venus, earthmoon, geomoon, mars, jupiter, uranus, neptune, pluto

unit km

Unit of measure for coefficient sets.

Valid:
km, m, mi, au, ly, ps

type chebyshev

Type of coefficient sets to return.

Valid:
chebyshev, polynomial

/api/de406/states
URL for querying states (position and velocity) from ephemeris.
Returned in JSON format.
Parameter Default Description
date Current date/time Date of interest.
Scalar dates will be interpreted as julian days.
Structured dates will be parsed using dateutil
bodies

Comma separated list of body names.

Valid:
sun, mercury, venus, earth, moon, earthmoon, geomoon, mars, jupiter, uranus, neptune, pluto

unit km

Unit of measure for coefficient sets.

Valid:
km, m, mi, au, ly, ps

/api/de406/records
URL for querying entire ephemeris records.
Returns multiple coefficient sets spanning one step of the ephemeris.
Returned in JSON format.
Parameter Default Description
date Current date/time Date of interest.
Scalar dates will be interpreted as julian days.
Structured dates will be parsed using dateutil
unit km

Unit of measure for coefficient sets.

Valid:
km, m, mi, au, ly, ps

Examples

Query for polynomial coefficients for mercury at January 1st, 1000AD:
/api/de406/coefficients?date=1000-1-1&bodies=mercury&type=polynomial
{
  "date": 2086307.5,
  "type": "polynomial",
  "unit": "km",
  "results": {
    "mercury": {
      "start": 2086304.5,            // Start date of mercury's coefficient set
      "end": 2086320.5,              // End date of mercury's coefficient set
      "coefficients": [
        [30861824.928134, ... ],     // X Axis Coefficients
        [-48487574.834549576, ... ], // Y Axis Coefficients
        [-29199466.317561075, ... ]  // Z Axis Coefficients
      ]
    }
  }
}

Attempt to query invalid body name:
/api/de406/coefficients?date=1000-1-1&bodies=nonsense
{"error": "nonsense is not a valid body"}

Query for state of mars at January 20th, 1000AD:
/api/de406/states?date=1000-1-20&bodies=mars
{
  "date": 2086326.5,
  "unit": "km",
  "results": {
    "mars": [
      [
        -168045229.22750974, // X Position
        164411532.9003423,   // Y Position
        80245103.26520184    // Z Position
      ],
      [
        -1449448.751232047,  // X Velocity
        -1150179.7595137728, // Y Velocity
        -484397.75425069826  // Z Velocity
      ]
    ]
  }
}

2011-2014 Davy Wybiral