The VedAstro Go library gives you instant access to the world's most comprehensive Vedic astrology engine — planet positions, divisional charts, dasa periods, compatibility reports, and AI-powered features, all through a lightweight SDK.
Whether you're building a horoscope app, a matchmaking platform, or a research tool, VedAstro's Go library removes every barrier between you and professional-grade Vedic astrology calculations. No complicated setup. No local binaries. No astrology expertise required to get started. Just install the library, set your API key, and start computing — the heavy lifting runs on VedAstro's cloud engine.
Hosted calculations for Vedic astrology applications
Ayanamsa systems — Lahiri, Raman, KP, Fagan-Bradley & 43 more
Divisional charts — full Parashari varga system coverage
Horoscope predictions and classical-text search
Everything runs in the cloud — your app stays lightweight
MIT licensed, community maintained, fully auditable on GitHub
The VedAstro Go library is a thin, elegant wrapper around the VedAstro REST API. You write Go; the cloud does the calculation.
The library itself is tiny — everything runs server-side
Calculation improvements roll out on the server automatically
From personal projects to production apps, same code works
Go 1.26 or newer and an internet connection

go mod init example.com/my-vedastro-app
go get github.com/VedAstro/VedAstro.Go@v1.0.0Every calculator takes a context and returns (any, error). Check errors before reading the dynamic payload. Save the quick start as main.go and run go run .; other demos use internal/exampleutil and must run inside the cloned SDK repository.
FreeAPIUser allows 5 requests per minute. Pace multi-call examples or use your subscription key. Locations take longitude before latitude.
Get unlimited access for just $1/month — no rate limits, all features included
Instant activation • Cancel anytime • 99.9% uptime guarantee
Start with one Sun-sign calculation using the free key.
package main
import (
"context"
"fmt"
"log"
vedastro "github.com/VedAstro/VedAstro.Go"
)
func main() {
client := vedastro.NewClient("FreeAPIUser")
birth, err := vedastro.NewTime("14:30 25/10/1992 +05:30",
vedastro.NewGeoLocation("Mumbai", 72.8777, 19.0760))
if err != nil {
log.Fatal(err)
}
result, err := client.PlanetRasiD1Sign(context.Background(), vedastro.PlanetSun, birth)
if err != nil {
log.Fatal(err)
}
sign, ok := result.(map[string]any)
if !ok {
log.Fatal("unexpected Sun sign response")
}
fmt.Println("Sun sign:", sign["Name"])
}Save as main.go in the module created above and run go run .
Run from the cloned SDK repository; helper files are included there.
package main
import (
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Compatibility report", func() (any, error) { return r.Client.MatchReport(r.Context, r.Birth, r.Other) }); err != nil {
return err
}
return nil
})
}Run from the cloned SDK repository; helper files are included there.
package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
return r.Show("Vimshottari dasa", func() (any, error) {
return r.Client.DasaForLife(r.Context, r.Birth, vedastro.DasaForLifeOptions{
System: vedastro.Ptr(vedastro.DasaSystemVimshottariJanma),
Depth: vedastro.Ptr(3),
})
})
})
}Remove rate limits and get instant access to all 684 calculations
| Category | What's Included |
|---|---|
| Positions, longitudes, strengths, aspects, conjunctions, retrograde status | |
| House signs, lords, bhava chart, all house data | |
| D1 through D60 — Navamsha, Drekkana, and all varga charts | |
| Sign-based calculations, planet-in-sign queries | |
| Vimshottari dasa periods with explicit starting rules and configurable depth | |
| Auspicious time finding, event predictions over any date range | |
| Kuta scoring, full compatibility reports, BaZi integration, AI chat analysis | |
| Birth time auto-fill from partial data, natural language horoscope search |
Full method reference: vedastro.org/API.html
Switch ayanamsa systems with SDK-specific settings
Modern Vedic standard
Classical Vedic system
KP System
Western sidereal
package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
for _, name := range []vedastro.Ayanamsa{vedastro.AyanamsaLahiri, vedastro.AyanamsaRaman, vedastro.AyanamsaKrishnamurti} {
ctx := vedastro.WithAyanamsa(r.Context, name)
if err := r.Show(string(name), func() (any, error) { return r.Client.AyanamsaDegree(ctx, r.Birth) }); err != nil {
return err
}
}
return nil
})
}Run this example inside the cloned repository. View source.
Rate-limited
'FreeAPIUser'
No signup required — ideal for exploration and development
Unlimited access
High-speed access to all 684 calculations for production apps
client := vedastro.NewClient("your-key-here")
Clone the repository to run these examples with their included helpers. Expand an example to read and copy its source.
package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Planet data", func() (any, error) { return r.Client.AllPlanetData(r.Context, vedastro.PlanetSun, r.Birth) }); err != nil {
return err
}
if err := r.Show("House data", func() (any, error) { return r.Client.AllHouseData(r.Context, vedastro.House1, r.Birth) }); err != nil {
return err
}
if err := r.Show("Zodiac data", func() (any, error) { return r.Client.AllZodiacSignData(r.Context, vedastro.ZodiacGemini, r.Birth) }); err != nil {
return err
}
return nil
})
}package main
import (
"encoding/csv"
"encoding/json"
"fmt"
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
"os"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
rows := [][]string{{"planet", "result_json"}}
for _, planet := range []vedastro.PlanetName{vedastro.PlanetSun, vedastro.PlanetMoon, vedastro.PlanetMars,
vedastro.PlanetMercury, vedastro.PlanetJupiter, vedastro.PlanetVenus, vedastro.PlanetSaturn, vedastro.PlanetRahu, vedastro.PlanetKetu} {
value, err := r.Fetch(func() (any, error) { return r.Client.AllPlanetData(r.Context, planet, r.Birth) })
if err != nil {
return err
}
encoded, err := json.Marshal(value)
if err != nil {
return err
}
rows = append(rows, []string{string(planet), string(encoded)})
}
file, err := os.OpenFile("planet_data.csv", os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil {
return err
}
defer file.Close()
writer := csv.NewWriter(file)
if err := writer.WriteAll(rows); err != nil {
return err
}
fmt.Println("Saved planet_data.csv")
return nil
})
}package main
import (
"encoding/json"
"fmt"
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
"os"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
data := map[string]any{}
calls := []struct {
name string
call func() (any, error)
}{
{"planet", func() (any, error) { return r.Client.AllPlanetData(r.Context, vedastro.PlanetSun, r.Birth) }},
{"house", func() (any, error) { return r.Client.AllHouseData(r.Context, vedastro.House1, r.Birth) }},
{"zodiac", func() (any, error) { return r.Client.AllZodiacSignData(r.Context, vedastro.ZodiacGemini, r.Birth) }},
}
for _, item := range calls {
value, err := r.Fetch(item.call)
if err != nil {
return err
}
data[item.name] = value
}
file, err := os.OpenFile("astro_data.json", os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil {
return err
}
defer file.Close()
encoder := json.NewEncoder(file)
encoder.SetIndent("", " ")
if err := encoder.Encode(data); err != nil {
return err
}
fmt.Println("Saved astro_data.json")
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("All Sun data", func() (any, error) { return r.Client.AllPlanetData(r.Context, vedastro.PlanetSun, r.Birth) }); err != nil {
return err
}
return nil
})
}package main
import (
"fmt"
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
// Add customer records here. Every call is paced for the free API key.
for index, birth := range []vedastro.Time{r.Birth, r.Other} {
if err := r.Show(fmt.Sprintf("Chart %d", index+1), func() (any, error) {
return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSun, birth)
}); err != nil {
return err
}
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Ascendant sign", func() (any, error) { return r.Client.HouseSignName(r.Context, vedastro.House1, r.Birth) }); err != nil {
return err
}
if err := r.Show("Planets in house 1", func() (any, error) { return r.Client.PlanetsInHouseBasedOnSign(r.Context, vedastro.House1, r.Birth) }); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Sun sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSun, r.Birth) }); err != nil {
return err
}
if err := r.Show("Moon sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetMoon, r.Birth) }); err != nil {
return err
}
if err := r.Show("Ascendant", func() (any, error) { return r.Client.HouseSignName(r.Context, vedastro.House1, r.Birth) }); err != nil {
return err
}
if err := r.Show("Birth constellation", func() (any, error) { return r.Client.MoonConstellation(r.Context, r.Birth) }); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("House occupied by the Sun", func() (any, error) {
return r.Client.HousePlanetOccupiesBasedOnSign(r.Context, vedastro.PlanetSun, r.Birth)
}); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Current Sun sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSun, r.Now) }); err != nil {
return err
}
if err := r.Show("Current Saturn sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSaturn, r.Now) }); err != nil {
return err
}
if err := r.Show("Saturn retrograde", func() (any, error) { return r.Client.IsPlanetRetrograde(r.Context, vedastro.PlanetSaturn, r.Now) }); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
for _, name := range []vedastro.Ayanamsa{vedastro.AyanamsaLahiri, vedastro.AyanamsaRaman, vedastro.AyanamsaKrishnamurti} {
ctx := vedastro.WithAyanamsa(r.Context, name)
if err := r.Show(string(name), func() (any, error) { return r.Client.AyanamsaDegree(ctx, r.Birth) }); err != nil {
return err
}
}
return nil
})
}package main
import (
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Tithi", func() (any, error) { return r.Client.LunarDay(r.Context, r.Now) }); err != nil {
return err
}
if err := r.Show("Nakshatra", func() (any, error) { return r.Client.MoonConstellation(r.Context, r.Now) }); err != nil {
return err
}
if err := r.Show("Yoga", func() (any, error) { return r.Client.NithyaYoga(r.Context, r.Now) }); err != nil {
return err
}
if err := r.Show("Karana", func() (any, error) { return r.Client.Karana(r.Context, r.Now) }); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("D1", func() (any, error) { return r.Client.AllHouseRasiSigns(r.Context, r.Birth) }); err != nil {
return err
}
if err := r.Show("D9", func() (any, error) { return r.Client.AllHouseNavamshaSign(r.Context, r.Birth) }); err != nil {
return err
}
if err := r.Show("D10", func() (any, error) { return r.Client.AllHouseDashamamshaSign(r.Context, r.Birth) }); err != nil {
return err
}
if err := r.Show("Sun D9", func() (any, error) { return r.Client.PlanetNavamshaD9Sign(r.Context, vedastro.PlanetSun, r.Birth) }); err != nil {
return err
}
return nil
})
}package main
import (
"context"
"errors"
"fmt"
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
// Cancellation is checked before the HTTP request; this intentionally makes no API call.
ctx, cancel := context.WithCancel(r.Context)
cancel()
_, err := r.Client.PlanetRasiD1Sign(ctx, vedastro.PlanetSun, r.Birth)
if errors.Is(err, context.Canceled) {
fmt.Println("Canceled request handled")
} else {
return fmt.Errorf("expected cancellation, got %v", err)
}
err = r.Show("Sun sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSun, r.Birth) })
var apiErr *vedastro.APIError
if errors.As(err, &apiErr) {
fmt.Printf("API endpoint %s returned HTTP %d\n", apiErr.Endpoint, apiErr.StatusCode)
}
return err
})
}package main
import (
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Horoscope predictions", func() (any, error) { return r.Client.HoroscopePredictions(r.Context, r.Birth) }); err != nil {
return err
}
return nil
})
}package main
import (
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Compatibility report", func() (any, error) { return r.Client.MatchReport(r.Context, r.Birth, r.Other) }); err != nil {
return err
}
return nil
})
}package main
import (
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Match report", func() (any, error) { return r.Client.MatchReport(r.Context, r.Birth, r.Other) }); err != nil {
return err
}
return nil
})
}package main
import (
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Birth number", func() (any, error) { return r.Client.BirthNumber(r.Context, r.Birth) }); err != nil {
return err
}
if err := r.Show("Destiny number", func() (any, error) { return r.Client.DestinyNumber(r.Context, r.Birth) }); err != nil {
return err
}
if err := r.Show("Name prediction", func() (any, error) { return r.Client.NameNumberPrediction(r.Context, "Sengiv") }); err != nil {
return err
}
return nil
})
}package main
import (
"context"
"fmt"
"log"
vedastro "github.com/VedAstro/VedAstro.Go"
)
func main() {
client := vedastro.NewClient("FreeAPIUser")
birth, err := vedastro.NewTime("14:30 25/10/1992 +05:30",
vedastro.NewGeoLocation("Mumbai", 72.8777, 19.0760))
if err != nil {
log.Fatal(err)
}
result, err := client.PlanetRasiD1Sign(context.Background(), vedastro.PlanetSun, birth)
if err != nil {
log.Fatal(err)
}
sign, ok := result.(map[string]any)
if !ok {
log.Fatal("unexpected Sun sign response")
}
fmt.Println("Sun sign:", sign["Name"])
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Available books", func() (any, error) { return r.Client.GetAvailableSourceTexts(r.Context) }); err != nil {
return err
}
if err := r.Show("Saturn in the seventh house", func() (any, error) {
return r.Client.SearchSourceText(r.Context, "effects of Saturn in the 7th house", vedastro.SearchSourceTextOptions{TopK: vedastro.Ptr(3)})
}); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
if err := r.Show("Natal Saturn sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSaturn, r.Birth) }); err != nil {
return err
}
if err := r.Show("Current Saturn sign", func() (any, error) { return r.Client.PlanetRasiD1Sign(r.Context, vedastro.PlanetSaturn, r.Now) }); err != nil {
return err
}
if err := r.Show("Current Saturn house", func() (any, error) {
return r.Client.HousePlanetOccupiesBasedOnLongitudes(r.Context, vedastro.PlanetSaturn, r.Now)
}); err != nil {
return err
}
return nil
})
}package main
import (
vedastro "github.com/VedAstro/VedAstro.Go"
"github.com/VedAstro/VedAstro.Go/internal/exampleutil"
)
func main() {
exampleutil.Run(func(r *exampleutil.Runner) error {
return r.Show("Vimshottari dasa", func() (any, error) {
return r.Client.DasaForLife(r.Context, r.Birth, vedastro.DasaForLifeOptions{
System: vedastro.Ptr(vedastro.DasaSystemVimshottariJanma),
Depth: vedastro.Ptr(3),
})
})
})
}
The VedAstro Go library is fully open source under the MIT License. You can read the code, verify every API call, and contribute improvements back to the community. The library is maintained alongside the main VedAstro engine — when new calculations are added to the API, the Go wrapper updates to match.
Note: Calculator wrappers are generated to follow the hosted API. See the repository for source, generator guidance, and contribution instructions.
Install the library, try the free tier, and see how fast you can go from zero to a working Vedic astrology application. When your project is ready for the real world, your API key is one click away.
go get github.com/VedAstro/VedAstro.Go@v1.0.0
Made and funded by users — Support VedAstro