Migrate from DivineAPI
A field-by-field guide to moving a DivineAPI integration to AstroAsk — auth, request format, endpoint mapping, response fields, and the honest differences. Most integrations take 1–3 days.
DivineAPI and AstroAsk both compute Vedic and Western astrology from Swiss Ephemeris, so the numbers line up closely. What changes is the shape: DivineAPI sends form-data with the date split into six fields and returns numbers as strings; AstroAsk takes one JSON body and returns typed, recomputable values. This page maps one to the other so you can migrate without re-deriving anything.
Prefer to let an AI do the migration? Copy the migration prompt at the bottom of this page into ChatGPT, Claude, Cursor, or Claude Code along with your DivineAPI code — it carries every mapping on this page.
Before you start
| DivineAPI | AstroAsk | |
|---|---|---|
| Base URL | https://astroapi-1.divineapi.com … astroapi-8 (per-endpoint host) | https://api.astroask.app/v1 (one host) |
| Auth | Bearer token and api_key in the form body | Authorization: Bearer ak_… or X-API-Key: ak_… header only |
| Request body | multipart/form-data | application/json |
| Success flag | "success": 1 (number) | "success": true (boolean) |
| Error shape | varies | always { "success": false, "error": "CODE", "message": "…" } |
| Pricing unit | credits vary by endpoint category | one request = one unit, every endpoint |
| Trial | — | 5,000 requests / 14 days, no card — get a key |
Request format
This is the biggest single change. Every DivineAPI birth-data endpoint takes the same 14 form fields; AstroAsk collapses them into one JSON object.
| DivineAPI form field | AstroAsk JSON field | Notes |
|---|---|---|
day, month, year, hour, min, sec | date | One ISO-8601 local timestamp: "2023-05-24T14:40:43". Local time at the birth place — do not convert to UTC. |
lat | lat | Number, e.g. 28.7041 |
lon | lng | Renamed lon → lng. Number. |
tzone | timezone | DivineAPI: numeric UTC offset (5.5). AstroAsk: IANA name ("Asia/Kolkata") — this is what makes DST correct. Omit it and AstroAsk resolves the zone from lat/lng. |
api_key | — | Move to the Authorization header. Never in the body. |
full_name, gender, place | — | Not needed for calculation. Keep them in your own database. |
lan | lang | Same idea, 21 languages: hi, ta, te, bn, es, fr, de, ja, … — see Languages. |
curl -X POST https://astroapi-1.divineapi.com/indian-api/v2/planetary-positions \
-H "Authorization: Bearer $TOKEN" \
-F api_key=$TOKEN \
-F full_name="Rahul" -F gender=male -F place="New Delhi" \
-F day=24 -F month=5 -F year=2023 \
-F hour=14 -F min=40 -F sec=43 \
-F lat=28.7041 -F lon=77.1025 -F tzone=5.5 -F lan=enTwo-person endpoints (matching): DivineAPI prefixes every field p1_ / p2_. AstroAsk nests them: { "person1": { date, lat, lng, timezone }, "person2": { … } }.
Endpoint mapping
The DivineAPI endpoints most integrations actually call, and their AstroAsk equivalents. Where AstroAsk returns more, it's noted — that extra data is the point of migrating.
| DivineAPI | AstroAsk | AstroAsk adds |
|---|---|---|
POST /indian-api/v2/planetary-positions | POST /v1/planets | subSubLord (KP), isVargottama, navamsaSign, dignity, structured avastha (baladi + jagradadi + strength), houseClassifications, eclipticLatitude |
POST /indian-api/v3/basic-astro-details | POST /v1/ascendant + /v1/moon-sign + /v1/sun-sign + /v1/nakshatra — or all four in one call via /v1/batch | Each piece is one request; batch keeps it one HTTP round-trip |
POST /indian-api/v1/horoscope-chart/D1 | POST /v1/chart/north-indian (SVG/PNG, themed) or POST /v1/kundali (JSON) | Light/dark themes, data table, glyph or text planets |
POST /indian-api/v1/vimshottari-dasha | POST /v1/dasha/vimshottari | Exact timestamps (not date-only), durationYears, current shortcut, per-lord lordStrength with Shadbala |
POST /indian-api/v2/find-panchang | GET /v1/panchanga (+ /tithi, /nakshatra, /yoga, /karana for exact spans) | muhurtaScore, inauspicious warnings[], 1-second-precision span boundaries |
POST /indian-api/v2/ashtakoot-milan | POST /v1/compatibility/ashtakoot | Recomputable per-koota scores + p1/p2 values, doshas[], isCompatible; no mail-merged prose |
POST /indian-api/v2/manglik-dosha | POST /v1/dosha/manglik | references[] showing the check from Lagna, Moon and Venus; cancellations[], isCancelled |
POST /indian-api/v1/kaal-sarpa-yoga | POST /v1/dosha/kaal-sarp | Named sub-type (Anant → Sheshnag), structured verdict |
POST /indian-api/v2/shadbala | POST /v1/shadbala (or /v1/shadbala/full) | All six balas with sub-component breakdowns, per-planet requiredRupas and isStrong |
POST /indian-api/v2/yogas | POST /v1/yogas | Per-yoga strength (weak → exceptional) and the conditions[] that triggered it |
POST /indian-api/v3/sadhe-sati | POST /v1/sade-sati | Rising / peak / setting phases with exact boundaries |
POST /indian-api/v2/kp/planetary-positions | POST /v1/planets (sub-lords included) | Sub-sub-lord depth |
Numerology /numerology-api/* | POST /v1/numerology/life-path, /core-numbers, /destiny, /soul-urge, /personality, /personal-year, /business-name | Both Pythagorean and Chaldean systems, master numbers preserved |
Western /western-api/* | POST /v1/western/natal, /aspects, /transits, /synastry, /progressions, /solar-return, /composite, /davison, /arabic-lots, /midpoints | Applying/separating aspects, Davison charts, Ebertin midpoints |
Full reference for every endpoint: API Reference.
Response field mapping — planetary positions
Same birth data, both APIs. This is the endpoint most integrations depend on, mapped field by field.
DivineAPI data.planets[] | AstroAsk data.planets[] | Type change |
|---|---|---|
name | planet | — |
full_degree "38.7863050" | longitude 38.78358892344299 | string → number, full double precision |
longitude "8:47:10" (DMS string) | degreeInSign 8.783588923442991 | DMS string → decimal degrees in sign |
sign "Taurus" | signName | — |
sign_no 2 (1-based) | sign 1 (0-based, Aries = 0) | Off by one — the most common migration bug |
speed "0.9614368" | speed 0.961436219030731 | string → number |
is_retro "false" | isRetrograde false | string "false" → boolean. In JS, "false" is truthy — this is a real bug in many DivineAPI integrations |
is_combusted "false" | isCombust false | string → boolean |
nakshatra | nakshatra | Spellings differ — see the nakshatra table below. Never compare names across the two APIs with ===; compare nakshatraPada/degree, or normalize first |
nakshatra_pada | nakshatraPada | — |
nakshatra_lord | nakshatraLord | — |
sub_lord | subLord | — |
| — | subSubLord | new — KP sub-sub-lord |
awastha "Vriddha" | avastha.baladi "Kumara" + avastha.jagradadi + avastha.strengthModifier | one word → structured object with both classical systems |
house | house | — |
| — | houseClassifications[] | new — Kendra / Trikona / Upachaya / Dusthana |
| — | dignity | new — Exalted / Own / Friendly / Enemy / Debilitated |
| — | isVargottama, navamsaSign, navamsaSignName | new — D-9 placement inline |
| — | eclipticLatitude | new |
rashi_lord | — | Not on the planet object. Derive from signName via a 12-entry lookup, or use /v1/houses/vedic which returns each house's lord |
lord_of "Twelfth House" | — | Use /v1/houses/vedic — returns lordship per house as data, not prose |
type "malefic" | — | Natural benefic/malefic is a fixed 9-entry table (Jupiter, Venus, Mercury, waxing Moon benefic); AstroAsk doesn't repeat it per response |
karakamsha | — | Jaimini karakas are not yet in AstroAsk — see Known gaps |
image (planet PNG URL) | — | AstroAsk ships glyphs inside chart SVGs, not per-planet image URLs |
Nakshatra name spellings
DivineAPI transliterates nakshatra names inconsistently — sometimes two ways within the same API (Shravan / Shravana, Dhanishtha / Dhanishta, Purva Bhadrapada / Poorva Bhadrapada, Shatabhisha / Satabhisha). AstroAsk returns one spelling per nakshatra. Most match DivineAPI's common form; the ones that differ are below. If your code matches on nakshatra names, normalize through this table — or match on nakshatraPada + degree instead, which is unambiguous.
| DivineAPI (as observed) | AstroAsk |
|---|---|
Aswini | Ashwini |
Moola | Mula |
Shravan, Shravana | Shravana |
Dhanishtha, Dhanishta | Dhanishta |
Satabhisha, Shatabhisha | Shatabhisha |
Purva Ashada | Purva Ashadha |
Uttara Ashada | Uttara Ashadha |
Poorva Bhadrapada, Purva Bhadrapada | Purva Bhadrapada |
Purva Phalguni, Uttara Phalguni, Uttara Bhadrapada, Bharani, Krittika, Rohini, Mrigashira, Ardra, Punarvasu, Pushya, Ashlesha, Magha, Hasta, Chitra, Swati, Vishakha, Anuradha, Jyeshtha, Revati | same |
Rule of thumb: AstroAsk keeps the space in two-word names (Purva Phalguni), uses sh not s (Ashwini, Shatabhisha), and -dha in Ashadha.
Response field mapping — Vimshottari dasha
Structural change, not just renaming: DivineAPI keys periods by planet name as object keys; AstroAsk returns an ordered array. Object keys don't guarantee order in JSON — the array does.
| DivineAPI | AstroAsk | Notes |
|---|---|---|
data.maha_dasha.<Planet> (object keyed by name) | data.periods[] with .planet | object → ordered array; iterate periods, don't look up by key |
.start_date "2023-08-23" | .start "2023-08-27T02:10:01.853Z" | date-only → exact UTC timestamp |
.end_date | .end | same |
.antar_dasha.<Planet> | .antardashas[] | same object → array change, nested |
.antar_dasha.<Planet>.start_time "--" for past periods | always a real timestamp | No "--" sentinels. DivineAPI blanks out already-elapsed sub-periods; AstroAsk returns them all. Drop any !== "--" guards |
| — | data.current { mahadasha, antardasha, start, end } | new — the running period as a shortcut; DivineAPI makes you compute it |
| — | .durationYears | new |
| — | .lordStrength { dignity, house, shadbalaRupas, isStrong, summary } | new — why this period will express strongly or weakly |
dasha_type form param | includeSubPeriods: true for pratyantardashas | — |
Response field mapping — Ashtakoot matching
This is where "structured vs prose" matters most. DivineAPI's description fields are pre-written paragraphs with the names mail-merged in ("Rahul Kumar shall be dedicated…"). AstroAsk returns the scores and classifications so you can render, threshold, sort, and localize yourself.
DivineAPI data.ashtakoot_milan.<koota> | AstroAsk data.koots[] | Notes |
|---|---|---|
varna, vashya, tara, yoni, … as object keys | array items with .name | object → array |
.points_obtained | .score | — |
.max_ponits (sic) | .maxScore | — |
.p1, .p2 | .p1, .p2 | same values, same meaning |
.area_of_life | .areaOfLife | — |
.description (mail-merged prose) | — | Not returned. Build your own sentence from score/p1/p2, or use /v1/compatibility/summary for a compact verdict |
| total (sum it yourself) | data.totalScore, data.rating | new — 36-point total + Excellent / Good / Average / Poor |
| — | data.doshas[] (Nadi, Bhakoot, Gana, Yoni) | new — surfaced separately so a decent total can't hide a hard incompatibility |
| — | data.isCompatible | new — the classical 18/36 boolean |
Response field mapping — Manglik dosha
| DivineAPI | AstroAsk | Notes |
|---|---|---|
manglik_dosha "No" / "Yes" | isManglik true/false | string → boolean |
strength | severity Mild / Strong / Very Strong | — |
percentage | percentage | — |
| — | references[] { reference: fromLagna | fromMoon | fromVenus, house, triggers } | new — the check is shown per reference point. See why verdicts can differ |
| — | cancellations[], isCancelled | new — classical cancellations applied and named |
remedies[], comment[] | — | AstroAsk sells math, not remedies — see Known gaps |
| — | description | one honest sentence, no name mail-merge |
Why numbers and verdicts differ
Migrating teams usually run both APIs in parallel and diff. Expect these, and know why:
- Longitudes differ in the third decimal (e.g.
38.7863vs38.7836). Both use Swiss Ephemeris; both default to Lahiri ayanamsa. The residual is ayanamsa-epoch rounding and DivineAPI's 7-decimal string truncation. Sign, nakshatra, pada, sub-lord and house agree. - Dasha boundaries differ by hours to a few days. DivineAPI returns dates; AstroAsk returns the exact instant computed from the Moon's precise nakshatra fraction at birth. When a boundary falls near midnight the date can differ while the underlying instant agrees.
- Manglik verdicts can differ. AstroAsk checks Mars from the Lagna, the Moon and Venus (all three classical references) and reports which one triggered. A chart that is Manglik only from the Moon or Venus can read
"No"on DivineAPI andisManglik: true, severity: Mildhere — withreferences[]showing exactly why. This is a methodology difference, not a bug; decide which rule your product wants and filter onreferencesif you need Lagna-only. - Rahu/Ketu: AstroAsk uses the Mean Node (classical Jyotish). If DivineAPI's figures for the nodes differ by up to ~1.5°, that's True vs Mean Node.
- 0-based signs.
sign: 0is Aries. DivineAPI'ssign_no: 1is Aries. Add 1 if your UI expects 1-based.
Known gaps
Things DivineAPI has that AstroAsk deliberately does not (yet):
- Prose predictions and remedies — daily/weekly horoscope paragraphs,
remedies[],comment[], gemstone / rudraksha suggestions, PDF reports. AstroAsk returns calculations and structured verdicts; readable text is your layer (or its 21-language interpretation keys). If you need generated readings, that's a different product. - Jaimini (chara dasha, karakamsha, padas), Lal Kitab, Varshphal/Tajika, KP cuspal significators, festival calendars, most single-purpose muhurat endpoints (marriage / vehicle / property). On the roadmap; not shipped.
- South-Indian / East-Indian chart styles — North-Indian and Western wheel only today.
- Per-planet image URLs,
type: benefic/malefic,rashi_lordon the planet object — trivially derivable client-side; see the planet-mapping table.
If one of these is a hard requirement for you, keep that DivineAPI call and migrate the rest — the two APIs coexist fine, and every AstroAsk endpoint costs exactly one request.
Migration checklist
- Get a key — sign up (5,000 requests free, no card).
- Replace the auth: header only, drop
api_keyfrom every body. - Write one
toAstroAsk(birth)helper:{ day, month, year, hour, min, sec, lat, lon, tzone }→{ date, lat, lng, timezone }. Do it once, reuse everywhere. - Swap
multipart/form-dataforapplication/json. - Re-point endpoints using the table above.
- Fix the response reads:
full_degree→longitude(parse no more),is_retro→isRetrograde(no more=== "true"),sign_no→sign(0-based),maha_dasha.<X>→periods[]. - Delete
"--"guards in dasha code. - Run both in parallel on 20–50 real charts; diff sign / nakshatra / house (should match) and log longitude deltas (should be < 0.01°).
- Ship. Typical elapsed time: 1–3 days.
AI migration prompt
For ChatGPT, Claude.ai, or any assistant without skill support. Paste it in full, then paste your DivineAPI integration code.
Copy this prompt
You are migrating a codebase from the DivineAPI astrology API to the AstroAsk astrology API. Apply these rules exactly and convert every DivineAPI call you find. Output complete converted files — do not truncate or summarize.
AUTH: DivineAPI sends a Bearer token AND `api_key` in the form body. AstroAsk uses ONLY a header: `Authorization: Bearer <key>` (or `X-API-Key: <key>`). Remove api_key from every request body.
BASE URL: DivineAPI uses https://astroapi-N.divineapi.com per endpoint. AstroAsk uses one base: https://api.astroask.app/v1
REQUEST FORMAT: DivineAPI = multipart/form-data. AstroAsk = application/json.
Map birth-data fields:
- day, month, year, hour, min, sec -> date: "YYYY-MM-DDTHH:MM:SS" (LOCAL time at the birth place; do NOT convert to UTC)
- lat -> lat (number)
- lon -> lng (number; note the rename)
- tzone (numeric offset like 5.5) -> timezone (IANA string like "Asia/Kolkata"). If you only have the offset, omit timezone; AstroAsk resolves it from lat/lng.
- full_name, gender, place -> not sent; keep them in the app's own state
- lan -> lang
Two-person endpoints: p1_*/p2_* prefixed fields -> { "person1": {date,lat,lng,timezone}, "person2": {...} }
ENDPOINT MAP (DivineAPI -> AstroAsk):
- /indian-api/v2/planetary-positions -> POST /v1/planets
- /indian-api/v3/basic-astro-details -> POST /v1/ascendant, /v1/moon-sign, /v1/sun-sign, /v1/nakshatra (or one POST /v1/batch)
- /indian-api/v1/horoscope-chart/D1 -> POST /v1/chart/north-indian (image) or POST /v1/kundali (JSON)
- /indian-api/v1/vimshottari-dasha -> POST /v1/dasha/vimshottari
- /indian-api/v2/find-panchang -> GET /v1/panchanga?date=&lat=&lng=
- /indian-api/v2/ashtakoot-milan -> POST /v1/compatibility/ashtakoot
- /indian-api/v2/manglik-dosha -> POST /v1/dosha/manglik
- /indian-api/v1/kaal-sarpa-yoga -> POST /v1/dosha/kaal-sarp
- /indian-api/v2/shadbala -> POST /v1/shadbala
- /indian-api/v2/yogas -> POST /v1/yogas
- /indian-api/v3/sadhe-sati -> POST /v1/sade-sati
- numerology endpoints -> POST /v1/numerology/life-path | core-numbers | destiny | soul-urge | personality | personal-year | business-name
- western endpoints -> POST /v1/western/natal | aspects | transits | synastry | progressions | solar-return | composite | davison | arabic-lots | midpoints
RESPONSE ENVELOPE: DivineAPI {"success":1,"data":...}. AstroAsk {"success":true,"data":...}; on error {"success":false,"error":"CODE","message":"..."}. Check the boolean.
RESPONSE FIELDS — planets (data.planets[]):
- name -> planet
- full_degree (STRING "38.7863050") -> longitude (NUMBER). Remove parseFloat.
- longitude (DMS string "8:47:10") -> degreeInSign (decimal number)
- sign (name) -> signName
- sign_no (1-based, Aries=1) -> sign (0-BASED, Aries=0). Add 1 if the UI expects 1-based.
- speed (string) -> speed (number)
- is_retro (STRING "false") -> isRetrograde (BOOLEAN). Remove any === "true" comparisons.
- is_combusted (string) -> isCombust (boolean)
- nakshatra -> nakshatra, BUT some spellings differ and DivineAPI is inconsistent with itself. Normalize DivineAPI->AstroAsk: Aswini->Ashwini, Moola->Mula, Shravan->Shravana, Dhanishtha->Dhanishta, Satabhisha->Shatabhisha, "Purva Ashada"->"Purva Ashadha", "Uttara Ashada"->"Uttara Ashadha", "Poorva Bhadrapada"->"Purva Bhadrapada". AstroAsk KEEPS the space in two-word names ("Purva Phalguni", "Uttara Bhadrapada"). Never compare nakshatra names across the two APIs with ===; compare nakshatraPada + degree, or normalize first.
- nakshatra_pada -> nakshatraPada; nakshatra_lord -> nakshatraLord; sub_lord -> subLord
- awastha (one word) -> avastha.baladi (+ avastha.jagradadi, avastha.strengthModifier)
- house -> house
- NEW on AstroAsk: subSubLord, isVargottama, navamsaSign, navamsaSignName, dignity, houseClassifications[], eclipticLatitude
- rashi_lord, lord_of, type(benefic/malefic), image: NOT on the planet object. Derive rashi_lord/type from a client-side lookup, get lordship from POST /v1/houses/vedic.
RESPONSE FIELDS — vimshottari dasha:
- data.maha_dasha.<PlanetName> (object keyed by planet) -> data.periods[] (ORDERED ARRAY, each has .planet). Iterate the array; do not look up by key.
- start_date/end_date (date-only) -> start/end (exact ISO timestamps)
- antar_dasha.<Planet> -> antardashas[] (array)
- "--" sentinel for past periods -> DOES NOT EXIST; every period has real timestamps. Delete any "--" guards.
- NEW: data.current {mahadasha, antardasha, start, end}, .durationYears, .lordStrength
RESPONSE FIELDS — ashtakoot:
- data.ashtakoot_milan.<koota> (object) -> data.koots[] (array with .name)
- points_obtained -> score; max_ponits -> maxScore; area_of_life -> areaOfLife; p1/p2 unchanged
- description (mail-merged prose) -> NOT returned; render your own from score/p1/p2 or call POST /v1/compatibility/summary
- NEW: data.totalScore, data.rating, data.doshas[], data.isCompatible
RESPONSE FIELDS — manglik:
- manglik_dosha "Yes"/"No" -> isManglik boolean; strength -> severity; percentage same
- NEW: references[] {reference: fromLagna|fromMoon|fromVenus, house, triggers}, cancellations[], isCancelled
- remedies[]/comment[] -> not returned
KNOWN DIFFERENCES (do not "fix" these): longitudes differ in the 3rd decimal (rounding); dasha boundaries are exact instants not dates; manglik is checked from Lagna, Moon AND Venus so a chart can be Manglik here and "No" on DivineAPI — that's a methodology difference, surfaced in references[]; Rahu/Ketu use Mean Node.
NOT AVAILABLE on AstroAsk: prose predictions/remedies, gemstone/rudraksha, PDF reports, Jaimini, Lal Kitab, Varshphal, KP cuspal significators, festival calendars, South-Indian chart style. If the code depends on one of these, keep that single DivineAPI call and migrate everything else; say so explicitly in your output.
AFTER CONVERTING: add a small script that calls both APIs for the same birth data and asserts sign, nakshatra, nakshatraPada and house match for every planet, and logs the longitude delta. Then list every file you changed.
Here is the code to migrate:Need help?
Migrating something not covered here — a DivineAPI endpoint with no row in the table, or a response field you can't place? Email intelligence@astroask.app with the endpoint name and we'll add the mapping to this page.