For developers

Julian Date API & Widget

A free JSON API over the same tested conversion engine this whole site runs on. No key, no sign-up, no rate limit, CORS open to any origin. Today is 2026260see it as JSON.

Endpoints

EndpointReturnsTry it
/api/today.json Today's Julian date in every format, in UTC. run
/api/convert.json?date=YYYY-MM-DD A calendar date → day-of-year code, JD, MJD and JDN. run
/api/convert.json?julian=YYYYDDD A day-of-year code → calendar date. Accepts DDD, YYDDD or YYYYDDD. run
/api/convert.json?jd=NUMBER An astronomical Julian Date → UTC calendar date and time. run
/api/convert.json?mjd=NUMBER A Modified Julian Date → UTC calendar date and time. run
/api/calendar/YYYY.json Every date in a year with its day-of-year code. One request. run

Quick start

curl https://todayjuliandate.com/api/today.json

Returns:

{
  "generatedAt": "2026-09-17T09:55:49Z",
  "timezone": "UTC",
  "date": "2026-09-17",
  "longDate": "Thursday, September 17, 2026",
  "ordinal": {
    "dayOfYear": 260,
    "ddd": "260",
    "yyddd": "26260",
    "yyyyddd": "2026260"
  },
  "astronomical": {
    "jd": 2461300.91376,
    "mjd": 61300.41376,
    "jdn": 2461301
  },
  "year_info": {
    "year": 2026,
    "isLeapYear": false,
    "daysInYear": 365,
    "dayOfYear": 260,
    "daysRemaining": 105
  }
}

JavaScript

const res = await fetch('https://todayjuliandate.com/api/today.json');
const { ordinal } = await res.json();
console.log(ordinal.yyyyddd);  // "2026260"

Python

import urllib.request, json

url = "https://todayjuliandate.com/api/convert.json?julian=2026260"
with urllib.request.urlopen(url) as r:
    data = json.load(r)

print(data["date"])       # 2026-09-17
print(data["longDate"])   # Thursday, September 17, 2026

Notes

  • Time zone. Every response is UTC. Near midnight your local day-of-year may differ by one — if that matters, send an explicit date= rather than relying on today.json.
  • Caching. Conversions are pure functions of their query string and are served with a long Cache-Control. today.json is cached for 60 seconds.
  • Errors. Bad input returns HTTP 400 with an error message and, where useful, a hint.
  • Accuracy. Astronomical values follow Meeus, Astronomical Algorithms (2nd ed.), ch. 7, and switch to the Julian calendar before the 1582 reform. See Julian Day for the background.
  • Fair use. It is free and unmetered. If you are going to hammer it, cache the response — a day-of-year code changes once a day.

Embeddable widget

One line, no dependencies, no network request of its own — it computes the date from the visitor's own clock, so it is always right and always instant.

<script src="https://todayjuliandate.com/widget.js"></script>

Renders as:

With options:

<script src="https://todayjuliandate.com/widget.js"
        data-format="full"
        data-theme="auto"></script>
AttributeDefaultValues
data-format yyyyddd yyyyddd · yyddd · ddd · jd · mjd · full
data-theme auto auto · light · dark
data-tz local local · utc
data-link true Set to false to drop the credit link
data-target CSS selector to render into, instead of in place

As an iframe

If a script tag is not allowed where you need it, embed the standalone page instead:

<iframe src="https://todayjuliandate.com/embed/"
        width="320" height="150" frameborder="0"
        title="Today's Julian date"></iframe>

Licence

Both the API and the widget are free for any use, including commercial. No attribution is required, though a link back to todayjuliandate.com is appreciated and is what keeps them free.