PDF Reports
Generate print-ready astrology reports as PDFs — fully white-labelled with your own brand name, logo and website. Every report is computed from a real birth chart, written up by AI, and delivered as a hosted PDF your users can download.
How it works
One endpoint handles every report. You send the report type plus birth details, and the API returns a download URL immediately. The PDF itself is built in the background across a few calls — see the batch flow below for how to drive it to completion.
The download URL is stable: it is returned on the very first call and never changes, so you can store it against the user's record straight away. If the user opens it before the PDF is finished, they see a “preparing your report” page that refreshes itself.
POST https://starsapi.com/api/v2/reports/generate-report
Available reports
Pass one of these values as report_type. The exact list available to your
account, along with live pricing, is shown on the
Reports page in your dashboard.
| report_type | Report | Charts | Covers |
|---|---|---|---|
life-report |
Life Report | Single | Full-life analysis with a multi-year forecast — planetary periods, career, relationships, health, finances and remedies. |
career-report |
Career Report | Single | Career direction, suitable industries, job vs business, and timing windows for change. |
career-path-finder |
Career Path Finder | Single | Focused guidance on choosing between career paths, with strengths and timing. |
marriage-report |
Marriage Report | Single | Marriage prospects, partner indications, timing, and doshas affecting married life. |
health-report |
Health Report | Single | Health vulnerabilities by planetary placement, timing of health events, and Ayurvedic guidance. |
kundli-matching |
Kundli Matching | Dual | Compatibility between two charts — Guna Milan, dosha analysis and a verdict. |
Dual-chart reports need birth details for two people; single-chart reports need one. See the endpoint reference for the exact field names.
The batch flow
Reports are long documents with many AI-written sections, so they are built in batches rather than in one blocking request. The pattern is simple:
- First call — creates the report, processes the first batch of sections,
and returns the download URL with
status: "processing". - Repeat the same call — identical body, same birth details. Each call processes the next batch.
- Final call — once all sections are done the PDF is rendered and saved,
and the response comes back with
status: "ready".
The URL is identical in every response, so store it after the first call and simply keep calling
until the status flips to ready. Each response also carries a progress object
(done, total, percent) you can wire straight into a progress
bar. A typical report is complete within two to three minutes.
Downloading
The download URL serves the PDF once it exists. Before that it shows a self-refreshing
“preparing” page, so it is always safe to show your user. To check status from code
instead, add &format=json to the URL — you get back a small JSON status
object rather than a file or a page.
Links stay valid for 7 days. If your users need the PDF for longer, copy it into your own storage while the link is live. Full details are in the endpoint reference.
Authentication
Send your API key in the X-Api-Key header, the same as every other StarsAPI endpoint.
| Method | How |
|---|---|
| Header (recommended) | X-Api-Key: YOUR_KEY |
| Body | "api_key": "YOUR_KEY" inside the JSON payload |
White-label branding
Every PDF carries your branding, not ours. Brand values are resolved in three layers, with the first match winning:
- Request fields — pass
brand_name,brand_tagline,brand_urlorbrand_logo_urlin the request body. Useful if you serve several client brands from one API key. - Account settings — set once under Brand Settings in your dashboard and applied to every PDF automatically.
- Neutral default — if neither is set, the cover falls back to a generic, unbranded title.
Billing
Reports are charged to your wallet balance, not your API request credits. Each report type has its own price, visible on the Reports page. A report is charged once, on the first call — the follow-up batch calls that finish the same report are free.
If your wallet balance is too low, the request fails before any work is done and nothing is charged.
Common errors
| HTTP | Cause | Fix |
|---|---|---|
| 400 | Unknown report_type | Use one of the values in the table above — note the hyphens. |
| 400 | Missing birth details | All of year, month, day, hour, minute, latitude, longitude and timezone are required. |
| 401 | Invalid or missing API key | Check the X-Api-Key header. |
| 402 | Insufficient wallet balance | Top up in the dashboard, then retry. |
| 403 | Report not enabled on your plan | Check the Reports page for what your plan unlocks. |