---
title: "Sun times (v1, stable legacy)"
method: GET
path: "/json"
---

# Sun times (v1, stable legacy)

`GET /json`

Original endpoint, supported indefinitely without changes. Defaults to 12h AM/PM times in UTC; `formatted=0` switches to ISO 8601 and day_length in seconds. Known quirks kept for compatibility: errors use `{results:'', status:'INVALID_*'}` with HTTP 400; polar days return epoch-1970 timestamps; an invalid `tzid` silently falls back to UTC. New integrations should use `/v2`.

## Query parameters

- `lat` number, required
- `lng` number, required
- `date` string
- `formatted` 0 | 1
- `tzid` string
- `callback` string

## Response `200`

OK.

- V1Response
  - `results` union — Object on success; empty string on error.
    - object
      - `sunrise` string
      - `sunset` string
      - `solar_noon` string
      - `day_length` union — HH:MM:SS string when formatted=1, seconds when formatted=0.
        - string
        - integer
      - `civil_twilight_begin` string
      - `civil_twilight_end` string
      - `nautical_twilight_begin` string
      - `nautical_twilight_end` string
      - `astronomical_twilight_begin` string
      - `astronomical_twilight_end` string
    - ''
  - `status` 'OK' | 'INVALID_REQUEST' | 'INVALID_DATE' | 'UNKNOWN_ERROR'
  - `tzid` string — Present on OK responses.

## Other responses

- `400` — INVALID_REQUEST (lat or lng MISSING -- note that non-numeric values are computed as 0 and return status OK, a frozen v1 quirk) or INVALID_DATE.
- `429` — Rate limited.

---

[API](https://skmtc.dev/sunrise-sunset/apis/sunrise-sunset-org-api.md) · [All operations](https://skmtc.dev/sunrise-sunset/apis/sunrise-sunset-org-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sunrise-sunset/sunrise-sunset-org-api/revisions/328b73a5fbe8/schema)
