Hi, I am Rosie. I can show you a live reading, or get readings onto your site or app today.
Astrology npm and Python packages for your app
Official RoxyAPI SDKs for TypeScript, Python, PHP, C#, Go, Rust, and Dart give your app methods for natal charts, compatibility readings, forecasts and the rest of the catalog, all based on the published OpenAPI request contract. Use this guide to resolve a birthplace, call a chart endpoint and handle its response in your server code. The WordPress plugin adds Gutenberg blocks and shortcodes for sites built in a page editor.
- TypeScript:
@roxyapi/sdkon npm - Python:
roxy-sdkon PyPI - PHP:
roxyapi/sdkon Packagist (PHP 8.2+) - C# / .NET:
RoxyApi.Sdkon NuGet (.NET 8+ and netstandard2.0, so it also runs on .NET Framework, Unity, and MAUI) - Go:
github.com/RoxyAPI/sdk-goon pkg.go.dev (Go 1.24+, one direct runtime dependency, standard librarynet/http) - Rust:
roxyapion crates.io (Rust 1.88+, async on Tokio) - Dart / Flutter:
roxyapion pub.dev (Dart 3.9+, every Flutter platform, one runtime dependency,package:http) - WordPress: RoxyAPI plugin on the WordPress.org Plugin Directory
- UI components:
@roxyapi/ui,@roxyapi/ui-react, and@roxyapi/ui-vueon npm. MIT licensed web components for charts, tables, cards, and forms across every domain. Setup walkthrough at /docs/ui (Next.js, vanilla HTML, shadcn). Catalog and live customizer at /ui.
Install
npm install @roxyapi/sdk
# or
bun add @roxyapi/sdk
pnpm add @roxyapi/sdk
yarn add @roxyapi/sdkpip install roxy-sdk
# or
uv add roxy-sdk
poetry add roxy-sdkcomposer require roxyapi/sdkdotnet add package RoxyApi.Sdkgo get github.com/RoxyAPI/sdk-gocargo add roxyapi
cargo add tokio --features macros,rt-multi-threadThe Tokio features above enable standalone async examples. An existing async service can use its current runtime. Run the snippets below inside an async function with use roxyapi::types; and the initialized roxy client from the quick start.
dart pub add roxyapi
# or, in a Flutter app
flutter pub add roxyapiRun the snippets below inside an async function with import 'package:roxyapi/roxyapi.dart'; and the roxy client from the quick start. In Flutter code, import the package as roxy: Flutter also defines Card, Size, Theme and Element.
In WordPress admin: Plugins → Add New → search RoxyAPI → Install Now → Activate. The plugin adds its own top-level RoxyAPI menu; open RoxyAPI → Settings to paste your API key. Full integration guide at /docs/integrations/wordpress. Prefer the latest unreleased code? Grab roxyapi.zip from GitHub Releases and upload via Plugins → Add New → Upload Plugin.
Quick start
Initialize the client once and reuse it across calls. Each SDK configures the API base URL and request credentials.
import { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);
// Daily horoscope
const { data } = await roxy.astrology.getDailyHoroscope({
path: { sign: 'aries' },
});
// Numerology life path
const { data: lp } = await roxy.numerology.calculateLifePath({
body: { year: 1990, month: 1, day: 15 },
});
// Tarot Celtic Cross spread
const { data: reading } = await roxy.tarot.castCelticCross({
body: { question: 'What should I focus on this month?' },
});from roxy_sdk import create_roxy
roxy = create_roxy("your-api-key")
# Daily horoscope
horoscope = roxy.astrology.get_daily_horoscope(sign="aries")
# Numerology life path
lp = roxy.numerology.calculate_life_path(year=1990, month=1, day=15)
# Tarot Celtic Cross spread
reading = roxy.tarot.cast_celtic_cross(question="What should I focus on this month?")<?php
use function RoxyAPI\Sdk\createRoxy;
$roxy = createRoxy(getenv('ROXY_API_KEY'));
// Daily horoscope
$horoscope = $roxy->astrology->getDailyHoroscope(sign: 'aries');
// Numerology life path
$lp = $roxy->numerology->calculateLifePath(year: 1990, month: 1, day: 15);
// Tarot Celtic Cross spread
$reading = $roxy->tarot->castCelticCross(question: 'What should I focus on this month?');using RoxyApi;
var roxy = new RoxyClient(Environment.GetEnvironmentVariable("ROXY_API_KEY")!);
// Daily horoscope
var horoscope = await roxy.Astrology.Horoscope["aries"].Daily.GetAsync();
// Numerology life path
var lp = await roxy.Numerology.LifePath.PostAsync(new() { Year = 1990, Month = 1, Day = 15 });
// Tarot Celtic Cross spread
var reading = await roxy.Tarot.Spreads.CelticCross.PostAsync(new() { Question = "What should I focus on this month?" });import (
"context"
"os"
roxyapi "github.com/RoxyAPI/sdk-go"
)
ctx := context.Background()
roxy, _ := roxyapi.NewRoxy(os.Getenv("ROXY_API_KEY"))
// Daily horoscope (path param positional, optional params pointer)
horoscope, _ := roxy.Astrology.GetDailyHoroscope(ctx, "aries", nil)
// Numerology life path (plain ints)
lp, _ := roxy.Numerology.CalculateLifePath(ctx, nil, roxyapi.CalculateLifePathJSONRequestBody{Year: 1990, Month: 1, Day: 15})
// Tarot Celtic Cross spread (optional fields via roxyapi.Ptr)
reading, _ := roxy.Tarot.CastCelticCross(ctx, nil, roxyapi.CastCelticCrossJSONRequestBody{Question: roxyapi.Ptr("What should I focus on this month?")})Go exposes the same domains as PascalCase services on the value returned by NewRoxy (roxy.Astrology, roxy.VedicAstrology). Each method mirrors the operation id with context first and the optional query-params struct as a nilable pointer: roxy.Astrology.GetDailyHoroscope(ctx, "aries", nil). Read the parsed body from resp.JSON200; any 4xx/5xx comes back as a *roxyapi.RoxyError (switch on .Code). Build date fields with roxyapi.Date(...) and optional fields with roxyapi.Ptr(...).
use roxyapi::{Roxy, types};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let roxy = Roxy::new(std::env::var("ROXY_API_KEY")?)?;
let places = roxy
.location()
.search_cities(&types::SearchCitiesParams::new(
"London, United Kingdom".into(),
))
.await?;
let city = places.cities.first().ok_or("No matching city")?;
let birth = types::NatalChartRequest::new(
"1990-01-15".into(),
"14:30:00".into(),
city.latitude,
city.longitude,
types::NatalChartRequestTimezone::String(city.timezone.clone()),
);
let chart = roxy
.astrology()
.generate_natal_chart(&Default::default(), &birth)
.await?;
println!("Ascendant: {}", chart.ascendant.sign);
Ok(())
}import 'dart:io';
import 'package:roxyapi/roxyapi.dart';
Future<void> main() async {
final roxy = Roxy(Platform.environment['ROXY_API_KEY'] ?? '');
final places = await roxy.location.searchCities(q: 'London, United Kingdom');
final city = places.cities.first;
final chart = await roxy.astrology.generateNatalChart(
date: '1990-01-15',
time: '14:30:00',
latitude: city.latitude,
longitude: city.longitude,
timezone: NumOrString.string(city.timezone),
);
print('Ascendant: ${chart.ascendant.sign}');
roxy.close();
}Never expose your secret API key in client-side code. Call RoxyAPI from your server, API routes, serverless functions, or background workers only.
Authentication
Pass your API key on initialization. Get your API key, delivered instantly after checkout.
import { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);import os
from roxy_sdk import create_roxy
roxy = create_roxy(os.environ["ROXY_API_KEY"])<?php
use function RoxyAPI\Sdk\createRoxy;
$roxy = createRoxy(getenv('ROXY_API_KEY'));using Microsoft.Kiota.Abstractions; // Date and Time
using RoxyApi;
var roxy = new RoxyClient(Environment.GetEnvironmentVariable("ROXY_API_KEY")!);C# exposes the same domains as PascalCase request-builder properties on the client: roxy.Astrology, roxy.VedicAstrology, roxy.AngelNumbers, and so on. Path parameters are indexers (roxy.Astrology.Horoscope["aries"].Daily), POST bodies use a target-typed new() { ... }, and calls throw a typed RoxyError on failure. A status the endpoint does not declare, such as a gateway error, throws the base ApiException from Microsoft.Kiota.Abstractions instead, so catch that too.
use roxyapi::Roxy;
let roxy = Roxy::new(std::env::var("ROXY_API_KEY")?)?;Rust uses snake_case namespace methods and operation names, such as roxy.vedic_astrology().generate_birth_chart(...). Request and response types live in roxyapi::types. Pass a borrowed parameter struct, then a typed body for POST operations. The Rust API docs and bundled AGENTS.md list every signature.
import 'dart:io';
import 'package:roxyapi/roxyapi.dart';
final roxy = Roxy(Platform.environment['ROXY_API_KEY'] ?? '');Dart takes named arguments, path, body and query fields side by side, such as roxy.vedicAstrology.generateBirthChart(date: ..., time: ..., latitude: ..., longitude: ...). Fixed value sets are enums (Sign.aries, Lang.es) and every response is a typed view over its JSON. The package docs on pub.dev and bundled AGENTS.md list every signature.
Domains
Each domain is a namespace on the roxy instance.
| Namespace (TS / PHP) | Namespace (Python) | What it covers |
|---|---|---|
roxy.astrology / $roxy->astrology | roxy.astrology | Western astrology: natal charts, horoscopes, synastry, transits, moon phases |
roxy.vedicAstrology / $roxy->vedicAstrology | roxy.vedic_astrology | Vedic / Jyotish: kundli, panchang, dashas, nakshatras, doshas, KP system |
roxy.numerology / $roxy->numerology | roxy.numerology | Life path, expression, soul urge, personal year, karmic lessons |
roxy.tarot / $roxy->tarot | roxy.tarot | Daily card, custom draws, three-card, Celtic Cross, yes / no, love spread |
roxy.humanDesign / $roxy->humanDesign | roxy.human_design | Human Design: bodygraph, type, authority, profile, centers, channels, gates, connection chart |
roxy.forecast / $roxy->forecast | roxy.forecast | Cross-domain forecast: transit timelines, significant dates, merged Western, Vedic, and biorhythm events |
roxy.chineseAstrology / $roxy->chineseAstrology | roxy.chinese_astrology | Chinese astrology: BaZi four pillars, Day Master strength, luck pillars, zodiac animals, lunisolar calendar, Tong Shu almanac |
roxy.fengShui / $roxy->fengShui | roxy.feng_shui | Feng shui: Kua number, Eight Mansions directions, flying star charts, annual afflictions, bagua sectors, nine-period cycle |
roxy.biorhythm / $roxy->biorhythm | roxy.biorhythm | Daily check-in, multi-day forecast, critical days, compatibility |
roxy.iching / $roxy->iching | roxy.iching | Daily hexagram, three-coin cast, 64 hexagrams, trigrams |
roxy.crystals / $roxy->crystals | roxy.crystals | Crystal meanings, zodiac / chakra pairings, birthstone, search |
roxy.dreams / $roxy->dreams | roxy.dreams | Dream symbol dictionary, interpretations |
roxy.angelNumbers / $roxy->angelNumbers | roxy.angel_numbers | Number meanings, universal digit-root lookup, daily |
roxy.location / $roxy->location | roxy.location | City search for birth chart coordinates |
roxy.usage / $roxy->usage | roxy.usage | API usage stats, remaining quota, subscription info |
Location first
Every chart, horoscope, panchang, dasha, dosha, navamsa, KP, synastry, compatibility, and natal endpoint needs latitude, longitude, and a timezone. Call the location API first, then feed the result into the chart method.
The location response is a pagination envelope. Each city has both an IANA timezone string and a decimal utcOffset. Pass the IANA string as timezone: chart endpoints resolve it to the offset in force on the birth date. utcOffset is the offset in effect today, so it is wrong for any birth on the other side of a daylight saving change.
const { data, error } = await roxy.location.searchCities({
query: { q: 'London, UK' },
});
if (error) throw error;
// Response: { total, limit, offset, cities: [...] }
const { latitude, longitude, timezone } = data.cities[0];
const { data: chart } = await roxy.vedicAstrology.generateBirthChart({
body: {
date: '1990-01-15',
time: '14:30:00',
latitude,
longitude,
timezone, // IANA string like "Europe/London". Server resolves DST for the chart date
},
});result = roxy.location.search_cities(q="London, UK")
# Response: { "total", "limit", "offset", "cities": [...] }
city = result["cities"][0]
chart = roxy.vedic_astrology.generate_birth_chart(
date="1990-01-15", time="14:30:00",
latitude=city["latitude"], longitude=city["longitude"],
timezone=city["timezone"], # IANA string; server resolves DST for the chart date
)$result = $roxy->location->searchCities(q: 'London, UK');
// Response carries total, limit, offset, cities
$city = $result['cities'][0];
$chart = $roxy->vedicAstrology->generateBirthChart(
date: '1990-01-15',
time: '14:30:00',
latitude: $city['latitude'],
longitude: $city['longitude'],
timezone: $city['timezone'], // IANA string; server resolves DST for the chart date
);var result = await roxy.Location.Search.GetAsync(c => c.QueryParameters.Q = "London, UK");
// result.Cities holds the matches; the envelope also carries pagination fields
var city = result!.Cities![0];
var chart = await roxy.VedicAstrology.BirthChart.PostAsync(new()
{
Date = new Date(1990, 1, 15),
Time = new Time(14, 30, 0),
Latitude = city.Latitude,
Longitude = city.Longitude,
Timezone = new() { String = city.Timezone }, // IANA string; server resolves DST for the chart date
});let places = roxy.location().search_cities(&types::SearchCitiesParams::new(
"London, United Kingdom".into(),
)).await?;
let city = places.cities.first().ok_or("No matching city")?;
let birth = types::NatalChartRequest::new(
"1990-01-15".into(), "14:30:00".into(), city.latitude, city.longitude,
types::NatalChartRequestTimezone::String(city.timezone.clone()),
);
let chart = roxy.astrology().generate_natal_chart(&Default::default(), &birth).await?;
println!("Ascendant: {}", chart.ascendant.sign);final places = await roxy.location.searchCities(q: 'London, United Kingdom');
final city = places.cities.first;
final chart = await roxy.astrology.generateNatalChart(
date: '1990-01-15',
time: '14:30:00',
latitude: city.latitude,
longitude: city.longitude,
timezone: NumOrString.string(city.timezone),
);
print('Ascendant: ${chart.ascendant.sign}');Chart endpoints accept timezone as either a decimal number (-5 for EST, 1 for CET, 9 for Tokyo) or an IANA identifier ("America/New_York", "Europe/London"). IANA strings are resolved server-side to the DST-correct offset for the request date, so a January 1990 New York birth gets EST (-5) even when you geocoded the city in July. The utcOffset field on the Location response is a convenience decimal if you prefer numbers. Both forms produce identical charts.
Examples
Daily horoscope
const { data, error } = await roxy.astrology.getDailyHoroscope({
path: { sign: 'scorpio' },
});
if (error) {
console.error(error);
} else {
console.log(data.overview); // General daily forecast
console.log(data.love); // Love and relationship forecast
console.log(data.career); // Career outlook
}horoscope = roxy.astrology.get_daily_horoscope(sign="scorpio")
print(horoscope["overview"]) # General daily forecast
print(horoscope["love"]) # Love and relationship forecast
print(horoscope["career"]) # Career outlook$horoscope = $roxy->astrology->getDailyHoroscope(sign: 'scorpio');
echo $horoscope['overview']; // General daily forecast
echo $horoscope['love']; // Love and relationship forecast
echo $horoscope['career']; // Career outlookvar horoscope = await roxy.Astrology.Horoscope["scorpio"].Daily.GetAsync();
Console.WriteLine(horoscope!.Overview); // General daily forecast
Console.WriteLine(horoscope.Love); // Love and relationship forecast
Console.WriteLine(horoscope.Career); // Career outlooklet horoscope = roxy.astrology().get_daily_horoscope(
&types::GetDailyHoroscopeParams::new(types::GetDailyHoroscopeParamsSign::Scorpio),
).await?;
println!("{}\n{}\n{}", horoscope.overview, horoscope.love, horoscope.career);final horoscope = await roxy.astrology.getDailyHoroscope(sign: Sign.scorpio);
print('${horoscope.overview}\n${horoscope.love}\n${horoscope.career}');Numerology life path
const { data, error } = await roxy.numerology.calculateLifePath({
body: { year: 1990, month: 1, day: 15 },
});
if (error) throw error;
console.log(data.number); // e.g. 7
console.log(data.type); // "single" | "master"result = roxy.numerology.calculate_life_path(year=1990, month=1, day=15)
print(result["number"]) # e.g. 7
print(result["type"]) # "single" | "master"$result = $roxy->numerology->calculateLifePath(year: 1990, month: 1, day: 15);
echo $result['number']; // e.g. 7
echo $result['type']; // "single" | "master"var result = await roxy.Numerology.LifePath.PostAsync(new() { Year = 1990, Month = 1, Day = 15 });
Console.WriteLine(result!.Number); // e.g. 7
Console.WriteLine(result.Type); // "single" | "master"let result = roxy.numerology().calculate_life_path(
&Default::default(),
&types::CalculateLifePathRequest::new(1990, 1, 15),
).await?;
println!("{} ({})", result.number, result.r#type);final result = await roxy.numerology.calculateLifePath(year: 1990, month: 1, day: 15);
print('${result.number} (${result.type})');Vedic birth chart
The response groups planets by the rashi (sign) they occupy. Each rashi has a signs[] array (planets in that rashi, often empty) plus a top-level meta dict with every planet keyed by name.
const { data, error } = await roxy.vedicAstrology.generateBirthChart({
body: {
date: '1990-01-15',
time: '14:30:00',
latitude: 40.7128,
longitude: -74.006,
timezone: -5,
},
});
if (error) throw error;
// Iterate rashis (aries..pisces) for the 12-sign chart
for (const rashi of ['aries', 'taurus', 'gemini'] as const) {
console.log(rashi, data[rashi].signs); // planets in this rashi
}
// Or look up any planet directly
console.log(data.meta.Sun.rashi); // "Capricorn"
console.log(data.meta.Moon.nakshatra.name); // nakshatra namechart = roxy.vedic_astrology.generate_birth_chart(
date="1990-01-15", time="14:30:00",
latitude=40.7128, longitude=-74.006, timezone="America/New_York",
)
# Iterate rashis for the 12-sign chart
for rashi in ["aries", "taurus", "gemini"]:
print(rashi, chart[rashi]["signs"])
# Or look up any planet directly
print(chart["meta"]["Sun"]["rashi"]) # "Capricorn"
print(chart["meta"]["Moon"]["nakshatra"]["name"]) # nakshatra name$chart = $roxy->vedicAstrology->generateBirthChart(
date: '1990-01-15',
time: '14:30:00',
latitude: 40.7128,
longitude: -74.006,
timezone: -5,
);
// Iterate rashis for the 12-sign chart
foreach (['aries', 'taurus', 'gemini'] as $rashi) {
echo $rashi, count($chart[$rashi]['signs']); // planets in this rashi
}
// Or look up any planet directly
echo $chart['meta']['Sun']['rashi']; // "Capricorn"
echo $chart['meta']['Moon']['nakshatra']['name']; // nakshatra namevar chart = await roxy.VedicAstrology.BirthChart.PostAsync(new()
{
Date = new Date(1990, 1, 15),
Time = new Time(14, 30, 0),
Latitude = 40.7128,
Longitude = -74.006,
Timezone = new() { Double = -5 },
});
// Planets, rashis, and meta are on the typed response - explore via IntelliSenselet birth = types::BirthChartRequest::new(
"1990-01-15".into(), "14:30:00".into(), 40.7128, -74.006,
).with_timezone(types::BirthChartRequestTimezone::String("America/New_York".into()));
let chart = roxy.vedic_astrology().generate_birth_chart(&Default::default(), &birth).await?;
let moon = chart.meta.additional_properties.get("Moon").ok_or("Missing Moon")?;
println!("{}", moon.nakshatra.name);final chart = await roxy.vedicAstrology.generateBirthChart(
date: '1990-01-15',
time: '14:30:00',
latitude: 40.7128,
longitude: -74.006,
timezone: const NumOrString.string('America/New_York'),
);
print(chart.meta['Moon']?.nakshatra.name);Western natal chart
const { data, error } = await roxy.astrology.generateNatalChart({
body: {
date: '1990-01-15',
time: '14:30:00',
latitude: 40.7128,
longitude: -74.006,
timezone: -5,
},
});
if (error) throw error;
console.log(data.planets.length); // planets, the lunar nodes and Chiron
console.log(data.houses.length); // 12
console.log(data.ascendant.sign); // ascendant zodiac sign
console.log(data.midheaven.sign); // midheaven zodiac signnatal = roxy.astrology.generate_natal_chart(
date="1990-01-15", time="14:30:00",
latitude=40.7128, longitude=-74.006, timezone="America/New_York",
)
print(len(natal["planets"])) # planets, the lunar nodes and Chiron
print(len(natal["houses"])) # 12
print(natal["ascendant"]["sign"]) # ascendant zodiac sign
print(natal["midheaven"]["sign"]) # midheaven zodiac sign$natal = $roxy->astrology->generateNatalChart(
date: '1990-01-15',
time: '14:30:00',
latitude: 40.7128,
longitude: -74.006,
timezone: -5,
);
echo count($natal['planets']); // planets, the lunar nodes and Chiron
echo count($natal['houses']); // 12
echo $natal['ascendant']['sign']; // ascendant zodiac sign
echo $natal['midheaven']['sign']; // midheaven zodiac signvar natal = await roxy.Astrology.NatalChart.PostAsync(new()
{
Date = new Date(1990, 1, 15),
Time = new Time(14, 30, 0),
Latitude = 40.7128,
Longitude = -74.006,
Timezone = new() { Double = -5 },
});
Console.WriteLine(natal!.Planets!.Count); // planets, the lunar nodes and Chiron
Console.WriteLine(natal.Houses!.Count); // 12
Console.WriteLine(natal.Ascendant!.Sign); // ascendant zodiac sign
Console.WriteLine(natal.Midheaven!.Sign); // midheaven zodiac signlet birth = types::NatalChartRequest::new(
"1990-01-15".into(), "14:30:00".into(), 40.7128, -74.006,
types::NatalChartRequestTimezone::String("America/New_York".into()),
);
let natal = roxy.astrology().generate_natal_chart(&Default::default(), &birth).await?;
println!("{} planets, {} houses", natal.planets.len(), natal.houses.len());
println!("{} / {}", natal.ascendant.sign, natal.midheaven.sign);final natal = await roxy.astrology.generateNatalChart(
date: '1990-01-15',
time: '14:30:00',
latitude: 40.7128,
longitude: -74.006,
timezone: const NumOrString.string('America/New_York'),
);
print('${natal.planets.length} planets, ${natal.houses.length} houses');
print('${natal.ascendant.sign} / ${natal.midheaven.sign}');Tarot daily card
const { data, error } = await roxy.tarot.getDailyCard({ body: { seed: 'user-123' } });
if (error) throw error;
console.log(data.card.name); // e.g. "The Star"
console.log(data.dailyMessage); // concise daily guidance
console.log(data.card.meaning); // full card interpretationcard = roxy.tarot.get_daily_card(seed="user-123")
print(card["card"]["name"]) # e.g. "The Star"
print(card["dailyMessage"]) # concise daily guidance
print(card["card"]["meaning"]) # full card interpretation$card = $roxy->tarot->getDailyCard(seed: 'user-123');
echo $card['card']['name']; // e.g. "The Star"
echo $card['dailyMessage']; // concise daily guidance
echo $card['card']['meaning']; // full card interpretationvar card = await roxy.Tarot.Daily.PostAsync(new() { Seed = "user-123" });
Console.WriteLine(card!.Card!.Name); // e.g. "The Star"
Console.WriteLine(card.DailyMessage); // concise daily guidance
Console.WriteLine(card.Card.Meaning); // full card interpretationlet card = roxy.tarot().get_daily_card(
&Default::default(),
&types::GetDailyCardRequest::new().with_seed("user-123".into()),
).await?;
println!("{}: {}", card.card.name, card.daily_message);
println!("{}", card.card.meaning);final card = await roxy.tarot.getDailyCard(seed: 'user-123');
print('${card.card.name}: ${card.dailyMessage}');
print(card.card.meaning);Angel number lookup
const { data, error } = await roxy.angelNumbers.getAngelNumber({
path: { number: '1111' },
});
if (error) throw error;
console.log(data.coreMessage); // Short divine message summary
console.log(data.meaning.spiritual); // Spiritual interpretation
console.log(data.meaning.love); // Love / relationship meaningresult = roxy.angel_numbers.get_angel_number(number="1111")
print(result["coreMessage"]) # Short divine message summary
print(result["meaning"]["spiritual"]) # Spiritual interpretation
print(result["meaning"]["love"]) # Love / relationship meaning$result = $roxy->angelNumbers->getAngelNumber(number: '1111');
echo $result['coreMessage']; // Short divine message summary
echo $result['meaning']['spiritual']; // Spiritual interpretation
echo $result['meaning']['love']; // Love / relationship meaningvar angel = await roxy.AngelNumbers.Numbers["1111"].GetAsync();
Console.WriteLine(angel!.CoreMessage); // Short divine message summary
Console.WriteLine(angel.Meaning!.Spiritual); // Spiritual interpretation
Console.WriteLine(angel.Meaning.Love); // Love / relationship meaninglet result = roxy.angel_numbers().get_angel_number(
&types::GetAngelNumberParams::new("1111".into()),
).await?;
println!("{}", result.core_message);
println!("{}\n{}", result.meaning.spiritual, result.meaning.love);final result = await roxy.angelNumbers.getAngelNumber(number: '1111');
print(result.coreMessage);
print('${result.meaning.spiritual}\n${result.meaning.love}');Check usage
const { data, error } = await roxy.usage.getUsageStats();
if (error) throw error;
console.log(`${data.usedThisMonth} / ${data.requestsPerMonth} requests used`);stats = roxy.usage.get_usage_stats()
print(f"{stats['usedThisMonth']} / {stats['requestsPerMonth']} requests used")$stats = $roxy->usage->getUsageStats();
echo "{$stats['usedThisMonth']} / {$stats['requestsPerMonth']} requests used";var stats = await roxy.Usage.GetAsync();
Console.WriteLine($"{stats!.UsedThisMonth} / {stats.RequestsPerMonth} requests used");let stats = roxy.usage().get_usage_stats().await?;
println!("{} / {} requests used", stats.used_this_month, stats.requests_per_month);final stats = await roxy.usage.getUsageStats();
print('${stats.usedThisMonth} / ${stats.requestsPerMonth} requests used');Multi-language responses
Interpretations are available in ten languages: English (en), Turkish (tr), German (de), Spanish (es), French (fr), Hindi (hi), Portuguese (pt), Russian (ru), Chinese Simplified (zh-Hans), Chinese Traditional (zh-Hant).
const { data } = await roxy.tarot.getDailyCard({
body: { date: '2026-04-22' },
query: { lang: 'es' },
});card = roxy.tarot.get_daily_card(date="2026-04-22", lang="es")$card = $roxy->tarot->getDailyCard(date: '2026-04-22', lang: 'es');var card = await roxy.Tarot.Daily.PostAsync(
new() { Date = new Date(2026, 4, 22) },
c => c.QueryParameters.Lang = RoxyApi.Tarot.Daily.PostLangQueryParameterType.Es);let card = roxy.tarot().get_daily_card(
&types::GetDailyCardParams::new().with_lang(types::GetDailyCardParamsLang::Es),
&types::GetDailyCardRequest::new().with_date("2026-04-22".into()),
).await?;
println!("{}", card.daily_message);final card = await roxy.tarot.getDailyCard(date: '2026-04-22', lang: Lang.es);
print(card.dailyMessage);Supported: astrology, vedicAstrology / vedic_astrology, forecast, humanDesign / human_design, chineseAstrology / chinese_astrology, fengShui / feng_shui, mesoamericanAstrology / mesoamerican_astrology, vastu, numerology, kabbalah, tarot, biorhythm, ayurveda, iching, crystals, angelNumbers / angel_numbers. English-only: dreams, location, usage.
Async support
// Already async: every method returns a Promise
const { data } = await roxy.astrology.getDailyHoroscope({ path: { sign: 'aries' } });import asyncio
from roxy_sdk import create_roxy
async def main():
roxy = create_roxy("your-api-key")
horoscope = await roxy.astrology.get_daily_horoscope_async(sign="aries")
card = await roxy.tarot.get_daily_card_async()
print(horoscope, card)
asyncio.run(main())Python ships an _async variant for every sync method, for asyncio, FastAPI, or any event loop.
// Each call is synchronous. For concurrent fan-out, use the Saloon pool API
// on the underlying connector (Saloon ships a battle-tested request pool).
$horoscope = $roxy->astrology->getDailyHoroscope(sign: 'aries');
$card = $roxy->tarot->getDailyCard();For concurrent calls, see the PHP SDK README.
// Already async: every method returns a Task
var horoscope = await roxy.Astrology.Horoscope["aries"].Daily.GetAsync();let card = roxy.tarot().get_daily_card(&Default::default(), &Default::default()).await?;
println!("{}", card.daily_message);Rust is async on Tokio. Clone Roxy to share its connection pool across application state or workers, then await calls in your existing async handlers. See the Rust SDK for Axum and Actix Web usage.
final card = await roxy.tarot.getDailyCard();
print(card.dailyMessage);Every Dart call returns a Future. One Roxy reuses its HTTP connections, so create it once and share it across your app or server; call roxy.close() on shutdown.
Error handling
TypeScript returns { data, error, response } per call. Python raises RoxyAPIError. PHP throws RoxyApiException. C# throws RoxyError, or the base ApiException for a status the endpoint does not declare. Go returns (resp, error) where any 4xx/5xx is a *roxyapi.RoxyError. Rust returns Result<T, roxyapi::Error>; an HTTP failure is Error::Api with status, code, error and optional doc_url. Dart throws RoxyException with statusCode, code, message, docUrl and the validation issues. Match the stable code when choosing what to do next: every SDK ships the codes as typed constants, so a typo fails to compile or lint instead of silently never matching.
Every SDK already retries for you, so a catch block never needs a sleep and retry loop. By the time an error reaches your code the retries have run out, or the wait was one a retry should not sit through, such as an exhausted monthly allowance. Each error carries doc_url and the Retry-After wait, under the name each tab shows.
import { createRoxy, ErrorCodes, retryAfterSeconds } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);
const { data, error, response } = await roxy.tarot.castYesNo({
body: { question: 'Should I take this opportunity?' },
});
if (error) {
switch (error.code) {
case ErrorCodes.ValidationError:
console.error('Bad input:', error.error);
break;
case ErrorCodes.RateLimitExceeded:
console.error('Monthly quota reached, resets in', retryAfterSeconds(response), 'seconds');
break;
default:
console.error('API error:', error.code, error.error, error.doc_url);
}
} else {
console.log(data.answer); // "Yes" | "No" | "Maybe"
}ErrorCodes holds every code as a typed constant, and retryAfterSeconds(response) returns the Retry-After wait in seconds, or undefined. Pass { maxRetries: 0 } as the second argument of createRoxy to turn retries off, or maxRetries, initialDelayMs and maxDelayMs to tune them.
from roxy_sdk import create_roxy, ErrorCode, RoxyAPIError
roxy = create_roxy("your-api-key")
try:
result = roxy.tarot.cast_yes_no(question="Should I take this opportunity?")
print(result["answer"]) # "Yes" | "No" | "Maybe"
except RoxyAPIError as e:
if e.code == ErrorCode.VALIDATION_ERROR:
print(f"Bad input: {e.error}")
elif e.code == ErrorCode.RATE_LIMIT_EXCEEDED:
print(f"Monthly quota reached, resets in {e.retry_after} seconds")
else:
print(f"API error: {e.code} {e.error} {e.doc_url}")ErrorCode is a string enum of every code, and e.retry_after is the Retry-After wait in seconds, or None. Pass max_retries=0 to create_roxy to turn retries off, or max_retries, initial_delay and max_delay to tune them.
use RoxyAPI\Sdk\ErrorCode;
use RoxyAPI\Sdk\RoxyApiException;
try {
$result = $roxy->tarot->castYesNo(question: 'Should I take this opportunity?');
echo $result['answer']; // "Yes" | "No" | "Maybe"
} catch (RoxyApiException $e) {
match ($e->code()) {
ErrorCode::ValidationError => fwrite(STDERR, "Bad input: {$e->error}\n"),
ErrorCode::RateLimitExceeded => fwrite(STDERR, "Monthly quota reached, resets in {$e->retryAfter} seconds\n"),
default => fwrite(STDERR, "API error: {$e->errorCode} {$e->error} {$e->docUrl}\n"),
};
}$e->code() returns the ErrorCode case, or null for a code newer than your installed SDK, and $e->retryAfter is the Retry-After wait in whole seconds, or null. Pass new RetryPolicy(maxRetries: 0) (from RoxyAPI\Sdk\Retry) as the second argument of createRoxy to turn retries off, or set maxRetries, initialDelayMs and maxDelayMs to tune them.
using Microsoft.Kiota.Abstractions;
using RoxyApi;
using RoxyApi.Models;
try
{
var answer = await roxy.Tarot.YesNo.PostAsync(new() { Question = "Should I take this opportunity?" });
Console.WriteLine(answer!.Answer); // "Yes" | "No" | "Maybe"
}
catch (RoxyError e)
{
switch (e.Code)
{
case ErrorCodes.ValidationError: Console.Error.WriteLine($"Bad input: {e.Message}"); break;
case ErrorCodes.RateLimitExceeded: Console.Error.WriteLine($"Monthly quota reached, resets in {e.RetryAfter}"); break;
default: Console.Error.WriteLine($"API error: {e.Code} {e.Message} {e.DocUrl}"); break;
}
}
catch (ApiException e)
{
Console.Error.WriteLine($"HTTP {e.ResponseStatusCode}"); // a status the endpoint does not declare
}ErrorCodes holds a constant for every code, and e.RetryAfter is a nullable TimeSpan. Pass a RoxyRetryOptions to the RoxyClient constructor to tune retries, or set MaxRetries = 0 to turn them off.
resp, err := roxy.Tarot.CastYesNo(ctx, nil, roxyapi.CastYesNoJSONRequestBody{
Question: roxyapi.Ptr("Should I take this opportunity?"),
})
var rerr *roxyapi.RoxyError
if errors.As(err, &rerr) {
switch rerr.Code {
case roxyapi.ErrCodeValidationError:
fmt.Println("Bad input:", rerr.Message)
case roxyapi.ErrCodeRateLimitExceeded:
fmt.Println("Monthly quota reached, resets in", rerr.RetryAfter)
default:
fmt.Println("API error:", rerr.Code, rerr.Message, rerr.DocURL)
}
return
}
fmt.Println(resp.JSON200.Answer) // "Yes" | "No" | "Maybe"The roxyapi.ErrCode... constants cover every code, and rerr.RetryAfter is a time.Duration, zero when the response sent no Retry-After. Pass roxyapi.WithMaxRetries(0) to NewRoxy to turn retries off, or roxyapi.WithRetry(roxyapi.RetryConfig{...}) to change the delays.
use roxyapi::{Error, ErrorCode};
let result = roxy.tarot().cast_yes_no(
&Default::default(),
&types::CastYesNoRequest::new().with_question("Should I take this opportunity?".into()),
).await;
match result {
Ok(reading) => println!("{}", reading.answer),
Err(Error::Api(error)) => match error.error_code() {
ErrorCode::ValidationError => eprintln!("Bad input: {}", error.details["issues"]),
ErrorCode::RateLimitExceeded => eprintln!("Monthly quota reached, resets in {:?}", error.retry_after),
_ => eprintln!("API error: {} {} {:?}", error.code, error.error, error.doc_url),
},
Err(error) => return Err(error.into()),
}ErrorCode is an enum of every code, with Other(String) for a code newer than your installed SDK. error.retry_after is an Option<Duration>, error.doc_url an Option<String>, and error.details holds every other body field, such as issues. Pass Roxy::builder(key).retry_policy(RetryPolicy::new(0)).build()? to turn retries off, or RetryPolicy::new(n).with_initial_delay(..).with_max_delay(..) to tune them.
try {
final reading = await roxy.tarot.castYesNo(
question: 'Should I take this opportunity?',
);
print(reading.answer);
} on RoxyException catch (e) {
switch (e.code) {
case ErrorCodes.validationError:
for (final issue in e.issues) {
print('Bad input: ${issue.path} ${issue.message}');
}
case ErrorCodes.rateLimitExceeded:
print('Monthly quota reached, resets in ${e.retryAfter}');
default:
print('API error: ${e.statusCode} ${e.code} ${e.docUrl}');
}
}ErrorCodes holds every code as a constant, and a code newer than your installed SDK arrives as a plain string. e.retryAfter is a Duration? and e.docUrl a String?. Pass Roxy(key, maxRetries: 0) to turn retries off, or maxRetries, initialDelay and maxDelay to tune them.
Retries
Every SDK retries twice by default, with jittered backoff, on 429, 500, 502, 503 and 504 and on a connection that never reached the API, and they honour Retry-After. A wait longer than 30 seconds, which is what an exhausted monthly allowance asks for, is not waited out: the error comes back at once with the wait attached. Setting the retry count to 0 turns retries off.
Retry 429 with code rate_limit_per_minute and 503 with code compute_saturated after the Retry-After seconds. Retry 500 with code internal_error with exponential backoff. A request that fails on our side with a 5xx does not count against your monthly allowance, so retrying it is free. A 429 with code rate_limit_exceeded means the monthly allowance is used up: retrying cannot help before the reset, and Retry-After gives the seconds to it. Fix the request for any other 4xx, because it will fail the same way until it changes. Every official SDK already retries these for you, twice and honouring Retry-After, so a call made through an SDK needs no second retry loop.
Error codes
Every code, the status it arrives with, and what to change for each one is on the error codes page. It is one entry per code, and every failed response carries a doc_url that links directly to its own entry, so an SDK error can be looked up without searching.
The code field is machine-readable and stable, safe to switch on. The error field is human-readable and may change wording.
Type safety
SDK method names and request shapes come from the published OpenAPI contract. TypeScript ships generated .d.ts definitions for editor completion. Each language uses its own response and error pattern, as shown in the examples above. Inspect complete field shapes in the API reference.
// TypeScript knows sign must be one of the 12 zodiac signs
const { data, error } = await roxy.astrology.getDailyHoroscope({
path: { sign: 'aries' }, // autocompletes all 12 options
});
if (error) throw error;
// after the error check, data is typed, no manual casting needed
console.log(data.date); // string
console.log(data.overview); // stringYou can also import individual namespace classes or response types:
import { Astrology, type GetAstrologyHoroscopeBySignDailyResponse } from '@roxyapi/sdk';PHP uses named arguments for parameters and returns decoded JSON. Follow the PHP examples above for reading responses and handling errors.
Gotchas
Parameters are structured
TypeScript always uses { path: {...} }, { body: {...} }, or { query: {...} }. Python uses keyword arguments only (sign="aries"), never positional. PHP uses named arguments (sign: 'aries'), never positional. C# path params are indexers (roxy.Astrology.Horoscope["aries"]), query params go through a config lambda (c => c.QueryParameters.Q = "London, UK"), and POST bodies use a target-typed new() { ... }. Dart uses named arguments (sign: Sign.aries), with enums for fixed value sets. Do not mix the patterns.
Timezone accepts both IANA and decimal
Chart endpoints accept timezone as either a decimal (-5, 1, 0) or an IANA identifier ("America/New_York", "Europe/London"). IANA is preferred because it is DST-resolved against the request's date, so historical birth charts pick the correct offset even when you geocoded the city today. Pass city.timezone from the Location response; city.utcOffset is the offset in force today. A birth recorded in local mean time at the birthplace takes decimal hours equal to the longitude divided by 15, or that offset to the second as "-06:20:19". In C# the timezone is a union wrapper, new() { Double = 5.5 } for the decimal offset or new() { String = "Europe/London" } for the IANA identifier. In Dart it is NumOrString.number(5.5) or NumOrString.string('Europe/London').
Location returns an envelope, not a bare array
data.cities[0] in TypeScript, result["cities"][0] in Python and places.cities.first in Dart. The top-level object carries total, limit, offset for pagination. Same envelope pattern applies to tarot.listCards (data.cards), iching.listHexagrams (data.hexagrams), dreams.searchDreamSymbols (data.symbols), and crystals.searchCrystals / getCrystalsByZodiac / getCrystalsByChakra (data.crystals).
Date format is YYYY-MM-DD, time is HH:MM:SS
These are the JSON request formats. 14:30 is also accepted, with seconds defaulting to 00. Missing required date or time fields and out-of-range values return 400. Use the request types shown in the examples for your SDK.
Do not guess method names
Type roxy.domain. and let autocomplete show methods. Names come from operationId in the OpenAPI spec, not URL paths. Examples: getDailyHoroscope (not dailyHoroscope), calculateLifePath (not lifePath), castCelticCross (not celticCross).
Chart endpoints need coordinates
Use the location API to geocode cities before any birth chart, synastry, panchang, KP, or natal method. Never hardcode a user's latitude, longitude, or timezone from memory.
Do not expose API keys client-side
Call RoxyAPI with a secret key from server code, API routes, serverless functions, or background workers only. Any secret key shipped to the browser is a leaked key; browser code takes a publishable pk_ key.
Do not use raw fetch or requests
The SDK handles auth headers, base URL, SDK identification, and typed responses. Raw HTTP clients re-invent this and miss the type safety.
Python errors raise RoxyAPIError, PHP throws RoxyApiException
Catch and switch on e.code (Python, against ErrorCode) or $e->code() (PHP, an ErrorCode case), not the human-readable message text. .NET throws RoxyError; switch on e.Code against ErrorCodes. Go compares rerr.Code with the roxyapi.ErrCode... constants. Dart throws RoxyException; switch on e.code against ErrorCodes. The codes are stable between releases; the message text may change.
TypeScript data and error are mutually exclusive
If error is set, data is undefined. Always check error first.
Render the response in the browser
For projects that need to display the response visually (charts, tables, cards, forms) without writing your own SVG geometry or table layouts, install RoxyAPI UI alongside the SDK.
npm install @roxyapi/ui @roxyapi/sdkbun add @roxyapi/ui @roxyapi/sdk<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js"></script>Components are stateless. Caller fetches via the SDK, passes the response as the data prop. Theming via CSS custom properties on :root or per element. Works in React, Next.js, Vue, Svelte, Angular, vanilla HTML, and WordPress.
'use client';
import { createRoxy, type NatalChartResponse } from '@roxyapi/sdk';
import { RoxyNatalChart, RoxyLocationSearch } from '@roxyapi/ui-react';
import { useState } from 'react';
const roxy = createRoxy(process.env.NEXT_PUBLIC_ROXY_API_KEY!);
export default function Page() {
const [chart, setChart] = useState<NatalChartResponse | null>(null);
const onLocationSelect = async (e: CustomEvent<{ latitude: number; longitude: number; timezone: string }>) => {
const { latitude, longitude, timezone } = e.detail;
const { data, error } = await roxy.astrology.generateNatalChart({
body: { date: '1990-01-15', time: '14:30:00', latitude, longitude, timezone },
});
if (error) throw error;
setChart(data);
};
return (
<>
<RoxyLocationSearch onRoxyLocationSelect={onLocationSelect} />
{chart && <RoxyNatalChart data={chart} />}
</>
);
}This component runs in the browser, so give it a publishable pk_ key, the key class made to ship in web pages. See publishable keys.
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js"></script>
<roxy-natal-chart id="chart"></roxy-natal-chart>
<script type="module">
import { createRoxy } from 'https://cdn.jsdelivr.net/npm/@roxyapi/sdk@1/dist/factory.js';
const roxy = createRoxy('YOUR_PUBLISHABLE_KEY');
const { data } = await roxy.astrology.generateNatalChart({
body: { date: '1990-01-15', time: '14:30:00', latitude: 40.7128, longitude: -74.006, timezone: -5 },
});
document.getElementById('chart').data = data;
</script>add_action('wp_enqueue_scripts', function () {
wp_enqueue_script(
'roxy-ui',
'https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js',
[], null, true
);
});
// In a template or shortcode handler: the component reads the JSON island on load.
echo '<roxy-natal-chart><script type="application/json" class="roxy-data">'
. wp_json_encode($response, JSON_HEX_TAG | JSON_HEX_AMP)
. '</script></roxy-natal-chart>';Full setup walkthrough at /docs/ui, catalog and live customizer at /ui. Release notes and examples on GitHub at RoxyAPI/ui, MIT licensed, published to npm with provenance.
AI coding agents
The TypeScript, Python, PHP, C#, Go, Rust, and Dart SDKs bundle a consumer AGENTS.md. Point your coding agent at the installed guide explicitly: node_modules/@roxyapi/sdk/AGENTS.md, the installed Python package, vendor/roxyapi/sdk/AGENTS.md, the restored NuGet package (~/.nuget/packages/roxyapi.sdk/<version>/AGENTS.md), the Go module cache, the roxyapi-<version>/AGENTS.md file in the Cargo registry source cache after cargo fetch, or the roxyapi-<version>/AGENTS.md file in the pub cache after dart pub get.
- Quickstart, critical patterns, common tasks reference, gotchas
- Field format table covering timezone decimals, date / time strings, nested person objects, enum values
- MCP tool name mapping for every REST endpoint
Before the package is installed, an agent reads the same guide as raw markdown. Fetch it whole with curl -s, not a summarizing web tool:
- TypeScript: https://raw.githubusercontent.com/RoxyAPI/sdk-typescript/main/AGENTS.md
- Python: https://raw.githubusercontent.com/RoxyAPI/sdk-python/main/AGENTS.md
- PHP: https://raw.githubusercontent.com/RoxyAPI/sdk-php/main/AGENTS.md
- C# / .NET: https://raw.githubusercontent.com/RoxyAPI/sdk-dotnet/main/AGENTS.md
- Go: https://raw.githubusercontent.com/RoxyAPI/sdk-go/main/AGENTS.md
- Rust: https://raw.githubusercontent.com/RoxyAPI/sdk-rust/main/AGENTS.md
- Dart / Flutter: https://raw.githubusercontent.com/RoxyAPI/sdk-dart/main/AGENTS.md
- WordPress plugin: https://raw.githubusercontent.com/RoxyAPI/sdk-wordpress/main/AGENTS.md
For agents in projects WITHOUT any SDK installed (Ruby, raw curl, Bash), there is also a site-level AGENTS.md playbook at https://roxyapi.com/AGENTS.md covering the same Rule 0, common tasks, body shapes, error contract, and field gotchas, but language-agnostic.
Also available: a remote MCP server per domain at https://roxyapi.com/mcp/{domain} (Streamable HTTP, no stdio / no self-hosting) for agents that speak the Model Context Protocol.
Links
- API Reference: browse all endpoints and try live calls
- Quickstart: your first API call in three steps
- MCP Setup: connect AI agents to RoxyAPI
- Templates: full app templates to clone
- Your API key: copy it or create another
- Pricing: plans and quotas
- RoxyAPI UI setup walkthrough: Next.js, vanilla HTML, shadcn, theming, gotchas
- RoxyAPI UI catalog: every component with live preview and customizer
- TypeScript SDK on GitHub
- Python SDK on GitHub
- PHP SDK on GitHub
- .NET SDK on GitHub
- Go SDK on GitHub (pkg.go.dev)
- Rust SDK on GitHub (crates.io, API docs)
- WordPress plugin on wordpress.org (source on GitHub)
- RoxyAPI UI on GitHub