Gemstone (ratna) recommendation
curl -X POST https://api.astroway.info/v1/vedic/gemstones \ -H "X-Api-Key: aw_live_..." \ -H "Content-Type: application/json" \ -d '{ "date": "1990-05-15", "time": "15:30:00", "timezone": "Europe/Kyiv", "latitude": 50.45, "longitude": 30.52, "school": "lagna-lord" }'const res = await fetch('https://api.astroway.info/v1/vedic/gemstones', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "date": "1990-05-15", "time": "15:30:00", "timezone": "Europe/Kyiv", "latitude": 50.45, "longitude": 30.52, "school": "lagna-lord" }),});const { ok, data, error } = await res.json();if (!ok) throw new Error(error.message);console.log(data);import os, requests
r = requests.post( 'https://api.astroway.info/v1/vedic/gemstones', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'}, json={ 'date': "1990-05-15", 'time': "15:30:00", 'timezone': "Europe/Kyiv", 'latitude': 50.45, 'longitude': 30.52, 'school': "lagna-lord" },)result = r.json()if not result['ok']: raise RuntimeError(result['error']['message'])print(result['data'])<?phpuse GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.astroway.info/v1/']);$r = $client->post('vedic/gemstones', [ 'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')], 'json' => [ 'date' => '1990-05-15', 'time' => '15:30:00', 'timezone' => 'Europe/Kyiv', 'latitude' => 50.45, 'longitude' => 30.52, 'school' => 'lagna-lord', ],]);$result = json_decode($r->getBody(), true);if (!$result['ok']) throw new \RuntimeException($result['error']['message']);print_r($result['data']);Which of the nine gems to wear, from the sidereal lagna. Two schools are implemented: lagna-lord (default) prescribes the gems of the 1st, 9th and 5th lords as the life, lucky and benefic stones; functional-benefic classifies every graha by the houses it owns from the lagna, prescribes only for functional benefics led by the yogakaraka, and names the functional malefics as gems to avoid. Both reach the same three gems, because a functional benefic is a graha owning a trikona and the trikona lords are the 1st, 5th and 9th: the school changes the ordering, the role each gem carries, and the avoid list. The response always reports which one produced it. Coordinates are required, since the whole answer is derived from the lagna. Each gem carries its substitutes, day, finger, metal, weight range in ratti/grams/carats, and beeja mantra. Planet dignity is returned as context and does not change the list.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Comma-separated dotted paths, relative to data, to keep in the response. A path is applied to every element of an array, so planets.name means the name of each planet. Paths that match nothing come back in _fields_unmatched; a list where nothing matches at all is a 400, because an empty object would be a confident wrong answer.
Example
planets.name,planets.longitudeRound every non-integer number in the response to this many decimal places. Integers are left alone, because an id is not a measurement. Ecliptic longitudes ship with fourteen decimals by default; 2 is about a tenth of an arcminute.
Example
4Request Body required
Section titled “Request Body required ”Birth data for a gemstone recommendation. Required: date (YYYY-MM-DD), time (HH:mm:ss), latitude and longitude. Coordinates do NOT default to 0 here as they do on other chart endpoints: the whole answer is derived from the lagna, so an omitted pair is a 400 rather than a confident set of gems for 0N 0E.
object
Hours from UTC at the given moment, not minutes. Fractional zones are hours too: 5.5 for India, 5.75 for Nepal, -3.5 for Newfoundland. Defaults to 0, meaning UTC. Ignored when timezone is sent.
IANA zone name such as Europe/Kyiv, or auto to look the zone up from latitude and longitude. The server takes the offset that zone kept at this local date and time, summer time included, and uses it in place of timezoneOffset. A clock time that happened twice takes the first occurrence; one skipped when clocks went forward takes the offset from before the change. Abbreviations such as EST are refused. Before 1970 the tz database is not reliable for every place, so send timezoneOffset when the local clock is known.
Sidereal school by name. Lahiri when omitted. Equivalent to ayanamsaId; send either.
Birth latitude. Required: the lagna is what both schools prescribe from.
Birth longitude. Required: the lagna is what both schools prescribe from.
Prescription school. Both reach the same three gems (the trikona lords), and differ on what they withhold and on the ordering. The response always names the one used. Default: lagna-lord.
Example
{ "date": "1990-05-15", "time": "15:30:00", "timezone": "Europe/Kyiv", "latitude": 50.45, "longitude": 30.52, "school": "lagna-lord"}Responses
Section titled “ Responses ”Successful calculation
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example
{ "ok": true, "data": { "type": "gemstone-recommendation", "school": "lagna-lord", "schoolNote": "Prescribes the gems of the 1st, 9th and 5th lords as the life, lucky and benefic stones. Strengthening the lagna lord is safe for the native by definition, which is the argument for the school. It withholds a gem only when its graha owns nothing but dusthanas, so the avoid list is usually empty. Same three gems as functional-benefic, ordered by role rather than by strength of the yoga.", "ayanamsa": 23.7225, "lagna": { "sign": 4, "signName": "Leo", "longitude": 146.2454, "lord": 0, "lordName": "Sun" }, "recommended": [ { "role": "life stone (jeevan ratna)", "graha": 0, "housesOwned": [ 1 ], "basis": "lord of the 1st house (Leo)", "grahaName": "Sun", "grahaSanskrit": "Surya", "gem": "Ruby", "gemSanskrit": "Manikya", "mineral": "Corundum (red)", "substitutes": [ "Red spinel" ], "wearing": { "day": "Sunday", "finger": "Ring finger", "fingerVariants": [ "Ring finger" ], "metals": [ "Gold" ], "minWeight": { "ratti": [ 3 ], "grams": [ 0.364 ], "carats": [ 1.82 ] }, "mantra": "Om Hraam Hreem Hraum Sah Suryaya Namah", "japaCount": 6000 } } ], "avoid": [ { "role": "withheld", "graha": 1, "housesOwned": [ 12 ], "basis": "owns only 12th (dusthana)", "grahaName": "Moon", "grahaSanskrit": "Chandra", "gem": "Pearl", "gemSanskrit": "Moti", "mineral": "Natural nacre (Pinctada)", "substitutes": [ "Moonstone" ], "wearing": { "day": "Monday", "finger": "Little finger", "fingerVariants": [ "Little finger" ], "metals": [ "Silver" ], "minWeight": { "ratti": [ 4 ], "grams": [ 0.486 ], "carats": [ 2.43 ] }, "mantra": "Om Shraam Shreem Shraum Sah Chandraya Namah", "japaCount": 11000 } } ], "cautions": [ { "role": "maraka caution", "graha": 2, "housesOwned": [ 2 ], "basis": "owns the 2nd (maraka)", "grahaName": "Mercury", "grahaSanskrit": "Budha", "gem": "Emerald", "gemSanskrit": "Panna", "mineral": "Beryl (green)", "substitutes": [ "Peridot" ], "wearing": { "day": "Wednesday", "finger": "Little finger", "fingerVariants": [ "Little finger" ], "metals": [ "Gold" ], "minWeight": { "ratti": [ 3 ], "grams": [ 0.364 ], "carats": [ 1.82 ] }, "mantra": "Om Braam Breem Braum Sah Budhaya Namah", "japaCount": 9000 } } ], "nodesNote": "Rahu and Ketu own no sign, so neither school reaches hessonite or cat's eye from the lagna. They are prescribed on a specific reason (a running dasha, a conjunction, an affliction), which is a separate judgement from the one this endpoint makes.", "condition": { "Sun": { "sign": 1, "signName": "Taurus", "degreeInSign": 0.6502119223189666, "house": 10, "dignity": "neutral", "isRetrograde": false, "isCombust": false }, "Moon": { "sign": 9, "signName": "Capricorn", "degreeInSign": 3.1788798971629717, "house": 6, "dignity": "neutral", "isRetrograde": false, "isCombust": false }, "Mercury": { "sign": 0, "signName": "Aries", "degreeInSign": 14.28917860756014, "house": 9, "dignity": "neutral", "isRetrograde": true, "isCombust": false }, "Venus": { "sign": 11, "signName": "Pisces", "degreeInSign": 19.06874274676204, "house": 8, "dignity": "exalted", "isRetrograde": false, "isCombust": false }, "Mars": { "sign": 10, "signName": "Aquarius", "degreeInSign": 24.592569875940683, "house": 7, "dignity": "neutral", "isRetrograde": false, "isCombust": false }, "Jupiter": { "sign": 2, "signName": "Gemini", "degreeInSign": 15.811997278981366, "house": 11, "dignity": "neutral", "isRetrograde": false, "isCombust": false }, "Saturn": { "sign": 9, "signName": "Capricorn", "degreeInSign": 1.523954056640207, "house": 6, "dignity": "own sign", "isRetrograde": true, "isCombust": false } }, "conditionNote": "Context only. Both schools prescribe by house ownership, not by strength, so dignity and combustion do not change the list above.", "disclaimer": "Traditional Jyotish remedy, informational only. Gem identity, treatment and weight must be confirmed by a qualified gemmologist or jeweller before purchase, and no gemstone is a substitute for medical care: consult a licensed physician for any health concern." }}Validation error
Example
{ "ok": false, "error": { "code": "INVALID_INPUT", "message": "Validation failed: date: Date must be YYYY-MM-DD", "details": [ { "path": "date", "message": "Date must be YYYY-MM-DD" } ] }}Missing or invalid API key
Example
{ "ok": false, "error": { "code": "INVALID_API_KEY", "message": "Invalid API key" }}