API Reference

What is This?

Here is a simple API for programmers who wish to query the HIP stars database in an easy fashion, say, for software applications. Currently, only the Hipparcos Star stars (down to mag 6.5) and Nearby Stars (139 stars) tables are connected to this API, others, such as deepsky or exoplanets are planned to be added one by one.

Syntax: http://www.astropical.space/astrodb/api.php?table=xxxx&which=xxxx&limit=xxxx&format=csv|xml|json

Results for nearby stars return empty attributes for HIP, HD and SAO as well as rad (radial velocity), unavailable parameters are either '0' or '-999'.

On March 29th, 2017, a 'CORS' header has been added to the output on user request.

If the returned result shows meaninglessly unformatted text, please open the source (right click: "View page source").


Example query code tells more than words

The base URL is http://www.astropical.space/astrodb/

Get all stars in Ursa Minor in CSV

api.php?table=stars&which=constellation&limit=umi&format=csv Try


Get all stars down to magnitude 2 in XML

api.php?table=stars&which=magnitude&limit=2&format=xml Try


Get all stars up to 32 light-years in JSON

api.php?table=stars&which=distance&limit=32&format=json Try


Get all stars of spectral class 'G' in XML

api.php?table=stars&which=spectrum&limit=g&format=xml Try


Get all stars with radial velocity above ±100km/s in XML

api.php?table=stars&which=radial&limit=100&format=xml Try


Get all stars with mass above 100 solar in CSV

api.php?table=stars&which=mass&limit=100&format=csv Try


Get all stars with radius above 10 solar in XML

api.php?table=stars&which=radius&limit=10&format=xml Try


Get by star common name in CSV

api.php?table=stars&which=name&limit=alde&format=csv Try
Result is 'Aldebaran' and 'Alderamin'


Get by star designation (Bayer or Flamsted) in CSV

api.php?table=stars&which=designation&limit=zet&format=csv Try
Result is all stars with designated 'Zeta'.


Get HIP 36850 (Castor) in CSV

api.php?table=stars&which=hip&limit=36850&format=csv Try
In analogy, you may wish to query HD (which=hd), HR (which=hr)
and SAO (which=sao) catalog numbers.