# SDKs and Postman

Official clients for TypeScript, Python, PHP, Java, .NET, Ruby, Swift, Dart/Flutter, Go and Rust, on their package registries, with retries and idempotency built in, plus a WordPress plugin and Postman.

Every SDK method and every Postman request is generated from the [OpenAPI document](https://96astroapi.com/openapi/v1.json), so they cover every capability in the [API reference](https://96astroapi.com/docs/reference) with the same names. The TypeScript and Python clients are described first; the [PHP client](#php), the [WordPress plugin](#wordpress) and [Postman](#postman) follow. The parts that make calls safe (retries, idempotency keys, errors, PDF and audio jobs, webhook signatures) are written by hand and tested.

| | TypeScript / JavaScript | Python |
|---|---|---|
| Package | `@96astro/api` | `astro96-api` (import `astro96_api`) |
| Runtime | Node.js 18+ (and other runtimes with `fetch`). Zero dependencies | Python 3.9+, sync and `asyncio` clients on `httpx` |
| Formats | ESM and CommonJS, with type declarations | Typed (`py.typed`), `TypedDict` inputs |

The official SDKs are published on [npm](https://www.npmjs.com/package/@96astro/api), [PyPI](https://pypi.org/project/astro96-api/), [Packagist](https://packagist.org/packages/96astro/api), [NuGet](https://www.nuget.org/packages/Astro96.Api), [Maven Central](https://central.sonatype.com/artifact/com.96astroapi/astro96-api), [RubyGems](https://rubygems.org/gems/astro96), [Swift Package Manager](https://github.com/96astro/astro96-swift), [pub.dev](https://pub.dev/packages/astro96_api), the Go module proxy (`github.com/96astro/astro96-go`) and [crates.io](https://crates.io/crates/astro96-api). Every SDK is generated from the same registry as the API reference, so a new capability reaches all of them in the next release; each registry page shows the current version. See [Go and Rust](#go-and-rust) for those two, and the [Postman collection](#postman) if you would rather start from ready-made requests.

## Install

```bash
# TypeScript / JavaScript
npm install @96astro/api

# Python
pip install astro96-api

# PHP
composer require 96astro/api

# Go
go get github.com/96astro/astro96-go

# Rust
cargo add astro96-api
```

The Java, .NET, Ruby, Swift and Dart/Flutter install lines are [below](#java-android-net-ruby-and-swift).

Both clients read the key from the `ASTRO_API_KEY` environment variable when you do not pass one.

> **Warning:** Keys belong on your server. The TypeScript client refuses to start in a browser unless you pass `dangerouslyAllowBrowser: true`, because a key in a web page is visible to every visitor.

## Your first call

**TypeScript**

```ts
import { Astro96Client } from "@96astro/api";

const astro = new Astro96Client({ apiKey: process.env.ASTRO_API_KEY });

const { data, meta, rateLimit } = await astro.vedicCharts.planetPositions({
  datetime: "1990-10-18T14:30:00",
  timezone: "Asia/Kolkata",
  latitude: 28.6139,
  longitude: 77.209,
});

console.log(data.ascendant.sign, data.planets.length, meta.credits_used, rateLimit?.remaining);
```

**Python**

```python
from astro96_api import Astro96Client

astro = Astro96Client()  # reads ASTRO_API_KEY

res = astro.vedic_charts.planet_positions(
    {"datetime": "1990-10-18T14:30:00", "timezone": "Asia/Kolkata", "latitude": 28.6139, "longitude": 77.209}
)
print(res.data["ascendant"]["sign"], res.meta["credits_used"], res.rate_limit)
```

**Python, async**

```python
import asyncio
from astro96_api import AsyncAstro96Client

async def main() -> None:
    async with AsyncAstro96Client() as astro:
        res = await astro.panchang.daily_panchang(
            {"date": "2026-10-15", "timezone": "Asia/Kolkata", "latitude": 28.6139, "longitude": 77.209}
        )
        print(res.data)

asyncio.run(main())
```

Methods follow the URL: `POST /v1/{family}/{capability}` is `client.family.capability()`, in camelCase for TypeScript (`astro.doshasYogas.manglikDosha`) and snake_case for Python (`astro.doshas_yogas.manglik_dosha`). Each call returns the response's `data` and `meta`, plus `status`, `requestId`, `rateLimit` (the `RateLimit-*` headers), `replayed`, the `idempotencyKey` that was sent and `headers`, all the response headers: read `headers.get("X-Credits-Remaining")` for your [balance](https://96astroapi.com/docs/credits-and-rate-limits.md#credit-headers).

### Types

Request bodies are typed from the OpenAPI request schemas, so your editor knows every field, its limits and its default. Response types (`data`) come from each endpoint's published response schema. For the main endpoints that is a hand-written contract (`x-schema-source: authored`). For almost every other endpoint it is **measured from several real answers** to different inputs (`sampled`): a required field was in every answer, and a field is `null`-able only where an answer had `null`. An answer to an input none of them covered can still differ, so check optional fields before you rely on them. A few endpoints have only the schema inferred from one example (`example`), which is a guide to the shape, not a contract. In Python, response `data` is a `TypedDict` of its top-level fields with nested objects as plain dicts.

## Errors

A failed call raises an `ApiError` with the fields of the [error envelope](https://96astroapi.com/docs/errors.md): `status`, `code` (stable: program against it), `field`, `retryable` and `requestId`. A network failure or timeout raises `ConnectionError` (`ApiConnectionError` in Python).

```ts
import { ApiError } from "@96astro/api";

try {
  await astro.vedicCharts.planetPositions({ datetime: "1990-10-18T14:30:00", latitude: 99, longitude: 77.2 });
} catch (err) {
  if (err instanceof ApiError && err.code === "invalid_request") {
    console.error(`Fix ${err.field}: ${err.message} (request ${err.requestId})`);
  } else {
    throw err;
  }
}
```

```python
from astro96_api import ApiError

try:
    astro.vedic_charts.planet_positions({"datetime": "1990-10-18T14:30:00", "latitude": 99, "longitude": 77.2})
except ApiError as e:
    if e.code == "quota_exhausted":
        ...  # top up or upgrade; retrying will not help
    print(e.status, e.code, e.field, e.request_id)
```

## Retries and idempotency

The clients retry for you, with exponential backoff and jitter, up to `maxRetries` (`max_retries`, default 2):

- `429 rate_limited` and `503` are retried after the server's `Retry-After`. If it asks for longer than `maxRetryDelayMs` (`max_retry_delay`, default 30 seconds), the error is raised instead so you can decide.
- `429 quota_exhausted` is never retried.
- Other errors marked `retryable` (`500`, `502`, `504`, an idempotency key still in progress) and network failures are retried **only when the call carries an idempotency key**, so a retry can never be charged twice.

Every POST gets an `Idempotency-Key` automatically, reused across the client's own retries. To retry safely across processes (say, a job queue), pass your own key and reuse it for the same logical operation:

```ts
import { idempotencyKey } from "@96astro/api";

const key = order.idempotencyKey ?? idempotencyKey(); // store it with the order
await astro.reports.reportCareer(birth, { idempotencyKey: key });
```

```python
from astro96_api import idempotency_key

key = order.idempotency_key or idempotency_key()  # store it with the order
astro.reports.report_career(birth, idempotency_key=key)
```

Turn automatic keys off with `autoIdempotency: false` (`auto_idempotency=False`). See [Idempotency](https://96astroapi.com/docs/idempotency.md) for how the API replays a repeated key.

### Options

| TypeScript | Python | Default | Meaning |
|---|---|---|---|
| `apiKey` | `api_key` | `ASTRO_API_KEY` | Your sandbox or live key |
| `baseUrl` | `base_url` | `https://api.96astroapi.com` | API address |
| `auth` | `auth` | `"bearer"` | `"bearer"` or `"x-api-key"` header |
| `timeoutMs` | `timeout` | 60 s | Per attempt |
| `maxRetries` | `max_retries` | 2 | Retries after the first attempt |
| `fetch` | `http_client` | global `fetch` / new `httpx` client | Bring your own transport, proxy or mock |

Each method also takes per-call options: `idempotencyKey`, `timeoutMs`, `maxRetries`, `headers` and an `AbortSignal` to cancel (Python: `idempotency_key=`, `timeout=`, `max_retries=`, `headers=`; cancel an `asyncio` task to stop an async call).

### Name your app

Every SDK takes an optional **app identity**, so you can see which app, website or platform calls the API with your keys. It is off unless you set it. Browser calls already show their website; server-side and mobile calls show only the SDK, so naming the app is what tells your apps apart (and helps you spot a leaked key: an app you do not recognise).

| Language | How |
|---|---|
| TypeScript | `new Astro96Client({ appInfo: { name: "Acme Shop", version: "2.1.0", url: "https://shop.acme.com" } })` |
| Python | `Astro96Client(app_info={"name": "Acme Shop", "version": "2.1.0", "url": "https://shop.acme.com"})` |
| PHP | `new Client($key, ['app_info' => ['name' => 'Acme Shop', 'version' => '2.1.0', 'url' => 'https://shop.acme.com']])` |
| Go | `astro96.NewClient(key, astro96.WithAppInfo("Acme Shop", "2.1.0", "https://shop.acme.com"))` |
| Rust | `Client::builder(key).app_info("Acme Shop", Some("2.1.0"), Some("https://shop.acme.com"))` |
| Java, .NET, Ruby, Swift, Dart | optional constructor parameters (`appName`, `appVersion`, `appUrl`; Ruby `app_info:`; Swift `appInfo: Astro96AppInfo(...)`) |

The name is required: printable ASCII, at most 60 characters, without `/` or parentheses. The version (at most 40 characters) and the url (`http` or `https`, at most 120 characters) are optional, and neither may contain spaces or parentheses. An invalid value is refused when the client is created. The SDK sends it as the `X-Astro-App` header in the form `name/version (+url)`; if you call the API without an SDK you can send the header yourself. It never contains your key.

The API stores the name, the version and only the **host** of the url (never a path or query), together with the platform it works out from the User-Agent (`ios`, `android`, `web`, `server`, `desktop` or `unknown`; the SDKs add a `plt/` token such as `plt/node` or `plt/linux`). They are shown under **Usage > Where your keys are used** in your dashboard, for your organization only, and are deleted with your account like the IP address and User-Agent.

## Not wrapped yet

The SDKs call the JSON capabilities and the PDF and audio job routes. They do not yet wrap [streaming](https://96astroapi.com/docs/ai-streaming-and-chat.md) (`stream: true` needs a reader for `text/event-stream`), the [`/v1/conversations`](https://96astroapi.com/docs/ai-streaming-and-chat.md#conversations) routes, or [`.ics` calendar export](https://96astroapi.com/docs/requests-and-responses.md#calendar-export-ics) (the clients always ask for JSON). Call those over plain HTTP as shown in their guides; the key, retries and idempotency rules are the same. Image options (`image_format`, `image_theme`, `image_delivery` and the rest) are ordinary request fields and work in the typed inputs.

## PDF reports

`createAudioJob` makes a [spoken MP3](https://96astroapi.com/docs/audio-reports.md) of a report the same way. `createPdfJob`, `waitForJob` and `downloadFile` wrap the [PDF job](https://96astroapi.com/docs/jobs-and-webhooks.md) routes. `waitForJob` polls with a growing interval (2 s to 10 s, up to 5 minutes by default) and raises `JobError` if the job fails. `downloadFile` fetches the signed link without your key and refreshes an expired link once.

```ts
import { writeFile } from "node:fs/promises";

const birth = { datetime: "1990-10-18T14:30:00", timezone: "Asia/Kolkata", latitude: 28.6139, longitude: 77.209 };
const { job, pdf } = await astro.renderPdf({
  capability: "report-career",
  input: birth,
  branding: { brand_name: "Shree Jyotish Kendra", accent: "#1f4fd1" },
});
await writeFile(`career-${job.id}.pdf`, pdf);
```

```python
job = astro.create_pdf_job("report-career", birth, branding={"brand_name": "Shree Jyotish Kendra"}).data
done = astro.wait_for_job(job, timeout=300)
with open(f"career-{done['id']}.pdf", "wb") as f:
    f.write(astro.download_file(done))
```

## Webhooks

`verifyWebhook` (`verify_webhook`) checks the `Astro-Signature` of a [webhook](https://96astroapi.com/docs/jobs-and-webhooks.md#webhooks) against your endpoint's secret (or several, while you rotate), refuses timestamps more than 5 minutes off, compares in constant time and returns the parsed event. Pass the **raw** request body.

```ts
import express from "express";
import { verifyWebhook, WebhookSignatureError } from "@96astro/api";

app.post("/webhooks/96astro", express.raw({ type: "application/json" }), async (req, res) => {
  try {
    const event = await verifyWebhook({ rawBody: req.body, headers: req.headers, secret: process.env.ASTRO_WEBHOOK_SECRET! });
    // Deduplicate on event.id, queue the work, then answer quickly.
    res.sendStatus(204);
  } catch (err) {
    if (err instanceof WebhookSignatureError) return res.status(400).send("bad signature");
    throw err;
  }
});
```

```python
import os

from astro96_api import WebhookSignatureError, verify_webhook

try:
    event = verify_webhook(request.body, request.headers, os.environ["ASTRO_WEBHOOK_SECRET"])
except WebhookSignatureError:
    return 400
```

## PHP

A PHP client, `96astro/api` (PHP 8.1+, namespace `Astro96\Api`), is built and tested with the same safety features: retries on `429` and `503` honouring `Retry-After`, automatic idempotency keys, typed exceptions per error code, PDF job helpers and webhook verification. It uses the WordPress HTTP API inside WordPress, Guzzle when installed, otherwise ext-curl or any PSR-18 client, and includes an optional Laravel service provider and `Astro96` facade.

```bash
composer require 96astro/api
```

```php
use Astro96\Api\Client;

$astro = new Client(); // reads ASTRO_API_KEY

$res = $astro->vedicCharts->planetPositions([
    'datetime' => '1990-10-18T14:30:00', 'timezone' => 'Asia/Kolkata',
    'latitude' => 28.6139, 'longitude' => 77.209,
]);
echo $res->data['ascendant']['sign'];
```

`POST /v1/{family}/{capability}` is `$astro->family->capability()` in camelCase, for example `$astro->panchang->dailyPanchang([...])`. `$astro->call($path, $input)` sends any other JSON `POST` route; streaming, `.ics` and the `GET` conversation routes are not wrapped.

## WordPress

The WordPress plugin sells personalised PDF and MP3 reports through WooCommerce (below), and adds blocks and shortcodes to any WordPress 6.3+ site (PHP 7.4+): `[astro96_panchang]`, `[astro96_horoscope sign="leo" period="weekly"]`, `[astro96_kundli style="south"]`, `[astro96_match]`, `[astro96_western]` (a Western natal wheel with the Sun, Moon and rising sign) and `[astro96_numerology]` (radical, destiny, name and Kua numbers). Your site calls the API with your key from the server, so the key is never in a page; identical requests are cached, so repeated views cost no credits, and each visitor can submit the kundli and matching forms only a limited number of times an hour.

1. [Download the plugin](https://96astroapi.com/downloads/astro96-api.zip) and upload it under **Plugins, Add New, Upload Plugin**. The current version is 1.2.1. Version 1.1.1 was submitted to the WordPress.org directory and is awaiting review, so for now install it from the zip.
2. Under **Settings, 96Astro API** paste a **secret** key (`sk_test_...` to try it, `sk_live_...` to go live) and set your default city. **Test the connection** checks the key.
3. Add a 96Astro block to a page, or a shortcode.

### Selling reports with WooCommerce

With WooCommerce active, any product can be a personalised report. In the product's **96Astro report** tab choose the report (kundli, career, marriage, annual, five-year, past-life, child personality, Big Three and more), PDF or narrated MP3, the language, and for MP3 the voice, style, minutes, podcast format and music.

- Buyers enter birth details on the product page; the server checks them before the item goes in the cart.
- When the order is paid, each report item becomes one job. Its `Idempotency-Key` names the site, order, item and attempt, so a repeated payment hook never makes or charges a second report.
- WP-Cron polls the job. The finished file is kept in a protected `uploads/astro96-reports` folder, and the buyer is emailed a personal link (also shown in their order) that serves the file only for that order.
- **On Nginx, block the folder yourself.** The plugin protects it with an `.htaccess` file, which Apache obeys and Nginx ignores. Add this to the site's `server` block (on Plesk: **Apache & nginx Settings, Additional nginx directives**; on a managed host, ask support to add it), then reload Nginx:

  ```nginx
  location ^~ /wp-content/uploads/astro96-reports/ { deny all; }
  ```

  Check it: `curl -I https://your-shop.example/wp-content/uploads/astro96-reports/test.pdf` should answer `403`, while the download link in an order email still works.
- A failed report is retried up to three times; then the order gets a note and the site admin an email.
- Your brand name, accent colour, footer and website (Settings, 96Astro API) print on the PDFs.

A live key spends your credits for each report sold; a sandbox key makes sample reports free while you set up.

A calculated answer shows a small "Calculated by 96Astro API" line; remove it with `add_filter( 'astro96_show_credit', '__return_false' );`. Behind Cloudflare or another proxy, pass the visitor's real address with the `astro96_client_ip` filter so the hourly limit is per visitor. To draw the panels in the browser instead, use the [widgets](https://96astroapi.com/docs/widgets.md).

## Postman

Download the [Postman collection](https://96astroapi.com/postman/96astro-api.postman_collection.json) and an environment ([Sandbox](https://96astroapi.com/postman/96astro-api-sandbox.postman_environment.json) or [Live](https://96astroapi.com/postman/96astro-api-live.postman_environment.json)), then import them in Postman (**Import**, drop the files).

- Select the environment and paste your key into `api_key`. The files carry no key. Start with a sandbox key (`sk_test_...`): calls are not charged.
- The collection authenticates every request with `Authorization: Bearer {{api_key}}` and sends a fresh `Idempotency-Key` (`{{$guid}}`). Replace it with a fixed value to try a replay.
- Requests are grouped by family, with the documented example body and a saved example response.

The whole collection is large. If you use only some families, import just those:

| Family | Collection |
|---|---|
| Vedic | [Download](https://96astroapi.com/postman/96astro-api-vedic-charts.postman_collection.json) |
| Strengths & relationships | [Download](https://96astroapi.com/postman/96astro-api-strengths.postman_collection.json) |
| Dasha systems | [Download](https://96astroapi.com/postman/96astro-api-dashas.postman_collection.json) |
| Panchang & almanac | [Download](https://96astroapi.com/postman/96astro-api-panchang.postman_collection.json) |
| Festivals & muhurta | [Download](https://96astroapi.com/postman/96astro-api-festivals-muhurta.postman_collection.json) |
| Compatibility matching | [Download](https://96astroapi.com/postman/96astro-api-matching.postman_collection.json) |
| Doshas & yogas | [Download](https://96astroapi.com/postman/96astro-api-doshas-yogas.postman_collection.json) |
| Predictions & readings | [Download](https://96astroapi.com/postman/96astro-api-predictions.postman_collection.json) |
| Krishnamurti Paddhati (KP) | [Download](https://96astroapi.com/postman/96astro-api-kp.postman_collection.json) |
| Jaimini | [Download](https://96astroapi.com/postman/96astro-api-jaimini.postman_collection.json) |
| Lal Kitab | [Download](https://96astroapi.com/postman/96astro-api-lal-kitab.postman_collection.json) |
| Bhrigu Nandi Nadi (BNN) | [Download](https://96astroapi.com/postman/96astro-api-bnn.postman_collection.json) |
| Annual charts (Tajika) | [Download](https://96astroapi.com/postman/96astro-api-tajika.postman_collection.json) |
| Western astrology | [Download](https://96astroapi.com/postman/96astro-api-western.postman_collection.json) |
| Tarot | [Download](https://96astroapi.com/postman/96astro-api-tarot.postman_collection.json) |
| Numerology | [Download](https://96astroapi.com/postman/96astro-api-numerology.postman_collection.json) |
| Remedies & guidance | [Download](https://96astroapi.com/postman/96astro-api-remedies.postman_collection.json) |
| Reports | [Download](https://96astroapi.com/postman/96astro-api-reports.postman_collection.json) |
| Location astrology | [Download](https://96astroapi.com/postman/96astro-api-location-astrology.postman_collection.json) |
| Vastu | [Download](https://96astroapi.com/postman/96astro-api-vastu.postman_collection.json) |
| Mundane astrology | [Download](https://96astroapi.com/postman/96astro-api-mundane.postman_collection.json) |
| AI interpretation | [Download](https://96astroapi.com/postman/96astro-api-ai.postman_collection.json) |
| Utilities | [Download](https://96astroapi.com/postman/96astro-api-utilities.postman_collection.json) |
| Chinese astrology | [Download](https://96astroapi.com/postman/96astro-api-chinese.postman_collection.json) |
| Human Design | [Download](https://96astroapi.com/postman/96astro-api-human-design.postman_collection.json) |
| Palm reading | [Download](https://96astroapi.com/postman/96astro-api-palmistry.postman_collection.json) |
| Face reading | [Download](https://96astroapi.com/postman/96astro-api-face-reading.postman_collection.json) |

- The **PDF and audio jobs** folder chains create, poll and download: its scripts carry `job_id` and `download_url` from one request to the next.

## Other languages

Any language with an HTTP client can call the API: see the [Quickstart](https://96astroapi.com/docs/quickstart.md) and [Requests and responses](https://96astroapi.com/docs/requests-and-responses.md). The [OpenAPI 3.1 document](https://96astroapi.com/openapi/v1.json) also works with generators such as OpenAPI Generator.

## Java, Android, .NET, Ruby and Swift

Clients with one method per capability, retries and idempotency keys, and no dependencies. Each language has a full guide: install, first call, errors, retries, PDF and audio jobs, and webhook verification. Requests and responses are JSON strings, so you parse them with whatever your app already uses (Ruby takes a Hash and parses the answer).

| Language | Install | Tested on | Full guide |
|---|---|---|---|
| Java and Android | Maven: `com.96astroapi:astro96-api` (Gradle: `implementation("com.96astroapi:astro96-api:<version>")`, the latest version is on Maven Central) | Java 8 | [Java and Android SDK](https://96astroapi.com/docs/sdk-java.md) |
| .NET | `dotnet add package Astro96.Api` | .NET 8 | [.NET SDK](https://96astroapi.com/docs/sdk-dotnet.md) |
| Ruby | `gem install astro96` (or `gem "astro96"` in your Gemfile) | Ruby 3.0 | [Ruby SDK](https://96astroapi.com/docs/sdk-ruby.md) |
| Swift | Swift Package Manager: `.package(url: "https://github.com/96astro/astro96-swift.git", from: "0.2.0")` (any later 0.x release also satisfies it) | Swift 5.9 | [Swift SDK](https://96astroapi.com/docs/sdk-swift.md) |

Each is checked for its requests, retries and errors, and makes one real call to the API. The Java package is `com.astro96` (`import com.astro96.Astro96Client;`): a Java package name cannot start with a digit, so it differs from the Maven group.

Prefer files? Each is also a download with a README and the MIT licence: [Java](https://96astroapi.com/downloads/sdk/astro96-java.zip), [.NET](https://96astroapi.com/downloads/sdk/astro96-dotnet.zip), [Ruby](https://96astroapi.com/downloads/sdk/astro96-ruby.zip), [Swift](https://96astroapi.com/downloads/sdk/astro96-swift.zip), [Go](https://96astroapi.com/downloads/sdk/astro96-go.zip), [Rust](https://96astroapi.com/downloads/sdk/astro96-rust.zip).

## Go and Rust

Both are generated from the same registry, with one method per capability, PDF and audio jobs, retries that reuse the idempotency key, and an error carrying the API's `code`.

| Language | Install | Tested |
|---|---|---|
| Go | `go get github.com/96astro/astro96-go` (module path as above; standard library only; the module is released from the repository with tags of the form `packages/sdk-go/vX.Y.Z`) | `go vet`, `go build` and `go test` on Go 1.21 |
| Rust | `cargo add astro96-api` (crate `astro96-api`, import `astro96_api`; async on `reqwest` with rustls) | `cargo test`, and the shared request, retry and error check in Docker |

```go
import astro96 "github.com/96astro/astro96-go"

client, err := astro96.NewClient(os.Getenv("ASTRO_API_KEY"))
answer, err := client.PlanetPositions(ctx, map[string]any{
    "datetime": "1990-10-18T14:30:00", "timezone": "Asia/Kolkata",
    "latitude": 28.6139, "longitude": 77.209,
})
```

```rust
let client = astro96_api::Client::new(std::env::var("ASTRO_API_KEY")?)?;
let answer = client
    .planet_positions(serde_json::json!({
        "datetime": "1990-10-18T14:30:00", "timezone": "Asia/Kolkata",
        "latitude": 28.6139, "longitude": 77.209
    }))
    .await?;
println!("{} credits used", answer.meta.credits_used);
```

The Go client takes a struct, map, JSON string or `[]byte` and returns the response JSON; the Rust client takes a `serde_json::Value` and returns an envelope with `data` and `meta` (`request_id`, `credits_used`). Each folder has a README, and each is also a [zip download](https://96astroapi.com/downloads/sdk/astro96-go.zip) ([Rust](https://96astroapi.com/downloads/sdk/astro96-rust.zip)) with the MIT licence.

## Dart and Flutter

`astro96_api` on [pub.dev](https://pub.dev/packages/astro96_api), for Dart 3 on servers, the command line and every Flutter platform. It has the same shape as the clients above: one method per capability, PDF and audio jobs, retries with idempotency keys, and an `Astro96Exception` carrying the API's `code`. Each method takes the request as a `Map` (or a JSON string) and returns the parsed response.

```sh
dart pub add astro96_api      # or: flutter pub add astro96_api
```

```dart
import 'dart:io';
import 'package:astro96_api/astro96_api.dart';

// On your server: the key comes from the environment, never from app code.
final astro = Astro96Client(apiKey: Platform.environment['ASTRO_API_KEY']!);
final answer = await astro.planetPositions({
  'datetime': '1990-10-18T14:30:00',
  'timezone': 'Asia/Kolkata',
  'latitude': 28.6139,
  'longitude': 77.209,
});
```

Never ship your secret key inside a Flutter app: have the app call your own backend, and let the backend call the API (see [Platforms](https://96astroapi.com/docs/platforms.md)). The [Dart and Flutter SDK guide](https://96astroapi.com/docs/sdk-dart.md) covers errors, retries, PDF and audio jobs and webhooks.
