Migration & utility
Migration compare
POST/v1/migrate/compare
Replays your logged vendor requests in our compatible format and compares every field with the response that vendor gave you.
- Returns match rates per field and a recommendation.
- Each case counts as one call.
- The example vendor response is our own AstrologyAPI-format answer with one field edited.
Request
| Field | Type | Description |
|---|---|---|
| vendor | stringrequired | astrologyapi | vedicastroapi | prokerala |
| cases | arrayrequired | 1-1000 items: {endpoint, request, vendor_response} |
| tolerance | number | Absolute tolerance for numbers (default 0.01; angles modulo 360) |
| ignore | array | Field paths to skip, e.g. .remaining_api_calls |
Example
curl -X POST "https://api.bestastroapi.in/v1/migrate/compare" \
-H "x-api-key: $BESTASTRO_KEY" \
-H "content-type: application/json" \
-d '{"vendor":"astrologyapi","cases":[{"endpoint":"astro_details","request":{"day":18,"month":5,"year":2004,"hour":10,"min":30,"lat":28.6139,"lon":77.209,"tzone":5.5},"vendor_response":{"Charan":3,"Gan":"Manushya","Karan":"Chatushpada","Nadi":"Madhya","Naksahtra":"Krittika","NaksahtraLord":"Venus","SignLord":"Mars","Tithi":"Krishna Amavasya","Varna":"Kshatriya","Vashya":"Chatushpada","Yog":"Shobhana","Yoni":"Elephant","ascendant":"Cancer","name_alphabet":"Le","paya":"Copper","sign":"Aries","tatva":"Fire","yunja":"Poorva"}}]}'Response
[]is a list.{key}is a key that varies.- An optional field can be missing. That means it does not apply.
| Field | Type | Meaning |
|---|---|---|
| vendor | string | Vendor you sentastrologyapi | vedicastroapi | prokerala |
| cases | integer | Cases you sent |
| errors | object[] | Cases we could not answer. Empty when all worked |
| errors[].case | integer | Position of the case, from 0 optional |
| errors[].response | any | Our answer in the vendor's error format optional |
| fields_compared | integer | Values compared |
| fields_matched | integer | Values that match |
| fields_missing_in_ours | integer | Values the vendor has and we do not |
| match_rate | numberpercent | Matched share of all values |
| match_rate_excluding_missing | numberpercent | Matched share of the values we have |
| elapsed_ms | numbermilliseconds | Time the comparison took |
| recommendation | string | Suggested next step |
| fields | object[] | One row per field, worst match first |
| fields[].field | string | Path in the vendor's response |
| fields[].compared | integer | Values compared |
| fields[].matched | integer | Values that match |
| fields[].missing | integer | Values we do not have |
| fields[].match_rate | numberpercent | Match rate |
| fields[].examples | object[] | Up to 3 differences. Can be empty |
| fields[].examples[].path | string | Exact path |
| fields[].examples[].vendor | any | The vendor's value |
| fields[].examples[].ours | any | Our value |
Raw sample
200 application/json
{
"cases": 1,
"elapsed_ms": 0.29,
"errors": [],
"fields": [
{
"compared": 1,
"examples": [
{
"ours": "Bharani",
"path": ".Naksahtra",
"vendor": "Krittika"
}
],
"field": ".Naksahtra",
"match_rate": 0,
"matched": 0,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Charan",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Gan",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Karan",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Nadi",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".NaksahtraLord",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".SignLord",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Tithi",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Varna",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Vashya",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Yog",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".Yoni",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".ascendant",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".name_alphabet",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".paya",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".sign",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".tatva",
"match_rate": 100,
"matched": 1,
"missing": 0
},
{
"compared": 1,
"examples": [],
"field": ".yunja",
"match_rate": 100,
"matched": 1,
"missing": 0
}
],
"fields_compared": 18,
"fields_matched": 17,
"fields_missing_in_ours": 0,
"match_rate": 94.4,
"match_rate_excluding_missing": 94.4,
"place_calls_skipped": 0,
"recommendation": "review field differences before routing live traffic",
"vendor": "astrologyapi"
}Real output for the example request above.
Errors use one format. See error codes. Also in openapi.json.