Skip Page Navigation
NASA JPL Caltech
NASA Logo - Jet Propulsion Laboratory + View the NASA Portal
+ Center for Near-Earth Object Studies
JPL Home Earth Solar System Stars & Galaxies Technology
JPL Solar System Dynamics
IMPORTANT: The SSD Announcement email list is now available. Major changes are coming in the near future, including possible hostname and/or URL changes. To be notified of such changes, subscribe to this email list.

Please visit this page for more details.

HORIZONS Batch-Interface

This tool provides a web-based batch-mode interface to JPL's HORIZONS system which can be used to generate ephemerides for solar-system bodies. To use this tool, you will need to fully understand the format and content of Horizons's E-mail interface and also how to properly submit the required URL.

Please submit one job at a time (not simultaneously). If you have several jobs, you can automate your submission such that as soon as one job finishes, the next is submitted.

The general concept for web-based batch submission is that you take your Horizons batch input file, convert it to an appropriate URL, then process the Horizons output. For example, given the following input file,

  COMMAND= '499'  
  START_TIME= '2000-01-01'  
  STOP_TIME= '2000-12-31'  
  STEP_SIZE= '15 d'  
  QUANTITIES= '1,9,20,23,24'  

you should form the corresponding URL for submission:'499'&MAKE_EPHEM='YES'  

 (Note that the above URL should be a single line and is only separated for readability.)

Essentially, the URL is formed by discarding all comments from the input file, including the "!$$SOF" directive, removing extraneous spaces from both sides of the '=', and escaping any special URL characters. For example, spaces should be converted to '%20'. Similarly for characters '?' (%3F), '&' (%26) and ';' (%3B). If the content of a parameter contains line-endings (e.g. "TLE="), those line-endings must also be escaped (e.g., carriage-returns converted to '%0D' and line-feeds converted to '%0A'). There may be others as well.

A sample Perl script to read an input file from STDIN, submit the HTTP request using the CPAN LWP::UserAgent module, and display the results is available here. It should be possible to write such scripts in other languages and using other HTTP methods as well. You should ensure your script checks for error messages. Ideally, check for the expected Horizons output and if not found, assume an error occurred.

Please note that appended to the output from a successful Horizons job is the formatted version of your input parameters which were used by Horizons (i.e. in the form described for use by the E-mail batch interface). This is designed to assist in case of errors from Horizons or other unexpected output.

FirstGov 2019-Aug-25 23:25 UT
(server date/time)  
NASA Home Page
Site Manager:   Ryan S. Park
Webmaster  Alan B. Chamberlin