Skip to content

Sunrise-Sunset API

1 endpointTravel, Maps & WeatherGlobalsocial:read1 real examples

Returns sunrise, sunset, solar noon and twilight times for a place and date.

View as Markdown
GET/sunrisesunset/daySunrise, sunset, solar noon and twilight times of a place on a date.

day

GET/v1/sunrisesunset/day

Sunrise, sunset, solar noon and twilight times of a place on a date.

scope social:read1 unitcached 12 h

Parameters

lat
string
required
Latitude, -90 to 90.
e.g. 51.5072
lon
string
required
Longitude, -180 to 180.
e.g. -0.1276
date
string
Date, YYYY-MM-DD. Defaults to today (UTC).
e.g. 2024-06-21
tunnel
string
Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy.
proxy
string
Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it.
profileId
string
Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only.

Response data

11 fields
astronomicalTwilightBeginstring
astronomicalTwilightEndstring
civilTwilightBeginstring
civilTwilightEndstring
datestring
dayLengthSecinteger (int64)
nauticalTwilightBeginstring
nauticalTwilightEndstring
solarNoonstring
sunrisestring
sunsetstring
curl "https://api.hoshime.com/v1/sunrisesunset/day?lat=51.5072&lon=-0.1276&date=2024-06-21" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Real response
{
  "data": {
    "astronomicalTwilightBegin": "",
    "astronomicalTwilightEnd": "",
    "civilTwilightBegin": "2024-06-21T02:55:31Z",
    "civilTwilightEnd": "2024-06-21T21:09:21Z",
    "date": "2024-06-21",
    "dayLengthSec": 59911,
    "nauticalTwilightBegin": "2024-06-21T01:40:53Z",
    "nauticalTwilightEnd": "2024-06-21T22:23:59Z",
    "solarNoon": "2024-06-21T12:02:26Z",
    "sunrise": "2024-06-21T03:43:10Z",
    "sunset": "2024-06-21T20:21:41Z"
  },
  "meta": {
    "cached": false,
    "endpoint": "day",
    "fetchedAt": "2026-11-06T09:41:00Z",
    "platform": "sunrisesunset",
    "requestId": "req_2Xb9kQ…",
    "units": 1
  }
}
esc
↑↓ move↵ open