# Julian Day Calculator API

> Julian Day Calculator converts between Gregorian calendar dates and Julian Day Numbers (JDN). Julian Day is a continuous count of days used in astronomy and historical research.

**Endpoint:** `GET https://api.apiverve.com/v1/julianday`  
**Category:** Science  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/julianday

## Overview

A Julian day calculator that works both ways as a Julian date converter: send a date to get its Julian Day Number and Modified Julian Date, or send a JDN to get the calendar date back. These are astronomical day counts, not dates in the old Julian calendar. Each response also gives the day of the week, the ISO week number and the day of the year.

Astronomers, satellite and observatory software, historians and data engineers use a continuous day count because subtracting two numbers is simpler and safer than date arithmetic across months, leap years and centuries. It is also a quick way to check the JDN or MJD printed in a dataset, an ephemeris or a log file.

The Free plan returns the conversion with the weekday, week number and day of year. Paid plans add daysFromToday, the signed number of days between the date and today, useful for countdowns and age-of-record checks.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/julianday?date=2024-03-15" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string | Yes | The Gregorian date in YYYY-MM-DD format. An ISO date-time (2024-03-15T18:00:00Z) is also accepted and sets the time used for julianDate; without Z or an offset the time is read as UT. datetime |

## Response fields

- `gregorian` — string · The equivalent Gregorian calendar date
- `julianDayNumber` — number · Days elapsed since noon on 1 January 4713 BC
- `modifiedJulianDate` — number · Julian day number shifted to start at midnight on 17 November 1858
- `dayOfWeek` — string · Day of the week the date falls on
- `weekNumber` — number · ISO week number (1-53)
- `dayOfYear` — number · Day of the year (1-366)
- `daysFromToday` — number · Number of days from today (negative = past, positive = future) · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "gregorian": "2024-03-15",
    "julianDayNumber": 2460385,
    "modifiedJulianDate": 60384.5,
    "dayOfWeek": "Friday",
    "weekNumber": 11,
    "dayOfYear": 75,
    "daysFromToday": -340
  }
}
```

## Use cases

- **Astronomical Software** — Calculate precise day numbers for celestial events
- **Historical Research** — Convert historical dates to a unified day count
- **Date Arithmetic** — Calculate day differences across long time spans
- **Scientific Applications** — Use continuous day counts for time series data

## SDKs

- **npm** — `npm install @apiverve/julianday` (https://www.npmjs.com/package/@apiverve/julianday)
- **NuGet** — `dotnet add package APIVerve.API.JulianDayCalculator` (https://www.nuget.org/packages/APIVerve.API.JulianDayCalculator)
- **Source** — https://github.com/apiverve/julianday-api

## More

- Full reference: https://docs.apiverve.com/ref/julianday
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
