freeastro

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

README

FreeAstroAPI Go SDK

CI Go Reference

Official Go client for FreeAstroAPI: Western, Vedic and Chinese astrology, numerology, horoscopes, ephemeris, geo search and more. Every operation of the public OpenAPI document (142 operations) has a typed method.

API reference: https://www.freeastroapi.com/docs

Install

go get github.com/GabrielRw/freeastroapi-go-sdk

Requires Go 1.24 or later. The SDK is pre-1.0: minor versions may contain breaking changes.

Quick start

package main

import (
	"context"
	"fmt"
	"log"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	// Reads the key from FREEASTRO_API_KEY; or pass freeastro.WithAPIKey("...").
	client, err := freeastro.NewClient()
	if err != nil {
		log.Fatal(err)
	}

	cities, err := client.Geo.Search(context.Background(), &api.V2GeoSearchParams{
		Q:     "Paris",
		Limit: freeastro.Ptr(3),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(cities.Results[0].Timezone) // Europe/Paris
}

Keep API keys on servers and other trusted runtimes.

Package freeastro holds the client; package api holds the request and response types, generated from the OpenAPI document. Optional fields are pointers: freeastro.Ptr(v) builds one.

Examples

Natal chart
chart, err := client.Natal.Calculate(ctx, nil, api.NatalChartRequest{
	Year: 1990, Month: 6, Day: 15,
	Hour: freeastro.Ptr(14), Minute: freeastro.Ptr(30),
	City: freeastro.Ptr("Paris"),
})
if err != nil {
	log.Fatal(err)
}
// chart is *api.NatalCalculateResponse; optional fields are pointers.
if chart.Planets != nil {
	for _, p := range *chart.Planets {
		fmt.Println(p.Name, p.Sign)
	}
}

Every JSON response is decoded into its type, for example the Sun sign:

sun, err := client.Western.Signs.Sun(ctx, api.NatalChartRequest{
	Year: 1990, Month: 6, Day: 15, City: freeastro.Ptr("Paris"),
})
fmt.Println(sun.Sign, sun.Degree, sun.House) // *api.SignResponse
Vedic panchang
panchang, err := client.Vedic.Panchang(ctx, api.PanchangRequestV2{
	Year: 2026, Month: 1, Day: 14, Hour: 6, Minute: 0,
	City: freeastro.Ptr("Delhi"),
})
// panchang is *api.PanchangV2Response
cities, err := client.Geo.Search(ctx, &api.V2GeoSearchParams{Q: "Jingzhou, Hubei", Country: freeastro.Ptr("CN")})
for _, c := range cities.Results {
	fmt.Println(c.Name, c.Lat, c.Lng, c.Timezone)
}
Charts as SVG or PNG

Operations that return images or documents return *freeastro.Content (content type and bytes):

svg, err := client.Vedic.KPRender(ctx, api.KPChartRenderRequest{
	Year: 1990, Month: 6, Day: 15, Hour: 14, Minute: 30, City: freeastro.Ptr("Paris"),
})
os.WriteFile("kp.svg", svg.Data, 0o644) // svg.ContentType == "image/svg+xml"

Resources and method names

Methods are grouped by URL path, exactly like the TypeScript and Python SDKs:

Call Endpoint
client.Natal.Calculate(ctx, params, body) POST /api/v1/natal/calculate
client.Western.Natal.Insights(ctx, body) POST /api/v1/western/natal/insights
client.Western.Progressions.SecondaryExactAspects(ctx, body) POST /api/v1/western/progressions/secondary/exact-aspects
client.Vedic.Panchang(ctx, body) POST /api/v2/vedic/panchang
client.Chinese.Calendar(ctx, date, params) GET /api/v1/chinese/calendar/{date}
client.Horoscope.Daily.Sign(ctx, params) GET /api/v3/horoscope/daily/sign

When an operation exists in several API versions, the plain name calls the latest version and older versions carry a suffix: client.Vedic.Chart calls /api/v2/vedic/chart, client.Vedic.ChartV1 calls /api/v1/vedic/chart, and client.Horoscope.Daily.SignV1 / SignV2 reach the older daily horoscopes.

Arguments are always ctx, then path parameters, then the query parameters struct (*api.<Operation>Params, may be nil when nothing is required), then the JSON body, then per-request options. Resource groups: AI, Chinese, Ephemeris, Geo, Horoscope, Moon, Natal, Numerology, SkyEvents, Space, Transits, Vedic and Western. freeastro.Operations() lists every operation with its method.

Return types follow the spec: every JSON response is a typed *api.T, and images, PDF and Markdown are *freeastro.Content. Operations that can answer with JSON or a file (the natal report job) also have a ...Raw variant returning *freeastro.Content.

Response decoding is lenient, because some response schemas were inferred from samples: a missing required field or a null leaves the Go zero value, unknown fields are ignored (or kept in AdditionalProperties where the schema allows extra fields), and an enum field holds any string the API sends, so an unknown value never makes a call fail. Request types keep their required fields.

For newer endpoints use the escape hatch:

var out map[string]any
err := client.Do(ctx, "POST", "/api/v1/example", nil, map[string]any{"a": 1}, &out)

Errors

HTTP errors are typed. Each wraps an *freeastro.APIError with StatusCode, Message, Code (the stable error code such as rate_limited), RequestID, Body and Header; apiErr.ErrorResponse() decodes the body as the documented *api.ErrorResponse:

Type Status
*AuthenticationError 401
*PermissionError 403
*NotFoundError 404
*ConflictError 409
*ValidationError 400, 422
*RateLimitError 429 (with RetryAfter)
*ServerError 5xx
_, err := client.Geo.Search(ctx, &api.V2GeoSearchParams{Q: "Paris"})

var rateLimited *freeastro.RateLimitError
var apiErr *freeastro.APIError
switch {
case errors.As(err, &rateLimited):
	time.Sleep(rateLimited.RetryAfter)
case errors.As(err, &apiErr):
	log.Println(apiErr.StatusCode, apiErr.Code, apiErr.RequestID)
}

Failures to reach the API are *freeastro.NetworkError; a per-attempt timeout is a *freeastro.TimeoutError (which also matches *NetworkError). When your own context is cancelled or expires, the context's error is returned.

Retries and timeouts

Every SDK for FreeAstroAPI uses the same retry policy:

  • Up to 2 retries (WithMaxRetries), with exponential backoff and full jitter: retry n waits a random time between 0 and 0.5 s × 2^n, capped at 8 s (WithRetryDelay).
  • 429 is retried for every operation, since the request was rejected before it ran. The wait comes from the Retry-After header (seconds or an HTTP date) or retry_after_ms in the body, else the backoff. When the server asks for more than 30 s, the SDK does not wait: it returns the *RateLimitError at once, with RetryAfter set.
  • 408, 500, 502, 503, 504, network errors and timeouts are retried for every operation except the side-effecting ones, freeastro.SideEffectingOperations(): v1_natal_calculate (may create a paid report job), v1_ai_generate, v2_vedic_chat, v2_western_chat, v2_vedic_qa, v1_western_transits_timeline and v1_western_transits_insights. These are retried only when the call has an idempotency key (sent as the Idempotency-Key header) or opts in with WithRetry(true).
  • Other 4xx responses are never retried.
client, err := freeastro.NewClient(
	freeastro.WithTimeout(30*time.Second),                  // per attempt, default 20s
	freeastro.WithMaxRetries(3),                            // default 2, 0 disables
	freeastro.WithRetryDelay(time.Second, 10*time.Second),  // default 500ms, 8s
)

reply, err := client.Vedic.Chat(ctx, nil, body, freeastro.WithIdempotencyKey("stable-key"))
reply, err = client.Vedic.Chat(ctx, nil, body, freeastro.WithRetry(true))     // opt in
sun, err := client.Western.Signs.Sun(ctx, req, freeastro.WithRetry(false))   // no retries at all
sun, err = client.Western.Signs.Sun(ctx, req, freeastro.WithRequestMaxRetries(5))

Client.Do applies the policy of the operation matching its method and path.

Other options: WithBaseURL, WithHTTPClient, WithHeader, WithUserAgent, and per request WithRequestTimeout, WithRequestHeader and WithRawResponse (to read response headers). Requests carry User-Agent: freeastroapi-go/<version>.

Development

Go does not need to be installed: the scripts run in the pinned golang:1.26.11 Docker image (set FREEASTRO_NATIVE=1 to use a local Go toolchain instead).

scripts/generate.sh                      # regenerate from spec/freeastro.json
scripts/generate.sh --check              # fail if generated files are stale (CI)
scripts/docker.sh -- go test ./...       # run any Go command in Docker
scripts/test-fixture.sh                  # generator checks on the synthetic specs
python3 scripts/spec_sync.py fetch       # update the vendored spec from production
python3 scripts/with_prism.py -- go test -run TestContract -count=1 .   # Prism contract tests

Generation has three pinned steps:

  1. internal/cmd/specprep applies three deterministic rewrites to a copy of the spec: it drops validation-only unions (anyOf: [{required: [city]}, {required: [lat, lng]}], which would otherwise turn requests into union types), gives const schemas without a type the type of their value, and drops null from additionalProperties unions of several types (which oapi-codegen v2.8 would otherwise generate as code that does not compile). No OpenAPI 3.1 to 3.0 downgrade is needed. Format date maps to api.Date, which decodes leniently.
  2. oapi-codegen v2.8.2 (pinned in internal/tools/go.mod, configured in internal/codegen/oapi-codegen.yaml) writes the types and a low-level client to api/api.gen.go.
  3. internal/cmd/genresources writes the resource layer (resources_gen.go) and the operation table (operations_gen.go).

The tests cover the transport (auth, retries, errors), lenient decoding of every response type (decode_test.go), every operation through its method (coverage_test.go), the generator on synthetic specs with typed and untyped responses, ErrorResponse bodies and SVG/PNG/PDF/Markdown content (scripts/test-fixture.sh), every operation against a Prism mock (contract_test.go, when PRISM_URL is set) and five read-only production calls (live_test.go, when FREEASTRO_TEST_API_KEY is set).

The Sync spec workflow fetches the production spec daily and opens a pull request from spec-sync/auto when it changes.

Releasing

Bump Version in freeastro.go, update CHANGELOG.md, then push a matching tag (git tag v0.1.0 && git push origin v0.1.0). The Release workflow runs the checks, creates the GitHub release and asks proxy.golang.org to fetch the version.

Issues and contributions are welcome on GitHub.

Licensed under the Apache License 2.0.

Documentation

Overview

Package freeastro is the official Go client for FreeAstroAPI (https://www.freeastroapi.com), covering Western, Vedic and Chinese astrology, numerology, horoscopes, ephemeris, geo search and more.

client, err := freeastro.NewClient() // reads FREEASTRO_API_KEY
if err != nil {
	log.Fatal(err)
}
cities, err := client.Geo.Search(ctx, &api.V2GeoSearchParams{Q: "Paris", Limit: freeastro.Ptr(3)})

Every operation of the public OpenAPI document has a method on Client, grouped by URL path (see Client). Request and response types live in package github.com/GabrielRw/freeastroapi-go-sdk/api, generated from the same document with oapi-codegen.

Every method takes a context.Context first. Errors are typed: see APIError and the types that wrap it (AuthenticationError, ValidationError, RateLimitError, ...), NetworkError and TimeoutError. Calls are retried (twice by default, with jittered exponential backoff) after 429, 408, 500, 502, 503 and 504 responses, network errors and timeouts; a 429 honours Retry-After. The few side-effecting operations (SideEffectingOperations) are retried after a transient failure only when sent WithIdempotencyKey or WithRetry(true).

Index

Examples

Constants

View Source
const (
	// DefaultBaseURL is the production FreeAstroAPI server.
	DefaultBaseURL = "https://api.freeastroapi.com"
	// DefaultTimeout bounds each attempt of a request.
	DefaultTimeout = 20 * time.Second
	// DefaultMaxRetries is the number of retries after the first attempt.
	DefaultMaxRetries = 2

	// APIKeyEnv is the environment variable read when no API key is passed to NewClient.
	APIKeyEnv = "FREEASTRO_API_KEY"
)
View Source
const (
	// DefaultRetryBaseDelay is the backoff before the first retry; it doubles on each retry.
	DefaultRetryBaseDelay = 500 * time.Millisecond
	// DefaultRetryMaxDelay caps the computed backoff.
	DefaultRetryMaxDelay = 8 * time.Second
	// MaxRetryAfter is the longest server-requested wait (Retry-After or retry_after_ms) the
	// client sleeps through. A longer wait is not slept: the *RateLimitError is returned at
	// once with RetryAfter set.
	MaxRetryAfter = 30 * time.Second
)

Retry policy defaults (shared by every FreeAstroAPI SDK).

View Source
const Version = "0.1.0"

Version is the SDK version, sent in the User-Agent header as freeastroapi-go/<Version>.

Variables

View Source
var ErrMissingAPIKey = errors.New("freeastro: no API key: pass WithAPIKey or set " + APIKeyEnv)

ErrMissingAPIKey is returned by NewClient when no API key is configured.

Functions

func IsSideEffecting

func IsSideEffecting(operationID string) bool

IsSideEffecting reports whether operationID is one of SideEffectingOperations.

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to v. Optional request fields are pointers:

api.V2GeoSearchParams{Q: "Paris", Limit: freeastro.Ptr(3)}

func SideEffectingOperations

func SideEffectingOperations() []string

SideEffectingOperations returns, sorted, the operation IDs whose transient failures (408, 5xx, network errors, timeouts) are retried only with an idempotency key or WithRetry(true).

Types

type AIService

type AIService struct {
	// contains filtered or unexported fields
}

AIService calls the /ai operations. Use it through Client.AI.

func (*AIService) Generate

Generate calls POST /api/v1/ai/generate (operation v1_ai_generate).

Generate Atomic Report.

Generates a full astrological report using the Atomic Interpretation System.

type APIError

type APIError struct {
	// StatusCode is the HTTP status code.
	StatusCode int
	// Message is the error message from the response body, or the HTTP status text.
	Message string
	// Code is the machine-readable error code from the body, when present.
	Code string
	// RequestID identifies the request for support (X-Request-Id header or trace_id).
	RequestID string
	// Body is the raw response body.
	Body []byte
	// Header holds the response headers.
	Header http.Header
}

APIError is an error response from FreeAstroAPI. Every HTTP error is reported as one of the types below, all of which wrap an *APIError, so either form works:

var rateLimited *freeastro.RateLimitError
if errors.As(err, &rateLimited) {
	time.Sleep(rateLimited.RetryAfter)
}

var apiErr *freeastro.APIError
if errors.As(err, &apiErr) {
	log.Println(apiErr.StatusCode, apiErr.Code, apiErr.RequestID)
}
Example
package main

import (
	"context"
	"errors"
	"fmt"
	"log"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	client, err := freeastro.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	_, err = client.Geo.Search(context.Background(), &api.V2GeoSearchParams{Q: "Paris"})

	var rateLimited *freeastro.RateLimitError
	var invalid *freeastro.ValidationError
	var apiErr *freeastro.APIError
	switch {
	case errors.As(err, &rateLimited):
		fmt.Println("retry after", rateLimited.RetryAfter)
	case errors.As(err, &invalid):
		fmt.Println("invalid request:", string(invalid.Body))
	case errors.As(err, &apiErr):
		fmt.Println(apiErr.StatusCode, apiErr.Code, apiErr.RequestID)
	case err != nil:
		fmt.Println("network or timeout error:", err)
	}
}

func (*APIError) Details

func (e *APIError) Details(v any) error

Details decodes the JSON error body into v.

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) ErrorResponse

func (e *APIError) ErrorResponse() *api.ErrorResponse

ErrorResponse decodes the body as the documented error shape (api.ErrorResponse). It returns nil when the body is not a JSON object. For a 422, the validation details of the api.HTTPValidationError shape are in Detail (use Details to decode them directly).

type AuthenticationError

type AuthenticationError struct{ APIError }

AuthenticationError is returned for HTTP 401: the API key is missing or invalid.

func (*AuthenticationError) Unwrap

func (e *AuthenticationError) Unwrap() error

type ChineseService

type ChineseService struct {
	// contains filtered or unexported fields
}

ChineseService calls the /chinese operations. Use it through Client.Chinese.

func (*ChineseService) Bazi

Bazi calls POST /api/v1/chinese/bazi (operation v1_chinese_bazi).

Calculate BaZi (Four Pillars).

Calculate Chinese BaZi (Four Pillars of Destiny) chart. Includes: - 4 Pillars (GanZhi) for Year, Month, Day, Hour - 5 Element Analysis (Wu Xing) - Solar Term indicators

Timezone handling: - Uses "AUTO" by default to resolve valid LMT (Local Mean Time) for historical dates.

func (*ChineseService) BaziDictionary

BaziDictionary calls GET /api/v1/chinese/bazi/dictionary (operation v1_chinese_bazi_dictionary).

Get Bazi Interaction & Star Dictionary.

Get the full mapping of Integer IDs to Interaction/Star definitions. Clients should cache this response permanently (versioned by server version).

func (*ChineseService) BaziFlow

BaziFlow calls POST /api/v1/chinese/bazi/flow (operation v1_chinese_bazi_flow).

Calculate BaZi Flow (Annual/Monthly Pillars).

Calculate annual and monthly flow pillars for a specific target year. Used for professional timing and predictive analysis.

func (*ChineseService) BaziHealth

BaziHealth calls POST /api/v1/chinese/bazi/health (operation v1_chinese_bazi_health).

Analyze BaZi Constitution & Health Tendencies.

Analyze BaZi chart for constitution and health tendency themes.

Based on classical BaZi/TCM correspondences (Five Element framework). Returns: - Constitution analysis (temperature, moisture, yin/yang balance) - Susceptibility themes with explanatory drivers - Ten Gods stress patterns (depletion, overwork, pressure) - TCM organ-system correspondences - Instability markers from natal interactions - Timing risk analysis (decade and annual peaks)

NOTE: This is not medical advice. See disclaimer in response.

func (*ChineseService) BaziLifespan

BaziLifespan calls POST /api/v1/chinese/bazi/lifespan (operation v1_chinese_bazi_lifespan).

Calculate Neijing Life Curve (Jing/Qi/Shen).

Experimental: Calculate energy trajectory (Jing, Qi, Shen) across 0-120y lifespan. Based on Neijing 7/8 year cycles + DaYun/Annual modifier simulation.

func (*ChineseService) BaziSynastry

BaziSynastry calls POST /api/v1/chinese/bazi/synastry (operation v1_chinese_bazi_synastry).

Calculate Bazi Compatibility (Synastry).

Compare two charts for compatibility.

func (*ChineseService) BaziTimeCorrection

BaziTimeCorrection calls POST /api/v1/chinese/bazi/time-correction (operation v1_chinese_bazi_time_correction).

Calculate True Solar Time Corrections.

Get detailed breakdown of True Solar Time corrections. Returns Civil, LMT, and True Solar (Relative & Absolute).

func (*ChineseService) Calendar

Calendar calls GET /api/v1/chinese/calendar/{date} (operation v1_chinese_calendar_date).

Convert Gregorian Date to Chinese Calendar.

Convert a Gregorian date to Chinese lunisolar calendar data. Returns lunar date names, lunar-new-year and Li Chun year profiles, sexagenary month/day cycles, solar terms, and festivals.

func (*ChineseService) Today

Today calls GET /api/v1/chinese/today (operation v1_chinese_today).

Get Current BaZi Pillars (Time Now).

Get current year, month, day, and hour pillars for the present moment. Useful for "Today's energy" or quick transit checks.

type Client

type Client struct {

	// AI calls the /ai operations.
	AI *AIService
	// Chinese calls the /chinese operations.
	Chinese *ChineseService
	// Ephemeris calls the /ephemeris operations.
	Ephemeris *EphemerisService
	// Geo calls the /geo operations.
	Geo *GeoService
	// Horoscope calls the /horoscope operations.
	Horoscope *HoroscopeService
	// Moon calls the /moon operations.
	Moon *MoonService
	// Natal calls the /natal operations.
	Natal *NatalService
	// Numerology calls the /numerology operations.
	Numerology *NumerologyService
	// SkyEvents calls the /sky-events operations.
	SkyEvents *SkyEventsService
	// Space calls the /space operations.
	Space *SpaceService
	// Transits calls the /transits operations.
	Transits *TransitsService
	// Vedic calls the /vedic operations.
	Vedic *VedicService
	// Western calls the /western operations.
	Western *WesternService
	// contains filtered or unexported fields
}

Client is a FreeAstroAPI client. Create one with NewClient.

Operations are grouped by URL path: Client.Natal.Calculate calls POST /api/v1/natal/calculate and Client.Vedic.Panchang calls POST /api/v2/vedic/panchang. When an operation exists in several API versions, the plain method name calls the latest version and older versions carry a V1 or V2 suffix.

A Client is safe for concurrent use.

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient returns a client for FreeAstroAPI.

The API key comes from WithAPIKey or, when that is not given, from the FREEASTRO_API_KEY environment variable. Keep API keys on servers and other trusted runtimes.

client, err := freeastro.NewClient(freeastro.WithAPIKey(os.Getenv("FREEASTRO_API_KEY")))
Example
package main

import (
	"log"
	"os"
	"time"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
)

func main() {
	client, err := freeastro.NewClient(
		freeastro.WithAPIKey(os.Getenv("FREEASTRO_API_KEY")),
		freeastro.WithTimeout(30*time.Second),
		freeastro.WithMaxRetries(3),
	)
	if err != nil {
		log.Fatal(err)
	}
	_ = client
}

func (*Client) BaseURL

func (c *Client) BaseURL() string

BaseURL returns the server URL the client sends requests to.

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, query url.Values, body, out any, opts ...RequestOption) error

Do sends a request to any API path and decodes the response into out. It is an escape hatch for endpoints that are newer than this SDK.

path is relative to the base URL (for example "/api/v1/natal/calculate"). query may be nil. A non-nil body is sent as JSON. out may be nil (the body is discarded), a *[]byte or *Content (the raw body), or any value json.Unmarshal accepts.

Do applies the same authentication, retries and error mapping as the typed methods.

type ConflictError

type ConflictError struct{ APIError }

ConflictError is returned for HTTP 409.

func (*ConflictError) Unwrap

func (e *ConflictError) Unwrap() error

type Content

type Content struct {
	// ContentType is the response's Content-Type header, e.g. "image/svg+xml".
	ContentType string
	// Data is the response body.
	Data []byte
}

Content is a response body returned as sent, for operations that answer with images (SVG, PNG), documents (PDF, Markdown) or several content types.

func (*Content) DecodeJSON

func (c *Content) DecodeJSON(v any) error

DecodeJSON decodes a JSON body into v.

func (*Content) IsJSON

func (c *Content) IsJSON() bool

IsJSON reports whether the body is JSON.

func (*Content) MediaType

func (c *Content) MediaType() string

MediaType returns the content type without parameters, e.g. "image/svg+xml".

func (*Content) String

func (c *Content) String() string

String returns the body as text (useful for SVG and Markdown).

type DecodeError

type DecodeError struct {
	StatusCode  int
	ContentType string
	Body        []byte
	Err         error
}

DecodeError reports a successful response whose body could not be decoded.

func (*DecodeError) Error

func (e *DecodeError) Error() string

func (*DecodeError) Unwrap

func (e *DecodeError) Unwrap() error

type EphemerisService

type EphemerisService struct {
	// contains filtered or unexported fields
}

EphemerisService calls the /ephemeris operations. Use it through Client.Ephemeris.

func (*EphemerisService) Calculate

Calculate calls POST /api/v1/ephemeris/calculate (operation v1_ephemeris_calculate).

Calculate Ephemeris.

func (*EphemerisService) Get

Get calls GET /api/v1/ephemeris (operation v1_ephemeris).

Get Ephemeris.

type GeoService

type GeoService struct {
	// contains filtered or unexported fields
}

GeoService calls the /geo operations. Use it through Client.Geo.

func (*GeoService) Search

Search calls GET /api/v2/geo/search (operation v2_geo_search).

Search Cities (v2).

Search for cities by name prefix for autocomplete functionality.

**Authentication Required:** - Requires a valid `x-api-key` header.

**Cost:** - **Free Tier:** 1 Credit per request. - **Paid Tiers (Entry, High):** 0 Credits (Unlimited).

Use it to help users select the correct city before making astrology calculations.

**Example usage:** - `/api/v2/geo/search?q=par` → Returns Paris (FR), Paris (US), Paraná, etc. - `/api/v2/geo/search?q=london&country=GB` → Returns only London, UK - `/api/v2/geo/search?q=Jingzhou%2C%20Hubei` → Returns Jingzhou in Hubei, China - `/api/v2/geo/search?q=Hubei%20Jingzhou` → Also returns Jingzhou in Hubei, China - `/api/v2/geo/search?q=Jingzhou%20City%2C%20Hubei%20Province` → Accepts optional administrative suffixes

Results are sorted by population (largest cities first).

**Note:** This is the new v2 endpoint. The v1 endpoint (/api/v1/geo/search) remains free without API key until February 3, 2026, after which it will be deprecated.

Example
package main

import (
	"context"
	"fmt"
	"log"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	client, err := freeastro.NewClient() // reads FREEASTRO_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	cities, err := client.Geo.Search(context.Background(), &api.V2GeoSearchParams{
		Q:     "Paris",
		Limit: freeastro.Ptr(3),
	})
	if err != nil {
		log.Fatal(err)
	}
	for _, city := range cities.Results {
		fmt.Println(city.Name, city.Country, city.Lat, city.Lng, city.Timezone)
	}
}

func (*GeoService) SearchV1 deprecated

func (s *GeoService) SearchV1(ctx context.Context, params *api.V1GeoSearchParams, opts ...RequestOption) (*api.CitySearchResponse, error)

SearchV1 calls GET /api/v1/geo/search (operation v1_geo_search).

Search Cities (Free).

Search for cities by name prefix for autocomplete functionality.

**⚠️ DEPRECATION NOTICE:** This endpoint will require an API key after February 3, 2026. Please migrate to `/api/v2/geo/search` which requires authentication.

This endpoint is **free** and does not require an API key (until Feb 3, 2026). Use it to help users select the correct city before making astrology calculations.

**Example usage:** - `/api/v1/geo/search?q=par` → Returns Paris (FR), Paris (US), Paraná, etc. - `/api/v1/geo/search?q=london&country=GB` → Returns only London, UK - `/api/v1/geo/search?q=Jingzhou%2C%20Hubei` → Returns Jingzhou in Hubei, China

Results are sorted by population (largest cities first).

Deprecated: this operation is deprecated by the API.

type HTTPDoer

type HTTPDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPDoer sends HTTP requests. *http.Client implements it.

type HoroscopeDailyService

type HoroscopeDailyService struct {
	// contains filtered or unexported fields
}

HoroscopeDailyService calls the /horoscope/daily operations. Use it through Client.Horoscope.Daily.

func (*HoroscopeDailyService) Bulk

Bulk calls GET /api/v1/horoscope/daily/bulk (operation v1_horoscope_daily_bulk).

Get Bulk Horoscope.

Get daily horoscope for ALL signs. Optimized for caching/newsletters.

func (*HoroscopeDailyService) Personal

Personal calls POST /api/v3/horoscope/daily/personal (operation v3_horoscope_daily_personal).

Get Personal Horoscope.

func (*HoroscopeDailyService) PersonalV1

PersonalV1 calls POST /api/v1/horoscope/daily/personal (operation v1_horoscope_daily_personal).

Get Personal Horoscope.

Get personalized daily horoscope using natal chart + transits.

func (*HoroscopeDailyService) PersonalV2

PersonalV2 calls POST /api/v2/horoscope/daily/personal (operation v2_horoscope_daily_personal).

Get Personal Horoscope.

func (*HoroscopeDailyService) Sign

Sign calls GET /api/v3/horoscope/daily/sign (operation v3_horoscope_daily_sign).

Get Sign Horoscope.

Compatibility endpoint for playground clients that selected the V3 engine while using the generic sign horoscope. V3 is personal-only today, so this returns the V2 sign engine shape under the V3 route instead of 404ing.

func (*HoroscopeDailyService) SignV1

SignV1 calls GET /api/v1/horoscope/daily/sign (operation v1_horoscope_daily_sign).

Get Sign Horoscope.

Get generic daily horoscope for a specific sign.

func (*HoroscopeDailyService) SignV2

SignV2 calls GET /api/v2/horoscope/daily/sign (operation v2_horoscope_daily_sign).

Get Sign Horoscope.

type HoroscopeService

type HoroscopeService struct {

	// Daily calls the /horoscope/daily operations.
	Daily *HoroscopeDailyService
	// Weekly calls the /horoscope/weekly operations.
	Weekly *HoroscopeWeeklyService
	// contains filtered or unexported fields
}

HoroscopeService calls the /horoscope operations. Use it through Client.Horoscope.

type HoroscopeWeeklyService

type HoroscopeWeeklyService struct {
	// contains filtered or unexported fields
}

HoroscopeWeeklyService calls the /horoscope/weekly operations. Use it through Client.Horoscope.Weekly.

func (*HoroscopeWeeklyService) Personal

Personal calls POST /api/v3/horoscope/weekly/personal (operation v3_horoscope_weekly_personal).

Get Weekly Personal Horoscope.

type MoonService

type MoonService struct {
	// contains filtered or unexported fields
}

MoonService calls the /moon operations. Use it through Client.Moon.

func (*MoonService) Month

Month calls GET /api/v1/moon/month (operation v1_moon_month).

Get Moon Month.

Get a full calendar month of moon snapshots.

Each entry in `days` mirrors the `/phase` payload for that calendar date. When a location is provided, the snapshot is taken at local midnight for that calendar day.

func (*MoonService) Phase

Phase calls GET /api/v1/moon/phase (operation v1_moon_phase).

Get Moon Phase.

Get detailed moon phase data with optional verbosity.

Optional features: - include_zodiac: Moon's zodiac sign position - include_rise_set: Moon rise/set times (requires lat/lon) - include_visuals: SVG visualization of moon phase - include_special: Supermoon, Blue Moon, Harvest Moon, etc. - include_eclipse: Solar and lunar eclipse detection within 15 days - include_traditional_moon: Traditional full moon name with explicit naming-system scope

type NatalExperimentalService

type NatalExperimentalService struct {
	// contains filtered or unexported fields
}

NatalExperimentalService calls the /natal/experimental operations. Use it through Client.Natal.Experimental.

func (*NatalExperimentalService) SolarReturn deprecated

SolarReturn calls POST /api/v1/natal/experimental/solar-return (operation v1_natal_experimental_solar_return).

Experimental Solar Return Chart.

Generate a bi-wheel or standalone chart for the exact solar return in a target year.

The response body is returned as Content (image/png, image/svg+xml).

Deprecated: this operation is deprecated by the API.

func (*NatalExperimentalService) Transits deprecated

Transits calls POST /api/v1/natal/experimental/transits (operation v1_natal_experimental_transits).

Experimental Transits Chart.

Generate a bi-wheel chart with natal planets inside and transits outside.

The response body is returned as Content (image/png, image/svg+xml).

Deprecated: this operation is deprecated by the API.

type NatalService

type NatalService struct {

	// Experimental calls the /natal/experimental operations.
	Experimental *NatalExperimentalService
	// contains filtered or unexported fields
}

NatalService calls the /natal operations. Use it through Client.Natal.

func (*NatalService) Calculate

Calculate calls POST /api/v1/natal/calculate (operation v1_natal_calculate).

Calculate Natal.

Calculate natal chart with planetary positions, houses, and aspects.

Example
package main

import (
	"context"
	"fmt"
	"log"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	client, err := freeastro.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	chart, err := client.Natal.Calculate(context.Background(), nil, api.NatalChartRequest{
		Year: 1990, Month: 6, Day: 15,
		Hour: freeastro.Ptr(14), Minute: freeastro.Ptr(30),
		City: freeastro.Ptr("Paris"),
	})
	if err != nil {
		log.Fatal(err)
	}
	// chart is *api.NatalCalculateResponse; optional fields are pointers.
	if chart.Planets != nil {
		for _, p := range *chart.Planets {
			fmt.Println(p.Name, p.Sign)
		}
	}
}

func (*NatalService) Chart

Chart calls POST /api/v1/natal/chart/ (operation v1_natal_chart).

Experimental Natal Chart.

Render a natal chart using the bundled natal library.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) ChartComposite

func (s *NatalService) ChartComposite(ctx context.Context, body api.ExperimentalCompositeChartRequest, opts ...RequestOption) (*Content, error)

ChartComposite calls POST /api/v1/natal/chart/composite (operation v1_natal_chart_composite).

Experimental Composite Chart.

Midpoint composite single-wheel chart endpoint. Renders a standalone composite chart from two people, reusing the natal SVG renderer.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) ChartProgressions

ChartProgressions calls POST /api/v1/natal/chart/progressions (operation v1_natal_chart_progressions).

Experimental Secondary Progressions Chart.

Generate a bi-wheel chart with natal planets inside and secondary progressed planets outside.

The progressed wheel is cast for the symbolic instant used by `/api/v1/western/progressions/secondary` (natal instant + one ephemeris day per tropical year elapsed at `progression_date`), at the progression location (natal location by default). Aspect lines, colours, themes and `chart_config` presets behave exactly like `/api/v1/natal/chart/transits`.

Response headers expose the resolved timing: `X-Progression-System`, `X-Progression-Target-Date-UTC`, `X-Progressed-Datetime-UTC`, `X-Progression-Age-Years`.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) ChartSecondaryProgressions

func (s *NatalService) ChartSecondaryProgressions(ctx context.Context, body api.ExperimentalSecondaryProgressionsChartRequest, opts ...RequestOption) (*Content, error)

ChartSecondaryProgressions calls POST /api/v1/natal/chart/secondary-progressions (operation v1_natal_chart_secondary_progressions).

Experimental Secondary Progressions Chart.

Generate a bi-wheel chart with natal planets inside and secondary progressed planets outside.

The progressed wheel is cast for the symbolic instant used by `/api/v1/western/progressions/secondary` (natal instant + one ephemeris day per tropical year elapsed at `progression_date`), at the progression location (natal location by default). Aspect lines, colours, themes and `chart_config` presets behave exactly like `/api/v1/natal/chart/transits`.

Response headers expose the resolved timing: `X-Progression-System`, `X-Progression-Target-Date-UTC`, `X-Progressed-Datetime-UTC`, `X-Progression-Age-Years`.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) ChartSolarReturn

func (s *NatalService) ChartSolarReturn(ctx context.Context, body api.ExperimentalSolarReturnChartRequest, opts ...RequestOption) (*Content, error)

ChartSolarReturn calls POST /api/v1/natal/chart/solar-return (operation v1_natal_chart_solar_return).

Experimental Solar Return Chart.

Generate a bi-wheel or standalone chart for the exact solar return in a target year.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) ChartSynastry

ChartSynastry calls POST /api/v1/natal/chart/synastry (operation v1_natal_chart_synastry).

Experimental Synastry Chart.

Synastry bi-wheel chart endpoint. Renders person A (outer) and person B (inner) with optional B house ring and inter-aspects.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) ChartTransits

func (s *NatalService) ChartTransits(ctx context.Context, body api.ExperimentalTransitChartRequest, opts ...RequestOption) (*Content, error)

ChartTransits calls POST /api/v1/natal/chart/transits (operation v1_natal_chart_transits).

Experimental Transits Chart.

Generate a bi-wheel chart with natal planets inside and transits outside.

The response body is returned as Content (image/png, image/svg+xml).

func (*NatalService) Report

Report calls GET /api/v1/natal/report/{job_id} (operation v1_natal_report_job_id).

Get Psychological Report.

func (*NatalService) ReportCredits

func (s *NatalService) ReportCredits(ctx context.Context, opts ...RequestOption) (*api.ReportCreditsResponse, error)

ReportCredits calls GET /api/v1/natal/report-credits (operation v1_natal_report_credits).

Get Report Credits For Api Key.

func (*NatalService) ReportRaw

func (s *NatalService) ReportRaw(ctx context.Context, jobID string, params *api.V1NatalReportJobIDParams, opts ...RequestOption) (*Content, error)

ReportRaw calls GET /api/v1/natal/report/{job_id} (operation v1_natal_report_job_id).

Get Psychological Report.

ReportRaw returns the response body as sent, whatever its content type (application/json, application/pdf).

func (*NatalService) Simple

Simple calls POST /natal (operation simple_natal).

Calculate Simple Natal.

A simplified natal endpoint for developer-facing apps. Returns a compact response with curated planets, houses, and useful summary fields.

type NetworkError

type NetworkError struct{ Err error }

NetworkError reports a failure to reach the API or read its response.

func (*NetworkError) Error

func (e *NetworkError) Error() string

func (*NetworkError) Unwrap

func (e *NetworkError) Unwrap() error

type NotFoundError

type NotFoundError struct{ APIError }

NotFoundError is returned for HTTP 404.

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

type NumerologyService

type NumerologyService struct {
	// contains filtered or unexported fields
}

NumerologyService calls the /numerology operations. Use it through Client.Numerology.

func (*NumerologyService) Alphabets

Alphabets calls GET /api/v1/numerology/alphabets (operation v1_numerology_alphabets).

List immutable numerology alphabet and Gematria tables.

func (*NumerologyService) Methods

Methods calls GET /api/v1/numerology/methods (operation v1_numerology_methods).

List supported numerology methods and policies.

func (*NumerologyService) Profile

Profile calls POST /api/v1/numerology/profile (operation v1_numerology_profile).

Calculate a versioned numerology profile.

Calculate without persisting subject names, dates, or derived results.

type OperationInfo

type OperationInfo struct {
	// OperationID is the operationId in the OpenAPI document, e.g. "v1_natal_calculate".
	OperationID string
	// Method is the HTTP method, e.g. "POST".
	Method string
	// Path is the URL path template, e.g. "/api/v1/natal/calculate".
	Path string
	// Accessor is the method's path on Client, e.g. ["Natal", "Calculate"].
	Accessor []string
	// Deprecated reports whether the API marks the operation as deprecated.
	Deprecated bool
}

OperationInfo describes one API operation and the Client method that calls it.

func Operations

func Operations() []OperationInfo

Operations returns every operation in the OpenAPI document this SDK was generated from, sorted by operationId.

type Option

type Option func(*settings)

Option configures a Client. Pass options to NewClient.

func WithAPIKey

func WithAPIKey(key string) Option

WithAPIKey sets the API key sent in the x-api-key header. When it is not given (or is empty), NewClient reads the FREEASTRO_API_KEY environment variable.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL overrides the server URL (default https://api.freeastroapi.com).

func WithHTTPClient

func WithHTTPClient(client HTTPDoer) Option

WithHTTPClient sets the HTTP client used to send requests (default: a new http.Client). Use it to configure proxies, transports or instrumentation.

func WithHeader

func WithHeader(key, value string) Option

WithHeader adds a header to every request.

func WithMaxRetries

func WithMaxRetries(n int) Option

WithMaxRetries sets how many times a retryable request is retried after the first attempt (default 2). Zero disables retries.

func WithRetryDelay

func WithRetryDelay(base, max time.Duration) Option

WithRetryDelay sets the exponential backoff: the n-th retry waits a random duration between zero and base * 2^n ("full jitter"), with base * 2^n capped at max (defaults 500ms and 8s). A Retry-After header or retry_after_ms body field on a 429 replaces the computed delay.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout bounds each attempt of a request (default 20s). Zero disables the per-attempt timeout; the context passed to each call still applies.

func WithUserAgent

func WithUserAgent(product string) Option

WithUserAgent prepends a product token such as "my-app/1.2" to the User-Agent header (which is "freeastroapi-go/<version>" by default).

type PermissionError

type PermissionError struct{ APIError }

PermissionError is returned for HTTP 403: the key may not use this operation or plan.

func (*PermissionError) Unwrap

func (e *PermissionError) Unwrap() error

type RateLimitError

type RateLimitError struct {
	APIError
	// RetryAfter is how long the server asked the client to wait (the Retry-After header,
	// or retry_after_ms in the body), or zero.
	RetryAfter time.Duration
}

RateLimitError is returned for HTTP 429, after any automatic retries. It is returned at once, without retrying, when the server asks for a wait longer than MaxRetryAfter.

func (*RateLimitError) Unwrap

func (e *RateLimitError) Unwrap() error

type RequestOption

type RequestOption func(*callConfig)

RequestOption configures a single API call.

func WithIdempotencyKey

func WithIdempotencyKey(key string) RequestOption

WithIdempotencyKey sends an Idempotency-Key header. It also makes the side-effecting operations (SideEffectingOperations) eligible for retries after 408, 5xx, network errors and timeouts.

Example
package main

import (
	"context"
	"fmt"
	"log"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	client, err := freeastro.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	// POST requests are retried only when they carry an idempotency key (or WithRetry(true)).
	sun, err := client.Western.Signs.Sun(context.Background(),
		api.NatalChartRequest{Year: 1990, Month: 6, Day: 15, City: freeastro.Ptr("Paris")},
		freeastro.WithIdempotencyKey("sun-1990-06-15-paris"),
	)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(sun.Sign)
}

func WithRawResponse

func WithRawResponse(dst **http.Response) RequestOption

WithRawResponse stores the final HTTP response of a successful call in *dst, for example to read rate-limit headers or X-Request-Id. The body has already been read.

func WithRequestHeader

func WithRequestHeader(key, value string) RequestOption

WithRequestHeader sets a header on this call, replacing any client-level value.

func WithRequestMaxRetries

func WithRequestMaxRetries(n int) RequestOption

WithRequestMaxRetries overrides the client's maximum number of retries for this call. Zero disables retries.

func WithRequestTimeout

func WithRequestTimeout(timeout time.Duration) RequestOption

WithRequestTimeout overrides the client's per-attempt timeout for this call.

func WithRetry

func WithRetry(enabled bool) RequestOption

WithRetry forces automatic retries on (true) or off (false) for this call. By default every operation is retried after 429, 408, 500, 502, 503, 504, network errors and timeouts, except that the side-effecting operations (SideEffectingOperations) are retried after 408, 5xx, network errors and timeouts only with an idempotency key. WithRetry(true) opts such a call in; WithRetry(false) disables every retry, 429 included.

type ServerError

type ServerError struct{ APIError }

ServerError is returned for HTTP 5xx responses.

func (*ServerError) Unwrap

func (e *ServerError) Unwrap() error

type SkyEventsService

type SkyEventsService struct {
	// contains filtered or unexported fields
}

SkyEventsService calls the /sky-events operations. Use it through Client.SkyEvents.

func (*SkyEventsService) List

List calls GET /api/v1/sky-events (operation v1_sky_events).

Get Sky Events.

type SpaceService

type SpaceService struct {
	// contains filtered or unexported fields
}

SpaceService calls the /space operations. Use it through Client.Space.

func (*SpaceService) Chart

Chart calls POST /api/v1/space/chart (operation v1_space_chart).

Space Chart.

func (*SpaceService) ChartSVG

func (s *SpaceService) ChartSVG(ctx context.Context, body api.SpaceChartSvgRequest, opts ...RequestOption) (*Content, error)

ChartSVG calls POST /api/v1/space/chart/svg (operation v1_space_chart_svg).

Space Chart Svg.

The chart wheel, drawn by the natal chart renderer with the same themes and options.

The response body is returned as Content (image/svg+xml).

type TimeoutError

type TimeoutError struct{ NetworkError }

TimeoutError reports that an attempt exceeded the client's timeout (WithTimeout or WithRequestTimeout). It wraps a *NetworkError. When the caller's own context expires, the context error is returned instead.

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

func (*TimeoutError) Unwrap

func (e *TimeoutError) Unwrap() error

type TransitsService

type TransitsService struct {
	// contains filtered or unexported fields
}

TransitsService calls the /transits operations. Use it through Client.Transits.

func (*TransitsService) Calculate

Calculate calls POST /api/v1/transits/calculate (operation v1_transits_calculate).

Calculate Transits.

Calculate planetary transits relative to natal chart.

By default, returns only major aspects (Conjunction, Opposition, Trine, Square, Sextile). Set include_minor=true to get all 10 aspect types including minor aspects.

type ValidationError

type ValidationError struct{ APIError }

ValidationError is returned for HTTP 400 and 422: the request was rejected as invalid. Body holds the validation details.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

type VedicGocharService

type VedicGocharService struct {
	// contains filtered or unexported fields
}

VedicGocharService calls the /vedic/gochar operations. Use it through Client.Vedic.Gochar.

func (*VedicGocharService) Timeline

Timeline calls POST /api/v2/vedic/gochar/timeline (operation v2_vedic_gochar_timeline).

Get Vedic Gochar Timeline (v2).

Return compact V2 Vedic gochar windows over a bounded date range.

func (*VedicGocharService) TimelineInsights

TimelineInsights calls POST /api/v2/vedic/gochar/timeline/insights (operation v2_vedic_gochar_timeline_insights).

Get Vedic Gochar Timeline Insights (v2).

Return ranked V2 Vedic gochar insight facts derived from the calibrated V2 timeline.

func (*VedicGocharService) TimelineInsightsV1

TimelineInsightsV1 calls POST /api/v1/vedic/gochar/timeline/insights (operation v1_vedic_gochar_timeline_insights).

Get Gochar Timeline Insights.

Get ranked Vedic gochar timeline insights derived from compact timeline windows.

func (*VedicGocharService) TimelineV1

TimelineV1 calls POST /api/v1/vedic/gochar/timeline (operation v1_vedic_gochar_timeline).

Get Gochar Timeline.

Get compact Vedic gochar timeline windows over a bounded date range.

type VedicHoroscopeService

type VedicHoroscopeService struct {
	// contains filtered or unexported fields
}

VedicHoroscopeService calls the /vedic/horoscope operations. Use it through Client.Vedic.Horoscope.

func (*VedicHoroscopeService) DailyBulk

DailyBulk calls GET /api/v2/vedic/horoscope/daily/bulk (operation v2_vedic_horoscope_daily_bulk).

Get General Daily Vedic Rashifal for All 12 Moon Signs (v2).

Return all 12 rashis from one shared noon sky snapshot, keyed by lowercase English sign names.

func (*VedicHoroscopeService) DailyPersonal

DailyPersonal calls POST /api/v2/vedic/horoscope/daily/personal (operation v2_vedic_horoscope_daily_personal).

Get Daily Vedic Horoscope (v2).

Return a premium deterministic daily Vedic horoscope composed from V2 chart context, one-day gochar insights, active Vimshottari dasha, and Panchang.

func (*VedicHoroscopeService) DailySign

DailySign calls GET /api/v2/vedic/horoscope/daily/sign (operation v2_vedic_horoscope_daily_sign).

Get General Daily Vedic Rashifal for One Moon Sign (v2).

General Moon-sign forecast with calculated transits and optional English or Hindi readings. No birth details required.

type VedicMuhuratService

type VedicMuhuratService struct {
	// contains filtered or unexported fields
}

VedicMuhuratService calls the /vedic/muhurat operations. Use it through Client.Vedic.Muhurat.

func (*VedicMuhuratService) PersonalizedSearch

PersonalizedSearch calls POST /api/v2/vedic/muhurat/personalized-search (operation v2_vedic_muhurat_personalized_search).

Search auspicious Vedic windows with natal personalization (v2).

Search public muhurat windows, then re-rank them for a specific birth chart.

The public candidate generation remains the same as /muhurat/search. This endpoint adds natal Tara Bala and Chandra Bala scoring, plus Vehicle Purchase fourth-house/Venus context when that purpose is requested.

func (*VedicMuhuratService) Search

Search calls POST /api/v2/vedic/muhurat/search (operation v2_vedic_muhurat_search).

Search auspicious Vedic windows (v2).

Search a monthly date range for auspicious windows.

This generic v2 search ranks Abhijit, Chaughadia, Gowri Panchangam, and Hora windows, then removes overlaps with Rahu Kaal, Bhadra, and Panchak. For vehicle purchase, property purchase, Griha Pravesh, Namkaran, and Mundan it applies purpose-specific tithi and nakshatra windows calibrated against AstroSage-style public tables.

type VedicService

type VedicService struct {

	// Gochar calls the /vedic/gochar operations.
	Gochar *VedicGocharService
	// Horoscope calls the /vedic/horoscope operations.
	Horoscope *VedicHoroscopeService
	// Muhurat calls the /vedic/muhurat operations.
	Muhurat *VedicMuhuratService
	// Transits calls the /vedic/transits operations.
	Transits *VedicTransitsService
	// Visual calls the /vedic/visual operations.
	Visual *VedicVisualService
	// contains filtered or unexported fields
}

VedicService calls the /vedic operations. Use it through Client.Vedic.

func (*VedicService) Batch

Batch calls POST /api/v1/vedic/batch (operation v1_vedic_batch).

Run Vedic Batch.

Run up to 6 single-person Vedic endpoint calls in one HTTP request. Items execute sequentially to keep compute bounded and preserve per-item order.

func (*VedicService) Calculate

Calculate calls POST /api/v2/vedic/calculate (operation v2_vedic_calculate).

Get Full Vedic Calculate (v2).

Return a full V2 Vedic chart payload composed from calibrated V2 component engines.

func (*VedicService) CalculateV1

CalculateV1 calls POST /api/v1/vedic/calculate (operation v1_vedic_calculate).

Calculate Full Chart.

Full Vedic chart with all optional features. Use feature toggles to customize response.

func (*VedicService) Chart

Chart calls POST /api/v2/vedic/chart (operation v2_vedic_chart).

Get Vedic Chart (v2).

Return a clean V2 D1 chart payload built from the shared sidereal chart engine.

func (*VedicService) ChartV1

ChartV1 calls POST /api/v1/vedic/chart (operation v1_vedic_chart).

Get Basic Chart.

Get basic Vedic chart: Planets + Houses + Ascendant. Lightweight endpoint for essential data only.

func (*VedicService) Chat

Chat calls POST /api/v2/vedic/chat (operation v2_vedic_chat).

Hosted Vedic Chat (v2).

Hosted Vedic Chat orchestration.

This endpoint uses FreeAstroAPI's scoped Vedic MCP tools for deterministic chart facts, then generates a concise answer through the hosted model layer. Developers who bring their own model should use `/mcp/vedic-bot` directly.

func (*VedicService) Compatibility

Compatibility calls POST /api/v2/vedic/compatibility (operation v2_vedic_compatibility).

Get Vedic Compatibility (v2).

Return an AstroSage-style V2 Ashtakoota compatibility payload.

The endpoint accepts either two birth charts, two structured manual Moon inputs, or the legacy v1 flat Moon fields.

func (*VedicService) CompatibilityV1

CompatibilityV1 calls POST /api/v1/vedic/compatibility (operation v1_vedic_compatibility).

Calculate Compatibility.

Calculate Ashtakoota (8-point) compatibility. Returns score out of 36.

func (*VedicService) Dasha

Dasha calls POST /api/v2/vedic/dasha (operation v2_vedic_dasha).

Get Vimshottari Dasha (v2).

Return a V2 Vimshottari Dasha contract with birth balance, active stack, and timeline.

func (*VedicService) DashaInsights

DashaInsights calls POST /api/v2/vedic/dasha/insights (operation v2_vedic_dasha_insights).

Get Vimshottari Dasha Insights (v2).

Return ranked dasha insight facts derived from the calibrated V2 Vimshottari timeline.

func (*VedicService) DashaInsightsV1

func (s *VedicService) DashaInsightsV1(ctx context.Context, body api.DashaRequestV1, opts ...RequestOption) (*api.VedicDashaInsightsResponse, error)

DashaInsightsV1 calls POST /api/v1/vedic/dasha/insights (operation v1_vedic_dasha_insights).

Get Dasha Insights.

Get index-ready Vimshottari Dasha facts for Vedic retrieval and bot use.

func (*VedicService) DashaV1

DashaV1 calls POST /api/v1/vedic/dasha (operation v1_vedic_dasha).

Get Dasha.

Get Vimshottari Dasha timeline only.

func (*VedicService) KP

KP calls POST /api/v2/vedic/kp (operation v2_vedic_kp).

Get Complete KP Chart (v2).

Return a complete Krishnamurti Paddhati calculation contract.

The endpoint reuses the standard Vedic birth fields and coordinate resolver, including “tz_str=AUTO“. KP invariants are explicit: Krishnamurti ayanamsha and sidereal Placidus house cusps.

func (*VedicService) KPRender

func (s *VedicService) KPRender(ctx context.Context, body api.KPChartRenderRequest, opts ...RequestOption) (*Content, error)

KPRender calls POST /api/v2/vedic/kp/render (operation v2_vedic_kp_render).

Render KP Chart and Tables (v2).

Render the same complete KP calculation as an accessible SVG or PNG.

The response body is returned as Content (image/png, image/svg+xml).

Example
package main

import (
	"context"
	"log"
	"os"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	client, err := freeastro.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	svg, err := client.Vedic.KPRender(context.Background(), api.KPChartRenderRequest{
		Year: 1990, Month: 6, Day: 15, Hour: 14, Minute: 30, City: freeastro.Ptr("Paris"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if err := os.WriteFile("kp.svg", svg.Data, 0o644); err != nil {
		log.Fatal(err)
	}
}

func (*VedicService) Match

Match calls POST /api/v2/vedic/match (operation v2_vedic_match).

Get Vedic Match by Birth Details (v2).

Return the calibrated V2 compatibility payload from two birth charts.

This is the birth-data-only equivalent of `/api/v2/vedic/compatibility`.

func (*VedicService) MatchV1

MatchV1 calls POST /api/v1/vedic/match (operation v1_vedic_match).

Match Birth Details.

Calculate compatibility using birth details directly. Computes Moon Nakshatra/Sign internally to avoid ID lookup errors.

func (*VedicService) Panchang

Panchang calls POST /api/v2/vedic/panchang (operation v2_vedic_panchang).

Get Panchang (v2).

Return a sunrise-based daily Panchang with transition times calibrated toward AstroSage's public daily Panchang presentation.

Example
package main

import (
	"context"
	"fmt"
	"log"

	freeastro "github.com/GabrielRw/freeastroapi-go-sdk"
	"github.com/GabrielRw/freeastroapi-go-sdk/api"
)

func main() {
	client, err := freeastro.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	panchang, err := client.Vedic.Panchang(context.Background(), api.PanchangRequestV2{
		Year: 2026, Month: 1, Day: 14, Hour: 6, Minute: 0,
		City: freeastro.Ptr("Delhi"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", panchang)
}

func (*VedicService) PanchangV1

PanchangV1 calls POST /api/v1/vedic/panchang (operation v1_vedic_panchang).

Get Panchang.

Get Panchang (daily almanac): Tithi, Nakshatra, Yoga, Karana, Rahu Kalam.

func (*VedicService) QA

QA calls POST /api/v2/vedic/qa (operation v2_vedic_qa).

Answer Vedic question (v2).

Answer a constrained Vedic question with structured calculation evidence.

Supports daily Muhurat questions for Abhijit, Rahu Kaal, Brahma Muhurat, Do Ghati Muhurat, Hora, Chaughadia, Gowri Panchangam, Panchak, and Bhadra. Table-style intents return full day/night sections plus current_period when a local lookup time is supplied or the requested date is today.

func (*VedicService) Strength

Strength calls POST /api/v2/vedic/strength (operation v2_vedic_strength).

Get Vedic Strength (v2).

Return V2 strength data with classical Shadbala and classical Ashtakavarga.

func (*VedicService) StrengthV1

StrengthV1 calls POST /api/v1/vedic/strength (operation v1_vedic_strength).

Get Strength.

Get planetary strength: Shadbala + Ashtakavarga.

func (*VedicService) Vargas

Vargas calls POST /api/v2/vedic/vargas (operation v2_vedic_vargas).

Get Vedic Vargas (v2).

Return V2 divisional chart rows and whole-sign divisional layouts.

func (*VedicService) VargasV1

VargasV1 calls POST /api/v1/vedic/vargas (operation v1_vedic_vargas).

Get Vargas.

Get divisional chart positions (D1, D9, D10, etc).

func (*VedicService) Yogas

Yogas calls POST /api/v2/vedic/yogas (operation v2_vedic_yogas).

Get Vedic Yogas (v2).

Evaluate a classical V2 yoga catalog and return active and inactive results with evidence.

func (*VedicService) YogasV1

YogasV1 calls POST /api/v1/vedic/yogas (operation v1_vedic_yogas).

Get Yogas.

Get detected Yogas only (Manglik, Kala Sarpa, Raj Yogas, etc).

type VedicTransitsService

type VedicTransitsService struct {
	// contains filtered or unexported fields
}

VedicTransitsService calls the /vedic/transits operations. Use it through Client.Vedic.Transits.

func (*VedicTransitsService) Insights

Insights calls POST /api/v1/vedic/transits/insights (operation v1_vedic_transits_insights).

Get Transit Insights.

Get Vedic gochar snapshot facts comparing a transit date against the natal chart.

type VedicVisualService

type VedicVisualService struct {
	// contains filtered or unexported fields
}

VedicVisualService calls the /vedic/visual operations. Use it through Client.Vedic.Visual.

func (*VedicVisualService) Chart

Chart calls POST /api/v2/vedic/visual/chart (operation v2_vedic_visual_chart).

Render Vedic Visual Chart (v2).

Render requested V2 divisional charts as a raw SVG or PNG image.

The response body is returned as Content (image/png, image/svg+xml).

type WesternAstrocartographyService

type WesternAstrocartographyService struct {
	// contains filtered or unexported fields
}

WesternAstrocartographyService calls the /western/astrocartography operations. Use it through Client.Western.Astrocartography.

func (*WesternAstrocartographyService) CityCheck

CityCheck calls POST /api/v1/western/astrocartography/city-check (operation v1_western_astrocartography_city_check).

Get Astrocartography City Check.

Score a single city across the five primary relocation-oriented focus areas.

func (*WesternAstrocartographyService) Lines

Lines calls POST /api/v1/western/astrocartography/lines (operation v1_western_astrocartography_lines).

Get Astrocartography Lines.

Compute astrocartography map lines for a natal chart.

func (*WesternAstrocartographyService) Parans

Parans calls POST /api/v1/western/astrocartography/parans (operation v1_western_astrocartography_parans).

Get Astrocartography Parans.

Compute classical in-mundo astrocartography parans for a natal chart.

func (*WesternAstrocartographyService) Recommendations

Recommendations calls POST /api/v1/western/astrocartography/recommendations (operation v1_western_astrocartography_recommendations).

Get Astrocartography Recommendations.

Rank candidate cities for a focus-oriented astrocartography search.

func (*WesternAstrocartographyService) Relocation

Relocation calls POST /api/v1/western/astrocartography/relocation (operation v1_western_astrocartography_relocation).

Get Astrocartography Relocation.

Build a full relocated chart for the natal instant at a target city.

type WesternChartSimilarityService

type WesternChartSimilarityService struct {
	// contains filtered or unexported fields
}

WesternChartSimilarityService calls the /western/chart-similarity operations. Use it through Client.Western.ChartSimilarity.

func (*WesternChartSimilarityService) FamousPeople

FamousPeople calls POST /api/v2/western/chart-similarity/famous-people (operation v2_western_chart_similarity_famous_people).

Compare Famous People Chart Similarity.

type WesternDirectionsService

type WesternDirectionsService struct {
	// contains filtered or unexported fields
}

WesternDirectionsService calls the /western/directions operations. Use it through Client.Western.Directions.

func (*WesternDirectionsService) Primary

Primary calls POST /api/v1/western/directions/primary (operation v1_western_directions_primary).

Get Primary Directions.

Compute primary directions for a natal chart over a date range.

The default method is Regiomontanus in-mundo. Symbolic zodiacal directions remain available by setting settings.method=zodiacal.

func (*WesternDirectionsService) PrimaryCalendar

PrimaryCalendar calls POST /api/v1/western/directions/primary/calendar (operation v1_western_directions_primary_calendar).

Get Primary Directions Calendar.

func (*WesternDirectionsService) PrimaryExactAspects

PrimaryExactAspects calls POST /api/v1/western/directions/primary/exact-aspects (operation v1_western_directions_primary_exact_aspects).

Get Primary Directions Exact Aspects.

func (*WesternDirectionsService) PrimarySearch

PrimarySearch calls POST /api/v1/western/directions/primary/search (operation v1_western_directions_primary_search).

Search Primary Directions.

type WesternElectionalService

type WesternElectionalService struct {
	// contains filtered or unexported fields
}

WesternElectionalService calls the /western/electional operations. Use it through Client.Western.Electional.

func (*WesternElectionalService) InvestMoneySearch

InvestMoneySearch calls POST /api/v2/western/electional/invest-money/search (operation v2_western_electional_invest_money_search).

Search Invest Money Elections.

func (*WesternElectionalService) JobAuditionSearch

JobAuditionSearch calls POST /api/v2/western/electional/job-audition/search (operation v2_western_electional_job_audition_search).

Search Job Audition Elections.

func (*WesternElectionalService) LegalProceedingsSearch

LegalProceedingsSearch calls POST /api/v2/western/electional/legal-proceedings/search (operation v2_western_electional_legal_proceedings_search).

Search Legal Proceedings Elections.

func (*WesternElectionalService) MakingContractsSearch

MakingContractsSearch calls POST /api/v2/western/electional/making-contracts/search (operation v2_western_electional_making_contracts_search).

Search Making Contracts Elections.

func (*WesternElectionalService) MoveIntoNewHomeSearch

MoveIntoNewHomeSearch calls POST /api/v2/western/electional/move-into-new-home/search (operation v2_western_electional_move_into_new_home_search).

Search Move Into New Home Elections.

func (*WesternElectionalService) PhysicalExaminationSearch

PhysicalExaminationSearch calls POST /api/v2/western/electional/physical-examination/search (operation v2_western_electional_physical_examination_search).

Search Physical Examination Elections.

func (*WesternElectionalService) PurchaseCarSearch

PurchaseCarSearch calls POST /api/v2/western/electional/purchase-car/search (operation v2_western_electional_purchase_car_search).

Search Purchase Car Elections.

func (*WesternElectionalService) PurchasePropertySearch

PurchasePropertySearch calls POST /api/v2/western/electional/purchase-property/search (operation v2_western_electional_purchase_property_search).

Search Purchase Property Elections.

func (*WesternElectionalService) StartingJourneySearch

StartingJourneySearch calls POST /api/v2/western/electional/starting-journey/search (operation v2_western_electional_starting_journey_search).

Search Starting Journey Elections.

func (*WesternElectionalService) WeddingSearch

WeddingSearch calls POST /api/v2/western/electional/wedding/search (operation v2_western_electional_wedding_search).

Search Wedding Elections.

type WesternNatalService

type WesternNatalService struct {
	// contains filtered or unexported fields
}

WesternNatalService calls the /western/natal operations. Use it through Client.Western.Natal.

func (*WesternNatalService) Insights

Insights calls POST /api/v1/western/natal/insights (operation v1_western_natal_insights).

Get Natal Insights.

Return machine-readable natal insight facts, with optional canonical grouping and French display text.

func (*WesternNatalService) InsightsIndexDocuments

InsightsIndexDocuments calls POST /api/v1/western/natal/insights/index-documents (operation v1_western_natal_insights_index_documents).

Get Natal Insight Index Documents.

Return one denormalized search document per natal insight fact for external indexing systems.

type WesternProfectionsService

type WesternProfectionsService struct {
	// contains filtered or unexported fields
}

WesternProfectionsService calls the /western/profections operations. Use it through Client.Western.Profections.

func (*WesternProfectionsService) Annual

Annual calls POST /api/v1/western/profections/annual (operation v1_western_profections_annual).

Get Annual Profections.

Annual profections endpoint with a solar-return-style envelope and a timing-oriented body.

type WesternProgressionsService

type WesternProgressionsService struct {
	// contains filtered or unexported fields
}

WesternProgressionsService calls the /western/progressions operations. Use it through Client.Western.Progressions.

func (*WesternProgressionsService) ConverseSecondary

ConverseSecondary calls POST /api/v1/western/progressions/converse-secondary (operation v1_western_progressions_converse_secondary).

Get Converse Secondary Progressions.

func (*WesternProgressionsService) ConverseSecondaryCalendar

ConverseSecondaryCalendar calls POST /api/v1/western/progressions/converse-secondary/calendar (operation v1_western_progressions_converse_secondary_calendar).

Get Converse Secondary Progressions Calendar.

func (*WesternProgressionsService) ConverseSecondaryExactAspects

ConverseSecondaryExactAspects calls POST /api/v1/western/progressions/converse-secondary/exact-aspects (operation v1_western_progressions_converse_secondary_exact_aspects).

Search Converse Secondary Exact Aspects.

func (*WesternProgressionsService) ConverseSecondaryExactIngresses

ConverseSecondaryExactIngresses calls POST /api/v1/western/progressions/converse-secondary/exact-ingresses (operation v1_western_progressions_converse_secondary_exact_ingresses).

Search Converse Secondary Exact Ingresses.

func (*WesternProgressionsService) Quaternary

Quaternary calls POST /api/v1/western/progressions/quaternary (operation v1_western_progressions_quaternary).

Get Quaternary Progressions.

func (*WesternProgressionsService) QuaternaryCalendar

QuaternaryCalendar calls POST /api/v1/western/progressions/quaternary/calendar (operation v1_western_progressions_quaternary_calendar).

Get Quaternary Progressions Calendar.

func (*WesternProgressionsService) QuaternaryExactAspects

QuaternaryExactAspects calls POST /api/v1/western/progressions/quaternary/exact-aspects (operation v1_western_progressions_quaternary_exact_aspects).

Search Quaternary Exact Aspects.

func (*WesternProgressionsService) QuaternaryExactIngresses

QuaternaryExactIngresses calls POST /api/v1/western/progressions/quaternary/exact-ingresses (operation v1_western_progressions_quaternary_exact_ingresses).

Search Quaternary Exact Ingresses.

func (*WesternProgressionsService) Quotidian

Quotidian calls POST /api/v1/western/progressions/quotidian (operation v1_western_progressions_quotidian).

Get Quotidian Progressions.

func (*WesternProgressionsService) QuotidianCalendar

QuotidianCalendar calls POST /api/v1/western/progressions/quotidian/calendar (operation v1_western_progressions_quotidian_calendar).

Get Quotidian Progressions Calendar.

func (*WesternProgressionsService) QuotidianExactAspects

QuotidianExactAspects calls POST /api/v1/western/progressions/quotidian/exact-aspects (operation v1_western_progressions_quotidian_exact_aspects).

Search Quotidian Exact Aspects.

func (*WesternProgressionsService) QuotidianExactIngresses

QuotidianExactIngresses calls POST /api/v1/western/progressions/quotidian/exact-ingresses (operation v1_western_progressions_quotidian_exact_ingresses).

Search Quotidian Exact Ingresses.

func (*WesternProgressionsService) Secondary

Secondary calls POST /api/v1/western/progressions/secondary (operation v1_western_progressions_secondary).

Get Secondary Progressions.

Compute a secondary progressed chart using the classic symbolic timing rule: 1 day after birth = 1 year of life.

`target_date` accepts either `YYYY-MM-DD` or a full ISO datetime. Date-only values are normalized to `00:00:00Z`. The endpoint returns the explicit progressed datetime basis, the progressed chart, and optional movement/lifecycle/timeline expansions.

`orb_deg` is the maximum orb used for aspect detection and exact-hit refinement. Timeline mode is opt-in through the `include=timeline` expansion and scans forward from the target date for exact aspects, ingresses, stations, and major moon phases.

func (*WesternProgressionsService) SecondaryCalendar

SecondaryCalendar calls POST /api/v1/western/progressions/secondary/calendar (operation v1_western_progressions_secondary_calendar).

Get Secondary Progressions Calendar.

func (*WesternProgressionsService) SecondaryExactAspects

SecondaryExactAspects calls POST /api/v1/western/progressions/secondary/exact-aspects (operation v1_western_progressions_secondary_exact_aspects).

Search Secondary Exact Aspects.

func (*WesternProgressionsService) SecondaryExactIngresses

SecondaryExactIngresses calls POST /api/v1/western/progressions/secondary/exact-ingresses (operation v1_western_progressions_secondary_exact_ingresses).

Search Secondary Exact Ingresses.

func (*WesternProgressionsService) Tertiary

Tertiary calls POST /api/v1/western/progressions/tertiary (operation v1_western_progressions_tertiary).

Get Tertiary Progressions.

func (*WesternProgressionsService) TertiaryCalendar

TertiaryCalendar calls POST /api/v1/western/progressions/tertiary/calendar (operation v1_western_progressions_tertiary_calendar).

Get Tertiary Progressions Calendar.

func (*WesternProgressionsService) TertiaryExactAspects

TertiaryExactAspects calls POST /api/v1/western/progressions/tertiary/exact-aspects (operation v1_western_progressions_tertiary_exact_aspects).

Search Tertiary Exact Aspects.

func (*WesternProgressionsService) TertiaryExactIngresses

TertiaryExactIngresses calls POST /api/v1/western/progressions/tertiary/exact-ingresses (operation v1_western_progressions_tertiary_exact_ingresses).

Search Tertiary Exact Ingresses.

type WesternReturnsService

type WesternReturnsService struct {
	// contains filtered or unexported fields
}

WesternReturnsService calls the /western/returns operations. Use it through Client.Western.Returns.

func (*WesternReturnsService) Calculate

Calculate calls POST /api/v1/western/returns/calculate (operation v1_western_returns_calculate).

Get Planet Return.

Computes a deterministic planetary return chart against the natal chart. The return target is selected by body plus a date anchor and selection mode.

type WesternService

type WesternService struct {

	// Astrocartography calls the /western/astrocartography operations.
	Astrocartography *WesternAstrocartographyService
	// ChartSimilarity calls the /western/chart-similarity operations.
	ChartSimilarity *WesternChartSimilarityService
	// Directions calls the /western/directions operations.
	Directions *WesternDirectionsService
	// Electional calls the /western/electional operations.
	Electional *WesternElectionalService
	// Natal calls the /western/natal operations.
	Natal *WesternNatalService
	// Profections calls the /western/profections operations.
	Profections *WesternProfectionsService
	// Progressions calls the /western/progressions operations.
	Progressions *WesternProgressionsService
	// Returns calls the /western/returns operations.
	Returns *WesternReturnsService
	// Signs calls the /western/signs operations.
	Signs *WesternSignsService
	// Solar calls the /western/solar operations.
	Solar *WesternSolarService
	// Transits calls the /western/transits operations.
	Transits *WesternTransitsService
	// contains filtered or unexported fields
}

WesternService calls the /western operations. Use it through Client.Western.

func (*WesternService) Chat

Chat calls POST /api/v2/western/chat (operation v2_western_chat).

Hosted Western Astrology Chat (v2).

Generate a grounded Western astrology answer from the scoped Western MCP tools.

func (*WesternService) Synastry

Synastry calls POST /api/v2/western/synastry (operation v2_western_synastry).

Get Synastry V2.

func (*WesternService) SynastryHoroscope

SynastryHoroscope calls POST /api/v2/western/synastry/horoscope (operation v2_western_synastry_horoscope).

Get Couples Horoscope V2.

func (*WesternService) SynastryHoroscopeV1

SynastryHoroscopeV1 calls POST /api/v1/western/synastry/horoscope (operation v1_western_synastry_horoscope).

Get Couples Horoscope.

Daily Couples Horoscope V2. - Multi-dimensional scoring (Romance, Stability, Tension, etc.) - Dual-perspective transits (Composite & Synastry) - Deterministic narrative bands (Theme, Core, Shadow) - Integrated relational rituals

func (*WesternService) SynastrySimplified

func (s *WesternService) SynastrySimplified(ctx context.Context, body api.SynastryRequest, opts ...RequestOption) (*api.SynastrySimplifiedResponse, error)

SynastrySimplified calls POST /api/v1/western/synastry/simplified (operation v1_western_synastry_simplified).

Get Synastry Simplified.

Simplified Synastry analysis. Returns highlights, top aspects, scores, and archetype without full aspect/overlay lists.

func (*WesternService) SynastrySummary

func (s *WesternService) SynastrySummary(ctx context.Context, body api.SynastryRequest, opts ...RequestOption) (*api.SynastrySummaryResponse, error)

SynastrySummary calls POST /api/v1/western/synastry/summary (operation v1_western_synastry_summary).

Get Synastry Summary.

Simplified summary of the synastry chart for general audiences.

func (*WesternService) SynastryV1

SynastryV1 calls POST /api/v1/western/synastry (operation v1_western_synastry).

Get Synastry.

Detailed Western Synastry analysis. Deterministic, data-rich output including aspects, overlays, scoring, and archetypes. Use query parameters to filter the response size.

func (*WesternService) Synastrycards

Synastrycards calls POST /api/v2/western/synastrycards (operation v2_western_synastrycards).

Get Synastry Cards V2.

func (*WesternService) SynastrycardsV1

SynastrycardsV1 calls POST /api/v1/western/synastrycards (operation v1_western_synastrycards).

Get Synastry Cards.

Card-oriented synastry response designed for mobile apps and compatibility features.

  • Implements a 5-step polarity scoring system (structure + planet-pair + strength)
  • Fetches rich interpretation blocks from Supabase based on relationship context
  • Minor aspect cards are excluded by default; opt in with include_minor_cards=true
  • Returns a summary (archetype, scores, top strengths / challenges + narrative) and up to 15 aspect cards, each with both supportive and challenging blocks.

type WesternSignsService

type WesternSignsService struct {
	// contains filtered or unexported fields
}

WesternSignsService calls the /western/signs operations. Use it through Client.Western.Signs.

func (*WesternSignsService) Midheaven

Midheaven calls POST /api/v1/western/signs/midheaven (operation v1_western_signs_midheaven).

Get Midheaven Sign.

Get the Midheaven (MC) sign and its interpretation.

func (*WesternSignsService) Moon

Moon calls POST /api/v1/western/signs/moon (operation v1_western_signs_moon).

Get Moon Sign.

Get the Moon sign and its interpretation.

func (*WesternSignsService) Rising

Rising calls POST /api/v1/western/signs/rising (operation v1_western_signs_rising).

Get Rising Sign.

Get the Rising sign (Ascendant) and its interpretation.

func (*WesternSignsService) Sun

Sun calls POST /api/v1/western/signs/sun (operation v1_western_signs_sun).

Get Sun Sign.

Get the Sun sign and its interpretation.

type WesternSolarService

type WesternSolarService struct {
	// contains filtered or unexported fields
}

WesternSolarService calls the /western/solar operations. Use it through Client.Western.Solar.

func (*WesternSolarService) Calculate

Calculate calls POST /api/v1/western/solar/calculate (operation v1_western_solar_calculate).

Get Solar Return.

Computes purely deterministic Solar Return chart against the Natal chart. Returns structurally identical core chart blocks (planets, aspects) as well as exact cross-aspects and angularity, without scoring or archetype models.

type WesternTransitsService

type WesternTransitsService struct {
	// contains filtered or unexported fields
}

WesternTransitsService calls the /western/transits operations. Use it through Client.Western.Transits.

func (*WesternTransitsService) Insights

Insights calls POST /api/v1/western/transits/insights (operation v1_western_transits_insights).

Get Transit Insights.

Compute derived transit insight windows from the transit timeline engine.

func (*WesternTransitsService) Search

Search calls POST /api/v1/western/transits/search (operation v1_western_transits_search).

Search Transits.

Search a long-range date or age window for all passes of one transit planet against one natal point.

func (*WesternTransitsService) Timeline

Timeline calls POST /api/v1/western/transits/timeline (operation v1_western_transits_timeline).

Get Transits Timeline.

Compute transit-to-natal interval passes across a date range for calendar and timeline rendering.

func (*WesternTransitsService) TimelineIndexDocuments

TimelineIndexDocuments calls POST /api/v1/western/transits/timeline/index-documents (operation v1_western_transits_timeline_index_documents).

Get Transits Timeline Index Documents.

Compute timeline passes and return one denormalized search document per pass.

Directories

Path Synopsis
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
internal
cmd/genresources command
Command genresources generates the idiomatic resource layer of the SDK.
Command genresources generates the idiomatic resource layer of the SDK.
cmd/specprep command
Command specprep prepares the vendored OpenAPI document for oapi-codegen.
Command specprep prepares the vendored OpenAPI document for oapi-codegen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL