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 ¶
- Constants
- Variables
- func IsSideEffecting(operationID string) bool
- func Ptr[T any](v T) *T
- func SideEffectingOperations() []string
- type AIService
- type APIError
- type AuthenticationError
- type ChineseService
- func (s *ChineseService) Bazi(ctx context.Context, body api.BaziRequest, opts ...RequestOption) (*api.BaziChartResponse, error)
- func (s *ChineseService) BaziDictionary(ctx context.Context, params *api.V1ChineseBaziDictionaryParams, ...) (*api.BaziDictionaryResponse, error)
- func (s *ChineseService) BaziFlow(ctx context.Context, body api.BaziFlowRequest, opts ...RequestOption) (*api.BaziFlowResponse, error)
- func (s *ChineseService) BaziHealth(ctx context.Context, body api.BaziHealthRequest, opts ...RequestOption) (*api.BaziHealthResponse, error)
- func (s *ChineseService) BaziLifespan(ctx context.Context, body api.BaziLifespanRequest, opts ...RequestOption) (*api.BaziLifespanResponse, error)
- func (s *ChineseService) BaziSynastry(ctx context.Context, body api.BaziSynastryRequest, opts ...RequestOption) (*api.BaziSynastryResponse, error)
- func (s *ChineseService) BaziTimeCorrection(ctx context.Context, body api.BaziTimeCorrectionRequest, opts ...RequestOption) (*api.BaziTimeCorrectionResponse, error)
- func (s *ChineseService) Calendar(ctx context.Context, date api.Date, params *api.V1ChineseCalendarDateParams, ...) (*api.ChineseCalendarResponse, error)
- func (s *ChineseService) Today(ctx context.Context, params *api.V1ChineseTodayParams, opts ...RequestOption) (*api.ChineseTodayResponse, error)
- type Client
- type ConflictError
- type Content
- type DecodeError
- type EphemerisService
- type GeoService
- type HTTPDoer
- type HoroscopeDailyService
- func (s *HoroscopeDailyService) Bulk(ctx context.Context, params *api.V1HoroscopeDailyBulkParams, ...) (*api.HoroscopeDailyBulkResponse, error)
- func (s *HoroscopeDailyService) Personal(ctx context.Context, body api.PersonalHoroscopeRequestV3, ...) (*api.HoroscopeDailyPersonalV3Response, error)
- func (s *HoroscopeDailyService) PersonalV1(ctx context.Context, body api.PersonalHoroscopeRequestV1, ...) (*api.HoroscopeDailyPersonalResponse, error)
- func (s *HoroscopeDailyService) PersonalV2(ctx context.Context, body api.PersonalHoroscopeRequestV2, ...) (*api.HoroscopeDailyPersonalV2Response, error)
- func (s *HoroscopeDailyService) Sign(ctx context.Context, params *api.V3HoroscopeDailySignParams, ...) (*api.HoroscopeDailySignV3Response, error)
- func (s *HoroscopeDailyService) SignV1(ctx context.Context, params *api.V1HoroscopeDailySignParams, ...) (*api.HoroscopeDailySignResponse, error)
- func (s *HoroscopeDailyService) SignV2(ctx context.Context, params *api.V2HoroscopeDailySignParams, ...) (*api.HoroscopeDailySignV2Response, error)
- type HoroscopeService
- type HoroscopeWeeklyService
- type MoonService
- type NatalExperimentalService
- type NatalService
- func (s *NatalService) Calculate(ctx context.Context, params *api.V1NatalCalculateParams, ...) (*api.NatalCalculateResponse, error)
- func (s *NatalService) Chart(ctx context.Context, body api.ExperimentalNatalChartRequest, ...) (*Content, error)
- func (s *NatalService) ChartComposite(ctx context.Context, body api.ExperimentalCompositeChartRequest, ...) (*Content, error)
- func (s *NatalService) ChartProgressions(ctx context.Context, body api.ExperimentalSecondaryProgressionsChartRequest, ...) (*Content, error)
- func (s *NatalService) ChartSecondaryProgressions(ctx context.Context, body api.ExperimentalSecondaryProgressionsChartRequest, ...) (*Content, error)
- func (s *NatalService) ChartSolarReturn(ctx context.Context, body api.ExperimentalSolarReturnChartRequest, ...) (*Content, error)
- func (s *NatalService) ChartSynastry(ctx context.Context, body api.ExperimentalSynastryChartRequest, ...) (*Content, error)
- func (s *NatalService) ChartTransits(ctx context.Context, body api.ExperimentalTransitChartRequest, ...) (*Content, error)
- func (s *NatalService) Report(ctx context.Context, jobID string, params *api.V1NatalReportJobIDParams, ...) (*api.PsychologicalReportJobResponse, error)
- func (s *NatalService) ReportCredits(ctx context.Context, opts ...RequestOption) (*api.ReportCreditsResponse, error)
- func (s *NatalService) ReportRaw(ctx context.Context, jobID string, params *api.V1NatalReportJobIDParams, ...) (*Content, error)
- func (s *NatalService) Simple(ctx context.Context, body api.SimpleNatalRequest, opts ...RequestOption) (*api.SimpleNatalResponse, error)
- type NetworkError
- type NotFoundError
- type NumerologyService
- func (s *NumerologyService) Alphabets(ctx context.Context, opts ...RequestOption) (*api.NumerologyAlphabetsResponse, error)
- func (s *NumerologyService) Methods(ctx context.Context, opts ...RequestOption) (*api.NumerologyMethodsResponse, error)
- func (s *NumerologyService) Profile(ctx context.Context, body api.NumerologyProfileRequest, opts ...RequestOption) (*api.NumerologyProfileResponse, error)
- type OperationInfo
- type Option
- func WithAPIKey(key string) Option
- func WithBaseURL(baseURL string) Option
- func WithHTTPClient(client HTTPDoer) Option
- func WithHeader(key, value string) Option
- func WithMaxRetries(n int) Option
- func WithRetryDelay(base, max time.Duration) Option
- func WithTimeout(timeout time.Duration) Option
- func WithUserAgent(product string) Option
- type PermissionError
- type RateLimitError
- type RequestOption
- func WithIdempotencyKey(key string) RequestOption
- func WithRawResponse(dst **http.Response) RequestOption
- func WithRequestHeader(key, value string) RequestOption
- func WithRequestMaxRetries(n int) RequestOption
- func WithRequestTimeout(timeout time.Duration) RequestOption
- func WithRetry(enabled bool) RequestOption
- type ServerError
- type SkyEventsService
- type SpaceService
- type TimeoutError
- type TransitsService
- type ValidationError
- type VedicGocharService
- func (s *VedicGocharService) Timeline(ctx context.Context, body api.GocharTimelineRequest, opts ...RequestOption) (*api.GocharTimelineV2Response, error)
- func (s *VedicGocharService) TimelineInsights(ctx context.Context, body api.GocharTimelineRequest, opts ...RequestOption) (*api.VedicGocharTimelineInsightsV2Response, error)
- func (s *VedicGocharService) TimelineInsightsV1(ctx context.Context, body api.VedicGocharTimelineRequest, ...) (*api.VedicGocharTimelineInsightsResponse, error)
- func (s *VedicGocharService) TimelineV1(ctx context.Context, body api.VedicGocharTimelineRequest, ...) (*api.VedicGocharTimelineResponse, error)
- type VedicHoroscopeService
- func (s *VedicHoroscopeService) DailyBulk(ctx context.Context, params *api.V2VedicHoroscopeDailyBulkParams, ...) (*api.DailyRashifalBulkResponse, error)
- func (s *VedicHoroscopeService) DailyPersonal(ctx context.Context, body api.DailyVedicHoroscopeRequest, ...) (*api.DailyVedicHoroscopeV2Response, error)
- func (s *VedicHoroscopeService) DailySign(ctx context.Context, params *api.V2VedicHoroscopeDailySignParams, ...) (*api.DailyRashifalSignResponse, error)
- type VedicMuhuratService
- func (s *VedicMuhuratService) PersonalizedSearch(ctx context.Context, body api.VedicMuhuratPersonalizedSearchRequest, ...) (*api.VedicMuhuratSearchResponse, error)
- func (s *VedicMuhuratService) Search(ctx context.Context, body api.VedicMuhuratSearchRequest, opts ...RequestOption) (*api.VedicMuhuratSearchResponse, error)
- type VedicService
- func (s *VedicService) Batch(ctx context.Context, body api.VedicBatchRequest, opts ...RequestOption) (*api.VedicBatchResponse, error)
- func (s *VedicService) Calculate(ctx context.Context, body api.CalculateRequest, opts ...RequestOption) (*api.CalculateV2Response, error)
- func (s *VedicService) CalculateV1(ctx context.Context, body api.VedicChartRequest, opts ...RequestOption) (*api.VedicCalculateResponse, error)
- func (s *VedicService) Chart(ctx context.Context, body api.ChartRequest, opts ...RequestOption) (*api.ChartV2Response, error)
- func (s *VedicService) ChartV1(ctx context.Context, body api.BaseChartRequestV1, opts ...RequestOption) (*api.VedicChartResponse, error)
- func (s *VedicService) Chat(ctx context.Context, params *api.V2VedicChatParams, body api.VedicChatRequest, ...) (*api.VedicChatResponse, error)
- func (s *VedicService) Compatibility(ctx context.Context, body api.CompatibilityV2Request, opts ...RequestOption) (*api.CompatibilityV2Response, error)
- func (s *VedicService) CompatibilityV1(ctx context.Context, body api.CompatibilityRequest, opts ...RequestOption) (*api.VedicCompatibilityResponse, error)
- func (s *VedicService) Dasha(ctx context.Context, body api.DashaRequestV2, opts ...RequestOption) (*api.DashaV2Response, error)
- func (s *VedicService) DashaInsights(ctx context.Context, body api.DashaRequestV2, opts ...RequestOption) (*api.VedicDashaInsightsResponse, error)
- func (s *VedicService) DashaInsightsV1(ctx context.Context, body api.DashaRequestV1, opts ...RequestOption) (*api.VedicDashaInsightsResponse, error)
- func (s *VedicService) DashaV1(ctx context.Context, body api.DashaRequestV1, opts ...RequestOption) (*api.VedicDashaResponse, error)
- func (s *VedicService) KP(ctx context.Context, body api.KPChartRequest, opts ...RequestOption) (*api.KPChartResponse, error)
- func (s *VedicService) KPRender(ctx context.Context, body api.KPChartRenderRequest, opts ...RequestOption) (*Content, error)
- func (s *VedicService) Match(ctx context.Context, body api.MatchV2Request, opts ...RequestOption) (*api.CompatibilityV2Response, error)
- func (s *VedicService) MatchV1(ctx context.Context, body api.MatchRequest, opts ...RequestOption) (*api.VedicMatchResponse, error)
- func (s *VedicService) Panchang(ctx context.Context, body api.PanchangRequestV2, opts ...RequestOption) (*api.PanchangV2Response, error)
- func (s *VedicService) PanchangV1(ctx context.Context, body api.PanchangRequestV1, opts ...RequestOption) (*api.VedicPanchangResponse, error)
- func (s *VedicService) QA(ctx context.Context, body api.VedicQARequest, opts ...RequestOption) (*api.VedicQAResponse, error)
- func (s *VedicService) Strength(ctx context.Context, body api.BaseChartRequestV2, opts ...RequestOption) (*api.StrengthV2Response, error)
- func (s *VedicService) StrengthV1(ctx context.Context, body api.BaseChartRequestV1, opts ...RequestOption) (*api.VedicStrengthResponse, error)
- func (s *VedicService) Vargas(ctx context.Context, body api.VargasRequest, opts ...RequestOption) (*api.VargasV2Response, error)
- func (s *VedicService) VargasV1(ctx context.Context, body api.VargaRequest, opts ...RequestOption) (*api.VedicVargasResponse, error)
- func (s *VedicService) Yogas(ctx context.Context, body api.BaseChartRequestV2, opts ...RequestOption) (*api.YogasV2Response, error)
- func (s *VedicService) YogasV1(ctx context.Context, body api.BaseChartRequestV1, opts ...RequestOption) (*api.VedicYogasResponse, error)
- type VedicTransitsService
- type VedicVisualService
- type WesternAstrocartographyService
- func (s *WesternAstrocartographyService) CityCheck(ctx context.Context, body api.AstrocartographyCityCheckRequest, ...) (*api.AstrocartographyCityCheckResponse, error)
- func (s *WesternAstrocartographyService) Lines(ctx context.Context, body api.AstrocartographyLinesRequest, ...) (*api.AstrocartographyLinesResponse, error)
- func (s *WesternAstrocartographyService) Parans(ctx context.Context, body api.AstrocartographyParansRequest, ...) (*api.AstrocartographyParansResponse, error)
- func (s *WesternAstrocartographyService) Recommendations(ctx context.Context, body api.AstrocartographyRecommendationsRequest, ...) (*api.AstrocartographyRecommendationsResponse, error)
- func (s *WesternAstrocartographyService) Relocation(ctx context.Context, body api.AstrocartographyRelocationRequest, ...) (*api.AstrocartographyRelocationResponse, error)
- type WesternChartSimilarityService
- type WesternDirectionsService
- func (s *WesternDirectionsService) Primary(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsResponse, error)
- func (s *WesternDirectionsService) PrimaryCalendar(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsCalendarResponse, error)
- func (s *WesternDirectionsService) PrimaryExactAspects(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsResponse, error)
- func (s *WesternDirectionsService) PrimarySearch(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsResponse, error)
- type WesternElectionalService
- func (s *WesternElectionalService) InvestMoneySearch(ctx context.Context, body api.InvestMoneyElectionSearchRequest, ...) (*api.InvestMoneyElectionSearchResponse, error)
- func (s *WesternElectionalService) JobAuditionSearch(ctx context.Context, body api.JobAuditionElectionSearchRequest, ...) (*api.JobAuditionElectionSearchResponse, error)
- func (s *WesternElectionalService) LegalProceedingsSearch(ctx context.Context, body api.LegalProceedingsElectionSearchRequest, ...) (*api.LegalProceedingsElectionSearchResponse, error)
- func (s *WesternElectionalService) MakingContractsSearch(ctx context.Context, body api.MakingContractsElectionSearchRequest, ...) (*api.MakingContractsElectionSearchResponse, error)
- func (s *WesternElectionalService) MoveIntoNewHomeSearch(ctx context.Context, body api.MoveIntoNewHomeElectionSearchRequest, ...) (*api.MoveIntoNewHomeElectionSearchResponse, error)
- func (s *WesternElectionalService) PhysicalExaminationSearch(ctx context.Context, body api.PhysicalExaminationElectionSearchRequest, ...) (*api.PhysicalExaminationElectionSearchResponse, error)
- func (s *WesternElectionalService) PurchaseCarSearch(ctx context.Context, body api.PurchaseCarElectionSearchRequest, ...) (*api.PurchaseCarElectionSearchResponse, error)
- func (s *WesternElectionalService) PurchasePropertySearch(ctx context.Context, body api.PurchasePropertyElectionSearchRequest, ...) (*api.PurchasePropertyElectionSearchResponse, error)
- func (s *WesternElectionalService) StartingJourneySearch(ctx context.Context, body api.StartingJourneyElectionSearchRequest, ...) (*api.StartingJourneyElectionSearchResponse, error)
- func (s *WesternElectionalService) WeddingSearch(ctx context.Context, body api.WeddingElectionSearchRequest, ...) (*api.WeddingElectionSearchResponse, error)
- type WesternNatalService
- func (s *WesternNatalService) Insights(ctx context.Context, body api.NatalInsightsRequest, opts ...RequestOption) (*api.NatalInsightsResponse, error)
- func (s *WesternNatalService) InsightsIndexDocuments(ctx context.Context, body api.NatalInsightsRequest, opts ...RequestOption) (*api.NatalInsightsIndexDocumentsResponse, error)
- type WesternProfectionsService
- type WesternProgressionsService
- func (s *WesternProgressionsService) ConverseSecondary(ctx context.Context, params *api.V1WesternProgressionsConverseSecondaryParams, ...) (*api.V1WesternProgressionsConverseSecondary200JSONResponseBody, error)
- func (s *WesternProgressionsService) ConverseSecondaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, ...) (*api.ProgressionCalendarResponse, error)
- func (s *WesternProgressionsService) ConverseSecondaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
- func (s *WesternProgressionsService) ConverseSecondaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
- func (s *WesternProgressionsService) Quaternary(ctx context.Context, params *api.V1WesternProgressionsQuaternaryParams, ...) (*api.V1WesternProgressionsQuaternary200JSONResponseBody, error)
- func (s *WesternProgressionsService) QuaternaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, ...) (*api.ProgressionCalendarResponse, error)
- func (s *WesternProgressionsService) QuaternaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
- func (s *WesternProgressionsService) QuaternaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
- func (s *WesternProgressionsService) Quotidian(ctx context.Context, params *api.V1WesternProgressionsQuotidianParams, ...) (*api.V1WesternProgressionsQuotidian200JSONResponseBody, error)
- func (s *WesternProgressionsService) QuotidianCalendar(ctx context.Context, body api.ProgressionCalendarRequest, ...) (*api.ProgressionCalendarResponse, error)
- func (s *WesternProgressionsService) QuotidianExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
- func (s *WesternProgressionsService) QuotidianExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
- func (s *WesternProgressionsService) Secondary(ctx context.Context, params *api.V1WesternProgressionsSecondaryParams, ...) (*api.V1WesternProgressionsSecondary200JSONResponseBody, error)
- func (s *WesternProgressionsService) SecondaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, ...) (*api.ProgressionCalendarResponse, error)
- func (s *WesternProgressionsService) SecondaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
- func (s *WesternProgressionsService) SecondaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
- func (s *WesternProgressionsService) Tertiary(ctx context.Context, params *api.V1WesternProgressionsTertiaryParams, ...) (*api.V1WesternProgressionsTertiary200JSONResponseBody, error)
- func (s *WesternProgressionsService) TertiaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, ...) (*api.ProgressionCalendarResponse, error)
- func (s *WesternProgressionsService) TertiaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
- func (s *WesternProgressionsService) TertiaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
- type WesternReturnsService
- type WesternService
- func (s *WesternService) Chat(ctx context.Context, params *api.V2WesternChatParams, ...) (*api.WesternChatResponse, error)
- func (s *WesternService) Synastry(ctx context.Context, params *api.V2WesternSynastryParams, ...) (*api.SynastryResponse, error)
- func (s *WesternService) SynastryHoroscope(ctx context.Context, params *api.V2WesternSynastryHoroscopeParams, ...) (*api.CouplesHoroscopeV2Response, error)
- func (s *WesternService) SynastryHoroscopeV1(ctx context.Context, params *api.V1WesternSynastryHoroscopeParams, ...) (*api.CouplesHoroscopeResponse, error)
- func (s *WesternService) SynastrySimplified(ctx context.Context, body api.SynastryRequest, opts ...RequestOption) (*api.SynastrySimplifiedResponse, error)
- func (s *WesternService) SynastrySummary(ctx context.Context, body api.SynastryRequest, opts ...RequestOption) (*api.SynastrySummaryResponse, error)
- func (s *WesternService) SynastryV1(ctx context.Context, params *api.V1WesternSynastryParams, ...) (*api.SynastryResponse, error)
- func (s *WesternService) Synastrycards(ctx context.Context, params *api.V2WesternSynastrycardsParams, ...) (*api.SynastryCardsResponse, error)
- func (s *WesternService) SynastrycardsV1(ctx context.Context, params *api.V1WesternSynastrycardsParams, ...) (*api.SynastryCardsResponse, error)
- type WesternSignsService
- func (s *WesternSignsService) Midheaven(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
- func (s *WesternSignsService) Moon(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
- func (s *WesternSignsService) Rising(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
- func (s *WesternSignsService) Sun(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
- type WesternSolarService
- type WesternTransitsService
- func (s *WesternTransitsService) Insights(ctx context.Context, body api.TransitTimelineRequest, opts ...RequestOption) (*api.TransitInsightsResponse, error)
- func (s *WesternTransitsService) Search(ctx context.Context, body api.TransitSearchRequest, opts ...RequestOption) (*api.TransitSearchResponse, error)
- func (s *WesternTransitsService) Timeline(ctx context.Context, body api.TransitTimelineRequest, opts ...RequestOption) (*api.TransitTimelineResponse, error)
- func (s *WesternTransitsService) TimelineIndexDocuments(ctx context.Context, body api.TransitTimelineRequest, opts ...RequestOption) (*api.TransitTimelineIndexDocumentsResponse, error)
Examples ¶
Constants ¶
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" )
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).
const Version = "0.1.0"
Version is the SDK version, sent in the User-Agent header as freeastroapi-go/<Version>.
Variables ¶
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 ¶
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 ¶
func (s *AIService) Generate(ctx context.Context, body api.AtomicReportRequest, opts ...RequestOption) (*api.AtomicReportResponse, error)
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)
}
}
Output:
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 ¶
func (s *ChineseService) Bazi(ctx context.Context, body api.BaziRequest, opts ...RequestOption) (*api.BaziChartResponse, error)
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 ¶
func (s *ChineseService) BaziDictionary(ctx context.Context, params *api.V1ChineseBaziDictionaryParams, opts ...RequestOption) (*api.BaziDictionaryResponse, error)
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 ¶
func (s *ChineseService) BaziFlow(ctx context.Context, body api.BaziFlowRequest, opts ...RequestOption) (*api.BaziFlowResponse, error)
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 ¶
func (s *ChineseService) BaziHealth(ctx context.Context, body api.BaziHealthRequest, opts ...RequestOption) (*api.BaziHealthResponse, error)
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 ¶
func (s *ChineseService) BaziLifespan(ctx context.Context, body api.BaziLifespanRequest, opts ...RequestOption) (*api.BaziLifespanResponse, error)
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 ¶
func (s *ChineseService) BaziSynastry(ctx context.Context, body api.BaziSynastryRequest, opts ...RequestOption) (*api.BaziSynastryResponse, error)
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 ¶
func (s *ChineseService) BaziTimeCorrection(ctx context.Context, body api.BaziTimeCorrectionRequest, opts ...RequestOption) (*api.BaziTimeCorrectionResponse, error)
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 ¶
func (s *ChineseService) Calendar(ctx context.Context, date api.Date, params *api.V1ChineseCalendarDateParams, opts ...RequestOption) (*api.ChineseCalendarResponse, error)
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 ¶
func (s *ChineseService) Today(ctx context.Context, params *api.V1ChineseTodayParams, opts ...RequestOption) (*api.ChineseTodayResponse, error)
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 ¶
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
}
Output:
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 ¶
DecodeJSON decodes a JSON body into v.
type DecodeError ¶
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 ¶
func (s *EphemerisService) Calculate(ctx context.Context, body api.EphemerisRequest, opts ...RequestOption) (*api.EphemerisResponse, error)
Calculate calls POST /api/v1/ephemeris/calculate (operation v1_ephemeris_calculate).
Calculate Ephemeris.
func (*EphemerisService) Get ¶
func (s *EphemerisService) Get(ctx context.Context, params *api.V1EphemerisParams, opts ...RequestOption) (*api.EphemerisResponse, error)
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 ¶
func (s *GeoService) Search(ctx context.Context, params *api.V2GeoSearchParams, opts ...RequestOption) (*api.CitySearchResponse, error)
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)
}
}
Output:
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 HoroscopeDailyService ¶
type HoroscopeDailyService struct {
// contains filtered or unexported fields
}
HoroscopeDailyService calls the /horoscope/daily operations. Use it through Client.Horoscope.Daily.
func (*HoroscopeDailyService) Bulk ¶
func (s *HoroscopeDailyService) Bulk(ctx context.Context, params *api.V1HoroscopeDailyBulkParams, opts ...RequestOption) (*api.HoroscopeDailyBulkResponse, error)
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 ¶
func (s *HoroscopeDailyService) Personal(ctx context.Context, body api.PersonalHoroscopeRequestV3, opts ...RequestOption) (*api.HoroscopeDailyPersonalV3Response, error)
Personal calls POST /api/v3/horoscope/daily/personal (operation v3_horoscope_daily_personal).
Get Personal Horoscope.
func (*HoroscopeDailyService) PersonalV1 ¶
func (s *HoroscopeDailyService) PersonalV1(ctx context.Context, body api.PersonalHoroscopeRequestV1, opts ...RequestOption) (*api.HoroscopeDailyPersonalResponse, error)
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 ¶
func (s *HoroscopeDailyService) PersonalV2(ctx context.Context, body api.PersonalHoroscopeRequestV2, opts ...RequestOption) (*api.HoroscopeDailyPersonalV2Response, error)
PersonalV2 calls POST /api/v2/horoscope/daily/personal (operation v2_horoscope_daily_personal).
Get Personal Horoscope.
func (*HoroscopeDailyService) Sign ¶
func (s *HoroscopeDailyService) Sign(ctx context.Context, params *api.V3HoroscopeDailySignParams, opts ...RequestOption) (*api.HoroscopeDailySignV3Response, error)
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 ¶
func (s *HoroscopeDailyService) SignV1(ctx context.Context, params *api.V1HoroscopeDailySignParams, opts ...RequestOption) (*api.HoroscopeDailySignResponse, error)
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 ¶
func (s *HoroscopeDailyService) SignV2(ctx context.Context, params *api.V2HoroscopeDailySignParams, opts ...RequestOption) (*api.HoroscopeDailySignV2Response, error)
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 ¶
func (s *HoroscopeWeeklyService) Personal(ctx context.Context, body api.WeeklyPersonalHoroscopeRequest, opts ...RequestOption) (*api.HoroscopeWeeklyPersonalV3Response, error)
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 ¶
func (s *MoonService) Month(ctx context.Context, params *api.V1MoonMonthParams, opts ...RequestOption) (*api.MoonMonthResponse, error)
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 ¶
func (s *MoonService) Phase(ctx context.Context, params *api.V1MoonPhaseParams, opts ...RequestOption) (*api.MoonPhaseResponse, error)
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
func (s *NatalExperimentalService) SolarReturn(ctx context.Context, body api.ExperimentalSolarReturnChartRequest, opts ...RequestOption) (*Content, error)
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
func (s *NatalExperimentalService) Transits(ctx context.Context, body api.ExperimentalTransitChartRequest, opts ...RequestOption) (*Content, error)
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 ¶
func (s *NatalService) Calculate(ctx context.Context, params *api.V1NatalCalculateParams, body api.NatalChartRequest, opts ...RequestOption) (*api.NatalCalculateResponse, error)
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)
}
}
}
Output:
func (*NatalService) Chart ¶
func (s *NatalService) Chart(ctx context.Context, body api.ExperimentalNatalChartRequest, opts ...RequestOption) (*Content, error)
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 ¶
func (s *NatalService) ChartProgressions(ctx context.Context, body api.ExperimentalSecondaryProgressionsChartRequest, opts ...RequestOption) (*Content, error)
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 ¶
func (s *NatalService) ChartSynastry(ctx context.Context, body api.ExperimentalSynastryChartRequest, opts ...RequestOption) (*Content, error)
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 ¶
func (s *NatalService) Report(ctx context.Context, jobID string, params *api.V1NatalReportJobIDParams, opts ...RequestOption) (*api.PsychologicalReportJobResponse, error)
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 ¶
func (s *NatalService) Simple(ctx context.Context, body api.SimpleNatalRequest, opts ...RequestOption) (*api.SimpleNatalResponse, error)
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 ¶
func (s *NumerologyService) Alphabets(ctx context.Context, opts ...RequestOption) (*api.NumerologyAlphabetsResponse, error)
Alphabets calls GET /api/v1/numerology/alphabets (operation v1_numerology_alphabets).
List immutable numerology alphabet and Gematria tables.
func (*NumerologyService) Methods ¶
func (s *NumerologyService) Methods(ctx context.Context, opts ...RequestOption) (*api.NumerologyMethodsResponse, error)
Methods calls GET /api/v1/numerology/methods (operation v1_numerology_methods).
List supported numerology methods and policies.
func (*NumerologyService) Profile ¶
func (s *NumerologyService) Profile(ctx context.Context, body api.NumerologyProfileRequest, opts ...RequestOption) (*api.NumerologyProfileResponse, error)
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 ¶
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 ¶
WithBaseURL overrides the server URL (default https://api.freeastroapi.com).
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client used to send requests (default: a new http.Client). Use it to configure proxies, transports or instrumentation.
func WithHeader ¶
WithHeader adds a header to every request.
func WithMaxRetries ¶
WithMaxRetries sets how many times a retryable request is retried after the first attempt (default 2). Zero disables retries.
func WithRetryDelay ¶
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 ¶
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 ¶
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)
}
Output:
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 ¶
func (s *SkyEventsService) List(ctx context.Context, params *api.V1SkyEventsParams, opts ...RequestOption) (*api.SkyEventsResponse, error)
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 ¶
func (s *SpaceService) Chart(ctx context.Context, body api.SpaceChartRequest, opts ...RequestOption) (*api.SpaceChartResponse, error)
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 ¶
func (s *TransitsService) Calculate(ctx context.Context, params *api.V1TransitsCalculateParams, body api.TransitRequest, opts ...RequestOption) (*api.TransitsCalculateResponse, error)
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 ¶
func (s *VedicGocharService) Timeline(ctx context.Context, body api.GocharTimelineRequest, opts ...RequestOption) (*api.GocharTimelineV2Response, error)
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 ¶
func (s *VedicGocharService) TimelineInsights(ctx context.Context, body api.GocharTimelineRequest, opts ...RequestOption) (*api.VedicGocharTimelineInsightsV2Response, error)
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 ¶
func (s *VedicGocharService) TimelineInsightsV1(ctx context.Context, body api.VedicGocharTimelineRequest, opts ...RequestOption) (*api.VedicGocharTimelineInsightsResponse, error)
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 ¶
func (s *VedicGocharService) TimelineV1(ctx context.Context, body api.VedicGocharTimelineRequest, opts ...RequestOption) (*api.VedicGocharTimelineResponse, error)
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 ¶
func (s *VedicHoroscopeService) DailyBulk(ctx context.Context, params *api.V2VedicHoroscopeDailyBulkParams, opts ...RequestOption) (*api.DailyRashifalBulkResponse, error)
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 ¶
func (s *VedicHoroscopeService) DailyPersonal(ctx context.Context, body api.DailyVedicHoroscopeRequest, opts ...RequestOption) (*api.DailyVedicHoroscopeV2Response, error)
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 ¶
func (s *VedicHoroscopeService) DailySign(ctx context.Context, params *api.V2VedicHoroscopeDailySignParams, opts ...RequestOption) (*api.DailyRashifalSignResponse, error)
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 ¶
func (s *VedicMuhuratService) PersonalizedSearch(ctx context.Context, body api.VedicMuhuratPersonalizedSearchRequest, opts ...RequestOption) (*api.VedicMuhuratSearchResponse, error)
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 ¶
func (s *VedicMuhuratService) Search(ctx context.Context, body api.VedicMuhuratSearchRequest, opts ...RequestOption) (*api.VedicMuhuratSearchResponse, error)
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 ¶
func (s *VedicService) Batch(ctx context.Context, body api.VedicBatchRequest, opts ...RequestOption) (*api.VedicBatchResponse, error)
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 ¶
func (s *VedicService) Calculate(ctx context.Context, body api.CalculateRequest, opts ...RequestOption) (*api.CalculateV2Response, error)
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 ¶
func (s *VedicService) CalculateV1(ctx context.Context, body api.VedicChartRequest, opts ...RequestOption) (*api.VedicCalculateResponse, error)
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 ¶
func (s *VedicService) Chart(ctx context.Context, body api.ChartRequest, opts ...RequestOption) (*api.ChartV2Response, error)
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 ¶
func (s *VedicService) ChartV1(ctx context.Context, body api.BaseChartRequestV1, opts ...RequestOption) (*api.VedicChartResponse, error)
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 ¶
func (s *VedicService) Chat(ctx context.Context, params *api.V2VedicChatParams, body api.VedicChatRequest, opts ...RequestOption) (*api.VedicChatResponse, error)
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 ¶
func (s *VedicService) Compatibility(ctx context.Context, body api.CompatibilityV2Request, opts ...RequestOption) (*api.CompatibilityV2Response, error)
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 ¶
func (s *VedicService) CompatibilityV1(ctx context.Context, body api.CompatibilityRequest, opts ...RequestOption) (*api.VedicCompatibilityResponse, error)
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 ¶
func (s *VedicService) Dasha(ctx context.Context, body api.DashaRequestV2, opts ...RequestOption) (*api.DashaV2Response, error)
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 ¶
func (s *VedicService) DashaInsights(ctx context.Context, body api.DashaRequestV2, opts ...RequestOption) (*api.VedicDashaInsightsResponse, error)
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 ¶
func (s *VedicService) DashaV1(ctx context.Context, body api.DashaRequestV1, opts ...RequestOption) (*api.VedicDashaResponse, error)
DashaV1 calls POST /api/v1/vedic/dasha (operation v1_vedic_dasha).
Get Dasha.
Get Vimshottari Dasha timeline only.
func (*VedicService) KP ¶
func (s *VedicService) KP(ctx context.Context, body api.KPChartRequest, opts ...RequestOption) (*api.KPChartResponse, error)
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)
}
}
Output:
func (*VedicService) Match ¶
func (s *VedicService) Match(ctx context.Context, body api.MatchV2Request, opts ...RequestOption) (*api.CompatibilityV2Response, error)
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 ¶
func (s *VedicService) MatchV1(ctx context.Context, body api.MatchRequest, opts ...RequestOption) (*api.VedicMatchResponse, error)
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 ¶
func (s *VedicService) Panchang(ctx context.Context, body api.PanchangRequestV2, opts ...RequestOption) (*api.PanchangV2Response, error)
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)
}
Output:
func (*VedicService) PanchangV1 ¶
func (s *VedicService) PanchangV1(ctx context.Context, body api.PanchangRequestV1, opts ...RequestOption) (*api.VedicPanchangResponse, error)
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 ¶
func (s *VedicService) QA(ctx context.Context, body api.VedicQARequest, opts ...RequestOption) (*api.VedicQAResponse, error)
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 ¶
func (s *VedicService) Strength(ctx context.Context, body api.BaseChartRequestV2, opts ...RequestOption) (*api.StrengthV2Response, error)
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 ¶
func (s *VedicService) StrengthV1(ctx context.Context, body api.BaseChartRequestV1, opts ...RequestOption) (*api.VedicStrengthResponse, error)
StrengthV1 calls POST /api/v1/vedic/strength (operation v1_vedic_strength).
Get Strength.
Get planetary strength: Shadbala + Ashtakavarga.
func (*VedicService) Vargas ¶
func (s *VedicService) Vargas(ctx context.Context, body api.VargasRequest, opts ...RequestOption) (*api.VargasV2Response, error)
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 ¶
func (s *VedicService) VargasV1(ctx context.Context, body api.VargaRequest, opts ...RequestOption) (*api.VedicVargasResponse, error)
VargasV1 calls POST /api/v1/vedic/vargas (operation v1_vedic_vargas).
Get Vargas.
Get divisional chart positions (D1, D9, D10, etc).
func (*VedicService) Yogas ¶
func (s *VedicService) Yogas(ctx context.Context, body api.BaseChartRequestV2, opts ...RequestOption) (*api.YogasV2Response, error)
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 ¶
func (s *VedicService) YogasV1(ctx context.Context, body api.BaseChartRequestV1, opts ...RequestOption) (*api.VedicYogasResponse, error)
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 ¶
func (s *VedicTransitsService) Insights(ctx context.Context, body api.VedicTransitInsightsRequest, opts ...RequestOption) (*api.VedicTransitInsightsResponse, error)
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 ¶
func (s *VedicVisualService) Chart(ctx context.Context, body api.VedicVisualChartRequest, opts ...RequestOption) (*Content, error)
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 ¶
func (s *WesternAstrocartographyService) CityCheck(ctx context.Context, body api.AstrocartographyCityCheckRequest, opts ...RequestOption) (*api.AstrocartographyCityCheckResponse, error)
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 ¶
func (s *WesternAstrocartographyService) Lines(ctx context.Context, body api.AstrocartographyLinesRequest, opts ...RequestOption) (*api.AstrocartographyLinesResponse, error)
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 ¶
func (s *WesternAstrocartographyService) Parans(ctx context.Context, body api.AstrocartographyParansRequest, opts ...RequestOption) (*api.AstrocartographyParansResponse, error)
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 ¶
func (s *WesternAstrocartographyService) Recommendations(ctx context.Context, body api.AstrocartographyRecommendationsRequest, opts ...RequestOption) (*api.AstrocartographyRecommendationsResponse, error)
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 ¶
func (s *WesternAstrocartographyService) Relocation(ctx context.Context, body api.AstrocartographyRelocationRequest, opts ...RequestOption) (*api.AstrocartographyRelocationResponse, error)
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 ¶
func (s *WesternChartSimilarityService) FamousPeople(ctx context.Context, body api.FamousPeopleChartSimilarityRequest, opts ...RequestOption) (*api.ChartSimilarityResponse, error)
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 ¶
func (s *WesternDirectionsService) Primary(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsResponse, error)
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 ¶
func (s *WesternDirectionsService) PrimaryCalendar(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsCalendarResponse, error)
PrimaryCalendar calls POST /api/v1/western/directions/primary/calendar (operation v1_western_directions_primary_calendar).
Get Primary Directions Calendar.
func (*WesternDirectionsService) PrimaryExactAspects ¶
func (s *WesternDirectionsService) PrimaryExactAspects(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsResponse, error)
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 ¶
func (s *WesternDirectionsService) PrimarySearch(ctx context.Context, body api.PrimaryDirectionsRequest, opts ...RequestOption) (*api.PrimaryDirectionsResponse, error)
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 ¶
func (s *WesternElectionalService) InvestMoneySearch(ctx context.Context, body api.InvestMoneyElectionSearchRequest, opts ...RequestOption) (*api.InvestMoneyElectionSearchResponse, error)
InvestMoneySearch calls POST /api/v2/western/electional/invest-money/search (operation v2_western_electional_invest_money_search).
Search Invest Money Elections.
func (*WesternElectionalService) JobAuditionSearch ¶
func (s *WesternElectionalService) JobAuditionSearch(ctx context.Context, body api.JobAuditionElectionSearchRequest, opts ...RequestOption) (*api.JobAuditionElectionSearchResponse, error)
JobAuditionSearch calls POST /api/v2/western/electional/job-audition/search (operation v2_western_electional_job_audition_search).
Search Job Audition Elections.
func (*WesternElectionalService) LegalProceedingsSearch ¶
func (s *WesternElectionalService) LegalProceedingsSearch(ctx context.Context, body api.LegalProceedingsElectionSearchRequest, opts ...RequestOption) (*api.LegalProceedingsElectionSearchResponse, error)
LegalProceedingsSearch calls POST /api/v2/western/electional/legal-proceedings/search (operation v2_western_electional_legal_proceedings_search).
Search Legal Proceedings Elections.
func (*WesternElectionalService) MakingContractsSearch ¶
func (s *WesternElectionalService) MakingContractsSearch(ctx context.Context, body api.MakingContractsElectionSearchRequest, opts ...RequestOption) (*api.MakingContractsElectionSearchResponse, error)
MakingContractsSearch calls POST /api/v2/western/electional/making-contracts/search (operation v2_western_electional_making_contracts_search).
Search Making Contracts Elections.
func (*WesternElectionalService) MoveIntoNewHomeSearch ¶
func (s *WesternElectionalService) MoveIntoNewHomeSearch(ctx context.Context, body api.MoveIntoNewHomeElectionSearchRequest, opts ...RequestOption) (*api.MoveIntoNewHomeElectionSearchResponse, error)
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 ¶
func (s *WesternElectionalService) PhysicalExaminationSearch(ctx context.Context, body api.PhysicalExaminationElectionSearchRequest, opts ...RequestOption) (*api.PhysicalExaminationElectionSearchResponse, error)
PhysicalExaminationSearch calls POST /api/v2/western/electional/physical-examination/search (operation v2_western_electional_physical_examination_search).
Search Physical Examination Elections.
func (*WesternElectionalService) PurchaseCarSearch ¶
func (s *WesternElectionalService) PurchaseCarSearch(ctx context.Context, body api.PurchaseCarElectionSearchRequest, opts ...RequestOption) (*api.PurchaseCarElectionSearchResponse, error)
PurchaseCarSearch calls POST /api/v2/western/electional/purchase-car/search (operation v2_western_electional_purchase_car_search).
Search Purchase Car Elections.
func (*WesternElectionalService) PurchasePropertySearch ¶
func (s *WesternElectionalService) PurchasePropertySearch(ctx context.Context, body api.PurchasePropertyElectionSearchRequest, opts ...RequestOption) (*api.PurchasePropertyElectionSearchResponse, error)
PurchasePropertySearch calls POST /api/v2/western/electional/purchase-property/search (operation v2_western_electional_purchase_property_search).
Search Purchase Property Elections.
func (*WesternElectionalService) StartingJourneySearch ¶
func (s *WesternElectionalService) StartingJourneySearch(ctx context.Context, body api.StartingJourneyElectionSearchRequest, opts ...RequestOption) (*api.StartingJourneyElectionSearchResponse, error)
StartingJourneySearch calls POST /api/v2/western/electional/starting-journey/search (operation v2_western_electional_starting_journey_search).
Search Starting Journey Elections.
func (*WesternElectionalService) WeddingSearch ¶
func (s *WesternElectionalService) WeddingSearch(ctx context.Context, body api.WeddingElectionSearchRequest, opts ...RequestOption) (*api.WeddingElectionSearchResponse, error)
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 ¶
func (s *WesternNatalService) Insights(ctx context.Context, body api.NatalInsightsRequest, opts ...RequestOption) (*api.NatalInsightsResponse, error)
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 ¶
func (s *WesternNatalService) InsightsIndexDocuments(ctx context.Context, body api.NatalInsightsRequest, opts ...RequestOption) (*api.NatalInsightsIndexDocumentsResponse, error)
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 ¶
func (s *WesternProfectionsService) Annual(ctx context.Context, params *api.V1WesternProfectionsAnnualParams, body api.AnnualProfectionRequest, opts ...RequestOption) (*api.AnnualProfectionResponse, error)
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 ¶
func (s *WesternProgressionsService) ConverseSecondary(ctx context.Context, params *api.V1WesternProgressionsConverseSecondaryParams, body api.ConverseSecondaryProgressionsRequest, opts ...RequestOption) (*api.V1WesternProgressionsConverseSecondary200JSONResponseBody, error)
ConverseSecondary calls POST /api/v1/western/progressions/converse-secondary (operation v1_western_progressions_converse_secondary).
Get Converse Secondary Progressions.
func (*WesternProgressionsService) ConverseSecondaryCalendar ¶
func (s *WesternProgressionsService) ConverseSecondaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, opts ...RequestOption) (*api.ProgressionCalendarResponse, error)
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 ¶
func (s *WesternProgressionsService) ConverseSecondaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
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 ¶
func (s *WesternProgressionsService) ConverseSecondaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
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 ¶
func (s *WesternProgressionsService) Quaternary(ctx context.Context, params *api.V1WesternProgressionsQuaternaryParams, body api.QuaternaryProgressionsRequest, opts ...RequestOption) (*api.V1WesternProgressionsQuaternary200JSONResponseBody, error)
Quaternary calls POST /api/v1/western/progressions/quaternary (operation v1_western_progressions_quaternary).
Get Quaternary Progressions.
func (*WesternProgressionsService) QuaternaryCalendar ¶
func (s *WesternProgressionsService) QuaternaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, opts ...RequestOption) (*api.ProgressionCalendarResponse, error)
QuaternaryCalendar calls POST /api/v1/western/progressions/quaternary/calendar (operation v1_western_progressions_quaternary_calendar).
Get Quaternary Progressions Calendar.
func (*WesternProgressionsService) QuaternaryExactAspects ¶
func (s *WesternProgressionsService) QuaternaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
QuaternaryExactAspects calls POST /api/v1/western/progressions/quaternary/exact-aspects (operation v1_western_progressions_quaternary_exact_aspects).
Search Quaternary Exact Aspects.
func (*WesternProgressionsService) QuaternaryExactIngresses ¶
func (s *WesternProgressionsService) QuaternaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
QuaternaryExactIngresses calls POST /api/v1/western/progressions/quaternary/exact-ingresses (operation v1_western_progressions_quaternary_exact_ingresses).
Search Quaternary Exact Ingresses.
func (*WesternProgressionsService) Quotidian ¶
func (s *WesternProgressionsService) Quotidian(ctx context.Context, params *api.V1WesternProgressionsQuotidianParams, body api.QuotidianProgressionsRequest, opts ...RequestOption) (*api.V1WesternProgressionsQuotidian200JSONResponseBody, error)
Quotidian calls POST /api/v1/western/progressions/quotidian (operation v1_western_progressions_quotidian).
Get Quotidian Progressions.
func (*WesternProgressionsService) QuotidianCalendar ¶
func (s *WesternProgressionsService) QuotidianCalendar(ctx context.Context, body api.ProgressionCalendarRequest, opts ...RequestOption) (*api.ProgressionCalendarResponse, error)
QuotidianCalendar calls POST /api/v1/western/progressions/quotidian/calendar (operation v1_western_progressions_quotidian_calendar).
Get Quotidian Progressions Calendar.
func (*WesternProgressionsService) QuotidianExactAspects ¶
func (s *WesternProgressionsService) QuotidianExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
QuotidianExactAspects calls POST /api/v1/western/progressions/quotidian/exact-aspects (operation v1_western_progressions_quotidian_exact_aspects).
Search Quotidian Exact Aspects.
func (*WesternProgressionsService) QuotidianExactIngresses ¶
func (s *WesternProgressionsService) QuotidianExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
QuotidianExactIngresses calls POST /api/v1/western/progressions/quotidian/exact-ingresses (operation v1_western_progressions_quotidian_exact_ingresses).
Search Quotidian Exact Ingresses.
func (*WesternProgressionsService) Secondary ¶
func (s *WesternProgressionsService) Secondary(ctx context.Context, params *api.V1WesternProgressionsSecondaryParams, body api.SecondaryProgressionsRequest, opts ...RequestOption) (*api.V1WesternProgressionsSecondary200JSONResponseBody, error)
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 ¶
func (s *WesternProgressionsService) SecondaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, opts ...RequestOption) (*api.ProgressionCalendarResponse, error)
SecondaryCalendar calls POST /api/v1/western/progressions/secondary/calendar (operation v1_western_progressions_secondary_calendar).
Get Secondary Progressions Calendar.
func (*WesternProgressionsService) SecondaryExactAspects ¶
func (s *WesternProgressionsService) SecondaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
SecondaryExactAspects calls POST /api/v1/western/progressions/secondary/exact-aspects (operation v1_western_progressions_secondary_exact_aspects).
Search Secondary Exact Aspects.
func (*WesternProgressionsService) SecondaryExactIngresses ¶
func (s *WesternProgressionsService) SecondaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
SecondaryExactIngresses calls POST /api/v1/western/progressions/secondary/exact-ingresses (operation v1_western_progressions_secondary_exact_ingresses).
Search Secondary Exact Ingresses.
func (*WesternProgressionsService) Tertiary ¶
func (s *WesternProgressionsService) Tertiary(ctx context.Context, params *api.V1WesternProgressionsTertiaryParams, body api.TertiaryProgressionsRequest, opts ...RequestOption) (*api.V1WesternProgressionsTertiary200JSONResponseBody, error)
Tertiary calls POST /api/v1/western/progressions/tertiary (operation v1_western_progressions_tertiary).
Get Tertiary Progressions.
func (*WesternProgressionsService) TertiaryCalendar ¶
func (s *WesternProgressionsService) TertiaryCalendar(ctx context.Context, body api.ProgressionCalendarRequest, opts ...RequestOption) (*api.ProgressionCalendarResponse, error)
TertiaryCalendar calls POST /api/v1/western/progressions/tertiary/calendar (operation v1_western_progressions_tertiary_calendar).
Get Tertiary Progressions Calendar.
func (*WesternProgressionsService) TertiaryExactAspects ¶
func (s *WesternProgressionsService) TertiaryExactAspects(ctx context.Context, body api.ExactAspectSearchRequest, opts ...RequestOption) (*api.ExactAspectSearchResponse, error)
TertiaryExactAspects calls POST /api/v1/western/progressions/tertiary/exact-aspects (operation v1_western_progressions_tertiary_exact_aspects).
Search Tertiary Exact Aspects.
func (*WesternProgressionsService) TertiaryExactIngresses ¶
func (s *WesternProgressionsService) TertiaryExactIngresses(ctx context.Context, body api.ExactIngressSearchRequest, opts ...RequestOption) (*api.ExactIngressSearchResponse, error)
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 ¶
func (s *WesternReturnsService) Calculate(ctx context.Context, body api.PlanetReturnRequest, opts ...RequestOption) (*api.PlanetReturnResponse, error)
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 ¶
func (s *WesternService) Chat(ctx context.Context, params *api.V2WesternChatParams, body api.WesternChatRequest, opts ...RequestOption) (*api.WesternChatResponse, error)
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 ¶
func (s *WesternService) Synastry(ctx context.Context, params *api.V2WesternSynastryParams, body api.SynastryRequest, opts ...RequestOption) (*api.SynastryResponse, error)
Synastry calls POST /api/v2/western/synastry (operation v2_western_synastry).
Get Synastry V2.
func (*WesternService) SynastryHoroscope ¶
func (s *WesternService) SynastryHoroscope(ctx context.Context, params *api.V2WesternSynastryHoroscopeParams, body api.CouplesHoroscopeV2Request, opts ...RequestOption) (*api.CouplesHoroscopeV2Response, error)
SynastryHoroscope calls POST /api/v2/western/synastry/horoscope (operation v2_western_synastry_horoscope).
Get Couples Horoscope V2.
func (*WesternService) SynastryHoroscopeV1 ¶
func (s *WesternService) SynastryHoroscopeV1(ctx context.Context, params *api.V1WesternSynastryHoroscopeParams, body api.CouplesHoroscopeRequest, opts ...RequestOption) (*api.CouplesHoroscopeResponse, error)
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 ¶
func (s *WesternService) SynastryV1(ctx context.Context, params *api.V1WesternSynastryParams, body api.SynastryRequest, opts ...RequestOption) (*api.SynastryResponse, error)
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 ¶
func (s *WesternService) Synastrycards(ctx context.Context, params *api.V2WesternSynastrycardsParams, body api.SynastryRequest, opts ...RequestOption) (*api.SynastryCardsResponse, error)
Synastrycards calls POST /api/v2/western/synastrycards (operation v2_western_synastrycards).
Get Synastry Cards V2.
func (*WesternService) SynastrycardsV1 ¶
func (s *WesternService) SynastrycardsV1(ctx context.Context, params *api.V1WesternSynastrycardsParams, body api.SynastryRequest, opts ...RequestOption) (*api.SynastryCardsResponse, error)
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 ¶
func (s *WesternSignsService) Midheaven(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
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 ¶
func (s *WesternSignsService) Moon(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
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 ¶
func (s *WesternSignsService) Rising(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
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 ¶
func (s *WesternSignsService) Sun(ctx context.Context, body api.NatalChartRequest, opts ...RequestOption) (*api.SignResponse, error)
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 ¶
func (s *WesternSolarService) Calculate(ctx context.Context, body api.SolarReturnRequest, opts ...RequestOption) (*api.SolarReturnResponse, error)
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 ¶
func (s *WesternTransitsService) Insights(ctx context.Context, body api.TransitTimelineRequest, opts ...RequestOption) (*api.TransitInsightsResponse, error)
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 ¶
func (s *WesternTransitsService) Search(ctx context.Context, body api.TransitSearchRequest, opts ...RequestOption) (*api.TransitSearchResponse, error)
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 ¶
func (s *WesternTransitsService) Timeline(ctx context.Context, body api.TransitTimelineRequest, opts ...RequestOption) (*api.TransitTimelineResponse, error)
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 ¶
func (s *WesternTransitsService) TimelineIndexDocuments(ctx context.Context, body api.TransitTimelineRequest, opts ...RequestOption) (*api.TransitTimelineIndexDocumentsResponse, error)
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.
Source Files
¶
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. |