What are some APIs for getting the positions of planets in our solar system?

0
16
Asked By CosmicExplorer42 On

I'm working on a project focused on orbital mechanics and I need to retrieve the current positions of planets in the Solar System to use as a foundation. Specifically, I'm looking for APIs that can provide not only the positions (either relative to the Sun or Earth) but also details like velocities, masses, and radii of the planets. Any suggestions on where I can find this information?

6 Answers

Answered By CuriousCoder On

If you're working locally, consider using PyEphem, though I'm not sure if it includes all the data you need. It could be a good start!

Answered By OrbitMaster On

Do you really need API requests, though? Maybe consider using a library or package that already has this information!

Answered By AstroGeek42 On

Don't forget to explore the Astroquery package! It could serve you well depending on what you're after.

Answered By StellarFanatic99 On

I found a few good options after a quick search! Check out the NASA JPL Horizons API, AstronomyAPI, and Open Notify. NASA SPICE is another solid choice, especially if you're looking for a toolkit. And don't miss Skyfield if you're into Python libraries!

DataNerd12 -

I think the best route is using the Skyfield Python module with the downloaded SPICE kernels from JPL. They cover the time periods and the planets you're interested in.

Answered By PlanetLover21 On

I came across a cool API called `visibleplanets.dev`. Check it out! Also, if you're looking for variations of questions, there's a relevant one on Astronomy Stack Exchange that you might find useful. One tip: you might want to abstract the API calls in your code. That way, if you find a better source later, it makes switching easier, plus you can start with hardcoded results for testing!

Answered By AstronomyBuff On

You might also want to look at the site for USNO's API for some data. They have a decent amount of information available for astronomical calculations.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.