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.

Request

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

Response

 
        
{"value":[
 {
   "chart":"https://freestarcharts.com/images/Articles/Messier/Single/M1_Finder_Chart.pdf",
   "common_name":"Crab Nebula",
   "constellation":"Taurus",
   "declination":"+22° 00′ 52.2″,
   "distance":"4.9–8.1",
   "key":"M1",
   "magnitude":"8.4",
   "ngc":"NGC 1952",
   "picture_url":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/150px-Crab_Nebula.jpg",
   "right_ascension":"05h 34m 31.94s",
   "type":"Supernova remnant"
 },
 {	
     ...
 },  ... // 109 more
]}
        
    

Queries

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)

Request

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

Response

 
        
{"value":[ 
  {
    "chart":"https://freestarcharts.com/images/Articles/Messier/Single/M36_Finder_Chart.pdf","common_name":"–",
    "constellation":"Auriga",
    "declination":"+34° 08′ 4″",
    "distance":"4.1",
    "key":"M36",
    "magnitude":"6.3",
    "ngc":"NGC 1960",
    "picture_url":"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/M36a.jpg/150px-M36a.jpg",
    "right_ascension":"05h 36m 12s",
    "type":"Open cluster"
  },
  {
    "chart":"https://freestarcharts.com/images/Articles/Messier/Single/M37_Finder_Chart.pdf",
    "common_name":"–",
    "constellation":"Auriga",
    "declination":"+32° 33′ 02″",
    "distance":"4.511",
    "key":"M37",
    "magnitude":"6.2",
    "ngc":"NGC 2099",
    "picture_url":"https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/M37a.jpg/150px-M37a.jpg",
    "right_ascension":"05h 52m 18s",
    "type":"Open cluster"
  },
  {
    "chart":"https://freestarcharts.com/images/Articles/Messier/Single/M38_Finder_Chart.pdf",
    "common_name":"–",
    "constellation":"Auriga",
    "declination":"+35° 51′ 18″",
    "distance":"4.2",
    "key":"M38",
    "magnitude":"7.4",
    "ngc":"NGC 1912",
    "picture_url":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/M38_Open_Cluster.jpg/150px-M38_Open_Cluster.jpg",
    "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

Request

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

Response

 
        
{
  "key":"M15",
  "ngc":"NGC 7078",
  "common_name":"–",
  "picture_url":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/Messier_15_Hubble_WikiSky.jpg/150px-Messier_15_Hubble_WikiSky.jpg",
  "type":"Globular cluster",
  "distance":"33",
  "constellation":"Pegasus",
  "magnitude":"6.2",
  "right_ascension":"21h 29m 58.33s",
  "declination":"+12° 10′ 01.2″",
  "chart":"https://freestarcharts.com/images/Articles/Messier/Single/M15_Finder_Chart.pdf"
}
        
    

Contributing

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

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



Made with 🖤 and 🔭 by @fillerInk