Using The NASA/JPL Horizons API via PHP
PHP Programs by Jay Tanner - 2025
  • The PHP programs here examples of some of the possible programs that can be built around the NASA/JPL Horizons API.  Many of them come with full source code and are ready to run.  Using them will require a PHP-enabled web server, such as a personal web site, and Internet access to interact with the NASA/JPL server.


  • PHP Version
    Most of the programs here have been updated to PHP v8.2.12 via XAMPP

    All program source code and any related images are released to the public domain and may be freely edited and modified in any way desired.

  • The Horizons API
    The programs implement the functions of the NASA/JPL Horizons API and perform some of the same operations as the on-line app at:
    https://ssd.jpl.nasa.gov/horizons/app.html

    Any ephemerides generated by these programs are governed by the rules found in the API documentation at:
    https://ssd-api.jpl.nasa.gov/doc/horizons.html

  • Caveats
    Since the programs are mostly to serve as examples or proof-of-concept, there may be some minor bugs.  However, they do demonstrate the basics of how to interact with the API remotely via PHP and can still serve as useful tools.

    And since the source code is in the public domain, if you are a PHP programmer, you are free to edit and improve upon them any way you like.

    JayTan