---
title: "Astronomy"
method: GET
path: "/astronomy.json"
tags: ["Geo"]
---

# Astronomy

`GET /astronomy.json`

Returns sunrise, sunset, moonrise, moonset, moon phase, and moon illumination for a given location and date.

## Query parameters

- `key` string, required
- `q` string, required
- `dt` string, date, required

## Response `200`

Astronomy data

- AstronomyResponse
  - `location` Location — Location metadata returned with every weather response.
    - `name` string — Location name
    - `region` string — Region or state
    - `country` string — Country name
    - `lat` number, float — Latitude
    - `lon` number, float — Longitude
    - `tz_id` string — IANA timezone ID, e.g. Europe/London
    - `localtime_epoch` integer — Local time as Unix epoch
    - `localtime` string — Local date and time string
  - `astronomy` object
    - `astro` AstroElement
      - `sunrise` string
      - `sunset` string
      - `moonrise` string
      - `moonset` string
      - `moon_phase` string
      - `moon_illumination` number
      - `is_moon_up` integer
      - `is_sun_up` integer

## Other responses

- `400` — Bad request — invalid parameter or location not found.
- `401` — Unauthorized — API key missing or invalid.

---

[API](https://skmtc.dev/weatherapi/apis/weatherapi-com.md) · [All operations](https://skmtc.dev/weatherapi/apis/weatherapi-com/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/weatherapi/weatherapi-com/revisions/bf3da15deb3e/schema)
