---
title: "Sun and moon for a date"
method: GET
path: "/v1/sun-moon/{date}"
tags: ["Sun and moon"]
---

# Sun and moon for a date

`GET /v1/sun-moon/{date}`

## Request

- Base URL: `https://api.dharun.dev`
- URL: `https://api.dharun.dev/v1/sun-moon/{date}`
- Auth: none declared

For a pincode, a latitude and longitude, or (by default) New Delhi. A twilight time is null where the sun does not sink that far, and moonrise or moonset is null on the day each month the moon does not rise or set. The phase names a principal phase (new moon, first quarter, full moon, last quarter) for the whole date it falls on.

## Path parameters

- `date` string, required

## Query parameters

- `pincode` string
- `lat` number
- `lng` number
- `tz` string

## Response `200`

Success

- Envelope
  - `data` unknown, required
  - `meta` object, required
    - `limit` integer
    - `note` string
    - `offset` integer
    - `source` object: Where the data came from and the credit its licence asks for.
      - `attribution` string
      - `licence` string
      - `name` string
      - `retrieved` string
      - `url` string
      - `version` string
    - `total` integer

## Other responses

- `400`: Error
- `404`: Error
- `429`: Error

---

[API](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data.md) · [All operations](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/llms.txt) · [OpenAPI document](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/revisions/ecd8b0ec7863?raw)
