Gemstone Recommendation API with Phoenix
Integrate Gemstone Recommendation API in Phoenix. Complete code examples and SDK documentation.
Operation
POST /v2/astrology/gemstone-recommendation
Gemstones and crystals listed for the Moon sign of a birth chart, with color, element and properties.
Send datetime (or date with time) together with latitude and longitude, or send an empty object: with no birth fields the current moment in New Delhi is used. Sending some birth fields without the rest returns 400.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
datetime | body | string | Birth date and time in ISO 8601, for example 1990-05-15T10:30:00+05:30. Send this, or date with time. |
date | body | string | Birth date as YYYY-MM-DD. Used when datetime is not sent. |
time | body | string | Birth time as HH:MM, used with date. Defaults to 12:00 when omitted. |
latitude | body | number | Latitude of the birth place in decimal degrees, -90 to 90. Alias lat. |
longitude | body | number | Longitude of the birth place in decimal degrees, -180 to 180. Aliases lon, lng, long. |
timezone | body | string | IANA zone name or UTC offset such as +05:30. Inferred from the coordinates when omitted. |
Request example for Phoenix
Authenticate with Authorization: Bearer YOUR_API_KEY. Keep the key in the VEDIKA_API_KEY environment variable on your server and never in source control.
# mix.exs deps: {:req, "~> 0.5"}
defmodule MyAppWeb.VedikaController do
use MyAppWeb, :controller
def show(conn, _params) do
resp =
Req.post!("https://api.vedika.io/v2/astrology/gemstone-recommendation",
auth: {:bearer, System.fetch_env!("VEDIKA_API_KEY")},
json: %{
"datetime" => "1990-05-15T10:30:00+05:30",
"latitude" => 28.6139,
"longitude" => 77.209,
"timezone" => "Asia/Kolkata"
}
)
conn |> put_status(resp.status) |> json(resp.body)
end
end
Try it in the keyless sandbox
The sandbox mirrors the production route and needs no API key:
curl -X POST https://api.vedika.io/sandbox/astrology/gemstone-recommendation \
-H "Content-Type: application/json" \
-d '{"datetime":"1990-05-15T10:30:00+05:30","latitude":28.6139,"longitude":77.209,"timezone":"Asia/Kolkata"}'
Sandbox response from POST /sandbox/astrology/gemstone-recommendation, abridged (billing block, long text fields and long lists trimmed). The sandbox answers with a fixed demo result and ignores your inputs; a production call computes the result for the details you send.
{
"data": {
"crystals": [
{
"chakras": [
"solarplexus",
"crown"
],
"color": "yellow",
"description": "Stone of Jupiter. Brings wisdom, prosperity, and divine grace.",
"element": "ether",
"hardness": 9,
"healingProperties": [
"wisdom",
"prosperity",
"spirituality"
],
"name": "Yellow Sapphire",
"planets": [
"jupiter"
],
"zodiacSigns": [
"sagittarius",
"pisces"
]
},
{
"chakras": [
"throat",
"thirdeye"
],
"color": "deep-blue",
"description": "Stone of truth and enlightenment",
"element": "water",
"hardness": 5.5,
"healingProperties": [
"wisdom",
"truth",
"communication"
],
"name": "Lapis Lazuli",
"planets": [
"jupiter",
"venus"
],
"zodiacSigns": [
"sagittarius",
"libra"
]
},
{
"chakras": [
"throat",
"thirdeye"
],
"color": "turquoise-blue",
"description": "Master healer and protective stone of travelers",
"element": "earth",
"hardness": 6,
"healingProperties": [
"protection",
"wisdom",
"communication"
],
"name": "Turquoise",
"planets": [
"jupiter",
"venus"
],
"zodiacSigns": [
"sagittarius",
"scorpio",
"pisces"
]
}
],
"system": "crystals"
},
"meta": {
"contentMode": "fixture",
"engine": "vedika-intelligence",
"fixtureId": "demo-birth-1995-new-delhi",
"inputUsage": "ignored",
"mode": "sandbox",
"sample": true,
"version": "2.1.0"
},
"success": true
}
Related
The same endpoint in other stacks:
Last updated: 22 November 2026