A REST API for the Messier Catalogue
of Deep Sky Objects 🌌

The Messier objects are a set of 110 deep sky objects catalogued by the French astronomer Charles Messier in his book, Catalogue des Nébuleuses et des Amas d'Étoiles ("Catalogue of Nebulae and Star Clusters"). Messier was only interested in finding comets, but these deep sky objects, which we now know as star clusters and galaxies and supernova remnants, could easily be mistaken for a wandering comet. Although the intended purpose of the catalogue was to help comet hunters to not mistake such a celestial object as a comet, the Messier objects are popular targets among amateur astronomers all over the world.

Documentation ☄️

You can only make GET calls to the API and fetch data

Fetch all objects

If you make a GET request to the /v1/objects endpoint, you will get the details of all the 110 Messier objects as a JSON array.


GET https://messier.deta.dev/v1/objects


   "common_name":"Crab Nebula",
   "declination":"+22° 00′ 52.2″,
   "ngc":"NGC 1952",
   "right_ascension":"05h 34m 31.94s",
   "type":"Supernova remnant"
 },  ... // 109 more


We can give queries for the type of the object and the constellation in this endpoint. We can use this to sort out different objects.

Suppose you want to get all the open clusters in the constellation of Auriga (There are 3 open clusters in Auriga)


GET https://messier.deta.dev/v1/objects?type=open cluster&constellation=auriga


    "declination":"+34° 08′ 4″",
    "ngc":"NGC 1960",
    "right_ascension":"05h 36m 12s",
    "type":"Open cluster"
    "declination":"+32° 33′ 02″",
    "ngc":"NGC 2099",
    "right_ascension":"05h 52m 18s",
    "type":"Open cluster"
    "declination":"+35° 51′ 18″",
    "ngc":"NGC 1912",
    "right_ascension":"05h 28m 42s",
    "type":"Open cluster"

Similarly, we can query the database as per our requirements. For now we can only search with the type of object and the constellation. Sorting by other parameters like magnitude or the coordinates are still in the works (Check out the code here)

Fetch single object

We can also fetch information about a single object. This could be useful if you know which object you want and don't want to search through the entire list

You can add the object number to the endpoint to get individual object details


GET https://messier.deta.dev/v1/objects/M15


  "ngc":"NGC 7078",
  "type":"Globular cluster",
  "right_ascension":"21h 29m 58.33s",
  "declination":"+12° 10′ 01.2″",


Special Credits

Other projects using this API

Working on a project? Create a PR to add it to this list!

Support my work

Support me in building such open source projects (and to possibly buy more accessories for my telescope 🙈)

UPI Payments

UPI ID : thatonephysicsnerd@oksbi


PayPal Email : cardseeder [at] gmail [dot] com

Made with 🖤 and 🔭 by @fillerInk