Panchang & timing
Sun and Moon
POST/v1/sun-moon
Sunrise, sunset, solar noon and twilight, moonrise, moonset, moon phase, illumination and the next phases.
- Near the poles the Sun may not rise or set: then those times are null and polar says why.
- Moon values are for local solar noon, or for time when you send it.
Request
| Field | Type | Description |
|---|---|---|
| date | stringrequired | YYYY-MM-DD |
| time | string | HH:MM; default is local sunrise |
| lat | number | Latitude, -90 to 90 (north positive). Send lat, lon and tz, or place, or place_id |
| lon | number | Longitude, -180 to 180 (east positive) |
| tz | string | IANA zone (Asia/Kolkata) or offset (+05:30). Needed with lat and lon; filled in with a place |
| place | string | Place name instead of lat, lon and tz, for example Gorakhpur, Uttar Pradesh. If the name is not unique: ambiguous_place with choices |
| place_id | integer | The id of a place from place search, instead of lat, lon and tz |
| ayanamsa | string | lahiri (default) | raman | krishnamurti |
Example
curl -X POST "https://api.bestastroapi.in/v1/sun-moon" \
-H "x-api-key: $BESTASTRO_KEY" \
-H "content-type: application/json" \
-d '{"date":"2026-11-22","lat":28.6139,"lon":77.209,"tz":"Asia/Kolkata"}'Response
[]is a list.{key}is a key that varies.- An optional field can be missing. That means it does not apply.
- Fields marked “or null” are always there but can be empty.
- Times carry the UTC offset of the place. A time after midnight has the next date.
| Field | Type | Meaning |
|---|---|---|
| date | stringYYYY-MM-DD | Date you sent |
| place | object | Place you sent |
| place.lat | numberdegrees | Latitude |
| place.lon | numberdegrees | Longitude |
| place.tz | string | Zone |
| place.id | integer | Id of the place we looked up. Only when you sent place or place_id, like the next two optional |
| place.name | string | Its name optional |
| place.label | string | Its name with district or state and country optional |
| sun | object | The Sun |
| sun.sunrise | string or nullISO 8601 | Sunrise (upper limb, with refraction) |
| sun.sunset | string or nullISO 8601 | Sunset |
| sun.solar_noon | stringISO 8601 | Local apparent noon: the Sun is highest |
| sun.day_length_hours | number or nullhours | Sunrise to sunset |
| sun.polar | string or null | Why there is no sunrise or sunset. Null on ordinary daysmidnight_sun | polar_night |
| sun.twilight | object | Dawn and dusk when the Sun's centre is 6, 12 and 18 degrees below the horizon |
| sun.twilight.civil | object | 6 degrees |
| sun.twilight.civil.dawn | string or nullISO 8601 | Morning |
| sun.twilight.civil.dusk | string or nullISO 8601 | Evening |
| sun.twilight.nautical | object | 12 degrees: dawn and dusk, as above |
| sun.twilight.nautical.dawn | string or nullISO 8601 | Morning |
| sun.twilight.nautical.dusk | string or nullISO 8601 | Evening |
| sun.twilight.astronomical | object | 18 degrees: dawn and dusk, as above |
| sun.twilight.astronomical.dawn | string or nullISO 8601 | Morning |
| sun.twilight.astronomical.dusk | string or nullISO 8601 | Evening |
| sun.sidereal_longitude | numberdegrees | Sidereal longitude at solar noon |
| sun.sign | Sign | Sidereal sign |
| moon | object | The Moon |
| moon.moonrise | string or nullISO 8601 | Moonrise on this date |
| moon.moonset | string or nullISO 8601 | Moonset on this date |
| moon.computed_at | stringISO 8601 | Moment of the phase values |
| moon.phase | string | A principal phase when it happens on this date, else the phase betweennew_moon | first_quarter | full_moon | last_quarter | waxing_crescent | waxing_gibbous | waning_gibbous | waning_crescent |
| moon.illumination | number | Lit share of the disc, 0 to 1 |
| moon.elongation | numberdegrees | Moon minus Sun in longitude, 0 to 360: 0 new, 180 full |
| moon.phase_angle | numberdegrees | Sun-Moon-Earth angle |
| moon.waxing | boolean | Growing towards full |
| moon.age_days | numberdays | Time since the last new moon |
| moon.distance_km | numberkm | Distance from the Earth's centre |
| moon.sidereal_longitude | numberdegrees | Sidereal longitude |
| moon.sign | Sign | Sidereal sign |
| moon.nakshatra | Nakshatra | Nakshatra |
| moon.next | object | Next principal phases after the start of the date |
| moon.next.new_moon | stringISO 8601 | New moon |
| moon.next.first_quarter | stringISO 8601 | First quarter |
| moon.next.full_moon | stringISO 8601 | Full moon |
| moon.next.last_quarter | stringISO 8601 | Last quarter |
Objects used above
Sign A zodiac sign (rashi).
| Field | Type | Meaning |
|---|---|---|
| number | integer | 1 = Aries to 12 = Pisces |
| name | string | English name |
| rashi | string | Sanskrit name, for example Mesha |
| lord | string | Planet that rules the sign |
Nakshatra A lunar mansion.
| Field | Type | Meaning |
|---|---|---|
| number | integer | 1 = Ashwini to 27 = Revati |
| name | string | Nakshatra name |
| pada | integer | Quarter, 1 to 4 |
| lord | string | Vimshottari lord |
Raw sample
200 application/json
{
"date": "2026-11-22",
"moon": {
"age_days": 12.9827,
"computed_at": "2026-11-22T12:07:13+05:30",
"distance_km": 370237,
"elongation": 147.928,
"illumination": 0.9228,
"moonrise": "2026-11-22T15:25:18+05:30",
"moonset": "2026-11-22T04:05:00+05:30",
"nakshatra": {
"lord": "Ketu",
"name": "Ashwini",
"number": 1,
"pada": 2
},
"next": {
"first_quarter": "2026-12-17T11:12:40+05:30",
"full_moon": "2026-11-24T20:23:34+05:30",
"last_quarter": "2026-12-01T11:38:40+05:30",
"new_moon": "2026-12-09T06:21:51+05:30"
},
"phase": "waxing_gibbous",
"phase_angle": 32.2724,
"sidereal_longitude": 3.66072,
"sign": {
"lord": "Mars",
"name": "Aries",
"number": 1,
"rashi": "Mesha"
},
"waxing": true
},
"place": {
"lat": 28.6139,
"lon": 77.209,
"tz": "Asia/Kolkata"
},
"sun": {
"day_length_hours": 10.6079,
"polar": null,
"sidereal_longitude": 215.732702,
"sign": {
"lord": "Mars",
"name": "Scorpio",
"number": 8,
"rashi": "Vrishchika"
},
"solar_noon": "2026-11-22T12:07:13+05:30",
"sunrise": "2026-11-22T06:48:52+05:30",
"sunset": "2026-11-22T17:25:21+05:30",
"twilight": {
"astronomical": {
"dawn": "2026-11-22T05:26:45+05:30",
"dusk": "2026-11-22T18:47:28+05:30"
},
"civil": {
"dawn": "2026-11-22T06:23:51+05:30",
"dusk": "2026-11-22T17:50:22+05:30"
},
"nautical": {
"dawn": "2026-11-22T05:55:05+05:30",
"dusk": "2026-11-22T18:19:08+05:30"
}
}
}
}Real output for the example request above.
Errors use one format. See error codes. Also in openapi.json.