This API serves JSON over HTTPs. It allows you to determine whether Mercury is in retrograde for a given date.
Mercury Retrograde can really suck. I experience communication breakdowns frequently when Mercury is in retrograde. Maybe you do too. Click here to learn more about it.
Basic Example
At the most basic level, you just need to make a GET request to the API. No auth, no body needed.
> curl https://mercuryretrogradeapi.com {"is_retrograde":true}
Options
The only available option is a 'date' parameter in the GET request. It should contain a date in the YYYY-MM-DD format.
> curl https://mercuryretrogradeapi.com?date=2016-09-14 {"is_retrograde":true} > curl https://mercuryretrogradeapi.com?date=2016-10-01 {"is_retrograde":false}
JavaScript Example
This API is CORS enabled, meaning you can call it directly from a browser on any website.
fetch('https://mercuryretrogradeapi.com') .then(res => res.json()) .then(data => data.is_retrograde) .then(isRetrograde => { // the isRetrograde will be true/false alert(isRetrograde ? 'YES' : 'NO') })
It's free (really)! This API is used in production at Gingr. Over the years this API has been used in smart homes, other astrology websites, and many other things. I plan on hosting this API for many years to come, free of charge.
This service has been online since 2015. In mid-2022, hosting was moved to fly.io. The API is now served over an anycast network in 5+ geographically distinct regions with automatic failover.
Email me here.