API Reference / Vedic Astrology / Muhurta
/v1/muhurta/best-time
Scan a date range for the highest-scoring muhurta windows for vivah, graha pravesh, naamkaran, vyapar, yatra, vahan or bhoomi pujan; moments under a classical prohibition are never returned.
What this tells you
Scans a date range in 1-hour steps and scores every slot that starts between sunrise and sunset, using the same scoring as the single-check endpoint of the purpose: /v1/muhurta/vivah, /v1/muhurta/graha-pravesh, /v1/muhurta/naamkaran, /v1/muhurta/vyapar, /v1/muhurta/yatra, /v1/muhurta/vahan or /v1/muhurta/bhoomi-pujan. It returns the highest-scoring slots and leaves out every moment under a classical prohibition. Use it for wedding-date pickers and similar tools.
Request
All requests require an Authorization header with your dv_live_* API key.
curl "https://api.lifeastroapi.com/v1/muhurta/best-time?start_date=2027-01-01&end_date=2027-01-31&tz=Asia%2FKolkata&lat=28.6139&lon=77.209&purpose=vivah" \
-H "Authorization: Bearer YOUR_API_KEY"Query parameters
Checked against the API: a parameter is marked required when the request fails without it.
| Name | Required | Example | Description |
|---|---|---|---|
start_date | yes | 2027-01-01 | First date of the range (YYYY-MM-DD). |
end_date | yes | 2027-01-31 | Max 31 days from start_date. |
tz | yes | Asia/Kolkata | Timezone: IANA name (Asia/Kolkata) or UTC offset (+05:30). |
lat | yes | 28.6139 | Latitude in decimal degrees. |
lon | yes | 77.209 | Longitude in decimal degrees. |
purpose | no | vivah | Event the windows are scored for: vivah, graha_pravesh, naamkaran, vyapar, yatra, vahan, bhoomi_pujan or general (the default). Each purpose uses the scorer of its own /v1/muhurta validator; general uses a general auspiciousness scorer. |
direction | no | — | Direction of travel, used only with purpose=yatra (Disha Shool). Optional; full names such as north or south-east are also accepted. |
top_n | no | — | |
birth_date | no | — | Optional birth date (YYYY-MM-DD), used only with purpose=naamkaran for the day counted from birth. |
ayanamsa | no | — | Ayanamsa (sidereal offset) to use. Defaults to lahiri. |
lang | no | — | Language of names, labels and readings in the response: `en` (default), `hi`, `mr`, `gu`, `bn`, `te`, `ta`, `kn`, `ml`, `pa`. `locale` is accepted as an alias. |
Response (200 OK)
The real response to the example request above, generated from the API itself. Long arrays are trimmed to their first two items. Field names are stable across versions.
{
"purpose": "vivah",
"start_date": "2027-01-01",
"end_date": "2027-01-31",
"lat": 28.6139,
"lon": 77.209,
"ayanamsa": "lahiri",
"windows": [
{
"start_jd": 2461425.708333,
"end_jd": 2461425.75,
"start_iso": "2027-01-20T05:00:00Z",
"end_iso": "2027-01-20T06:00:00Z",
"score": 100,
"grade": "excellent",
"is_acceptable": true,
"factors": [
{
"name": "Tithi",
"value": "Trayodashi",
"weight": 12,
"score": 12,
"ok": true
},
{
"name": "Vara",
"value": "Wednesday",
"weight": 10,
"score": 10,
"ok": true
}
],
"warnings": null
},
{
"start_jd": 2461420.625,
"end_jd": 2461420.666667,
"start_iso": "2027-01-15T03:00:00Z",
"end_iso": "2027-01-15T04:00:00Z",
"score": 100,
"grade": "excellent",
"is_acceptable": true,
"factors": [
{
"name": "Tithi",
"value": "Saptami",
"weight": 12,
"score": 12,
"ok": true
},
{
"name": "Vara",
"value": "Friday",
"weight": 10,
"score": 10,
"ok": true
}
],
"warnings": null
}
],
"source": "Muhurta Chintamani, Vivaha-prakarana v. 13 (solar months) and v. 55 (nakshatras, tithis, weekdays), cross-checked with B.V. Raman, Muhurtha pp. 27, 29, 101-102; Hari Shayana as in Samskara-prakarana v. 24, with v. 26 and Raman p. 101; Bhadra, Vyatipata, Vaidhriti and adhika ma…"
}Field reference
Every field in the response, with its type, a real example, and what it means.
| Field | Type | Meaning |
|---|---|---|
| purpose | string | Scoring used: vivah, graha_pravesh, naamkaran, vyapar, yatra, vahan, bhoomi_pujan or general (the default). Each purpose uses the scorer of its own /v1/muhurta validator; general uses the vivah scoring. example: "vivah" |
| start_date, end_date | string | Range that was scanned, echoed from the request. The scan runs from start_date 00:00 UTC up to end_date 00:00 UTC, so end_date itself is not scanned. example: "2027-01-01", "2027-01-31" |
| lat, lon | number | Location, used for sunrise, sunset and the time windows. example: 28.6139, 77.209 |
| ayanamsa | string | Ayanamsa used. example: "lahiri" |
| windows[] | array | Best slots, highest score first. Up to top_n items (default 5, max 20). A moment under a classical prohibition of the purpose (its `prohibited_by` is not empty) is never returned, so fewer than top_n windows, or none, can come back for a range where the prohibition lasts (for example vivah while Venus is set). example: […] |
| windows[].start_jd, windows[].end_jd | number | Slot bounds as Julian Days (UT). Every slot is 1 hour long. example: 2461425.916667, 2461425.958333 |
| windows[].start_iso, windows[].end_iso | string | Slot bounds in UTC (RFC3339, "Z" suffix). Convert to local time for display. example: "2027-01-20T10:00:00Z", "2027-01-20T11:00:00Z" |
| windows[].score | integer (0–100) | Score of the slot, taken at its start. example: 93 |
| windows[].grade | string | excellent (90+), good (80–89), acceptable (60–79), inauspicious (below 60). example: "excellent" |
| windows[].is_acceptable | boolean | True when score is 60 or more. example: true |
| windows[].factors[] | array | Factor breakdown, same shape and factors as the matching single-check endpoint (for example /v1/muhurta/vivah, /v1/muhurta/vahan or /v1/muhurta/bhoomi-pujan). example: { "name": "Vara", "value": "Friday", "weight": 10, "score": 10, "ok": true } |
| windows[].warnings | string[] | null | Problems found for the slot. null when there are none. example: null |
Usage tips
How to use it
- Purpose dropdownMake purpose a required UI input: vivah, graha_pravesh, naamkaran, vyapar, yatra, vahan or bhoomi_pujan (with underscores). Each uses different factors and weights. For yatra, also ask for the direction of travel.
- Show top 3–5The default top_n=5 fits a card list. Raise it (up to 20) if you want to filter further on your side.
- Group by dayNeighbouring hours on the same day often score the same. Group slots by local date before display.
Errors
Every error follows the same envelope. Use the error.code field (not the message) for conditional logic in your integration.
401 Unauthorized
{
"error": {
"code": "unauthorized",
"message": "unknown or revoked API key",
"request_id": "52a520f261d3db37"
}
}402 Payment Required
{
"error": {
"code": "daily_cap_exceeded",
"message": "free-plan daily limit reached — try again tomorrow or upgrade to a paid plan",
"request_id": "52a520f261d3db37"
}
}429 Too Many Requests
{
"error": {
"code": "rate_limited",
"message": "rate limit exceeded — retry after 12 seconds",
"request_id": "52a520f261d3db37"
}
}Try it
Get a dv_live_* key from your dashboard and paste into the cURL snippet above. New accounts get 7,500 welcome credits plus 1,500 free credits a month. Sign up.