Astro-Phys.com Ephemeris API
This is the JSON API for querying the de406 ephemeris.
All results are returned in JSON format.
Errors are returned as {"error": "Error message"} so check for an "error" attribute.
Requests involving dates will always return the date in julian days as an attribute of the main object.
/api/de406/constants returns a JSON object containing the constants from the ephemeris header.
All results are returned in JSON format.
Errors are returned as {"error": "Error message"} so check for an "error" attribute.
Requests involving dates will always return the date in julian days as an attribute of the main object.
/api/de406/constants returns a JSON object containing the constants from the ephemeris header.
/api/de406/coefficients
URL for querying coefficient sets for ephemeris.
Returned in JSON format.
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: |
|
| unit | km |
Unit of measure for coefficient sets. Valid: |
| type | chebyshev |
Type of coefficient sets to return. Valid: |
/api/de406/states
URL for querying states (position and velocity) from ephemeris.
Returned in JSON format.
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: |
|
| unit | km |
Unit of measure for coefficient sets. Valid: |
/api/de406/records
URL for querying entire ephemeris records.
Returns multiple coefficient sets spanning one step of the ephemeris.
Returned in JSON format.
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: |
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
]
]
}
}
|