Daily Horoscope API with Gin
Integrate Daily Horoscope API in Gin. Complete code examples and SDK documentation.
Operation
POST /v2/daily/daily-horoscope
Get today's horoscope for the Moon sign of the chart in the request.
Send datetime, latitude and longitude together, or send an empty object: with no birth fields the current moment in New Delhi is used.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
datetime | body | string | Date and time as ISO 8601, for example 1990-05-15T10:30:00+05:30. You can send date and time as two fields instead. |
latitude | body | number | Latitude in decimal degrees, from -90 to 90. |
longitude | body | number | Longitude in decimal degrees, from -180 to 180. |
timezone | body | string | Time zone name such as Asia/Kolkata, or an offset such as +05:30. Worked out from the coordinates when left out and the datetime has no offset. |
date | body | string | Birth date as YYYY-MM-DD. Used with time when datetime is not sent. |
time | body | string | Birth time as HH:MM. Used with date when datetime is not sent. |
Request example for Gin
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.
package main
import (
"io"
"net/http"
"os"
"strings"
)
const payload = `{
"datetime": "1990-05-15T10:30:00+05:30",
"latitude": 28.6139,
"longitude": 77.209,
"timezone": "Asia/Kolkata"
}`
func callVedika() ([]byte, int, error) {
req, err := http.NewRequest("POST", "https://api.vedika.io/v2/daily/daily-horoscope", strings.NewReader(payload))
if err != nil {
return nil, 0, err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("VEDIKA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
return nil, 0, err
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
return data, res.StatusCode, err
}
// r := gin.Default()
func vedika(c *gin.Context) {
data, status, err := callVedika()
if err != nil {
c.Status(http.StatusBadGateway)
return
}
c.Data(status, "application/json", data)
}
// r.GET("/vedika/daily-horoscope", vedika)
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/daily/daily-horoscope \
-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/daily/daily-horoscope, 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": {
"compatibleSign": "Virgo",
"dateJd": 2461367.148611111,
"luckyColor": "Silver",
"luckyNumber": 17,
"luckyTime": "14:00-16:00",
"moonPhase": "Waxing Gibbous",
"moonPhaseEffect": "Energizing — initiative rewarded",
"rating": 5,
"sign": "Sagittarius",
"theme": "health"
},
"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