search

Copy page

Copy page as Markdown for LLMs

View as Markdown

View this page as plain text


Open in ChatGPT

Ask ChatGPT about this page

Open in Claude

Ask Claude about this page

Astro Engine API DocumentationBase URL: https://pdf.divineapi.comAuthenticationAll report generation requests require two headers:HeaderValueDescriptionAuthorizationBearer <api_acc_token>User's bearer token from Divine APIx-api-key<api_key> or <test_api_key>Determines live or test mode-Live mode (api_key): Deducts from remaining_credits-Test mode (test_api_key): Deducts from remaining_test_creditsProduct listing endpoints (GET /api/v1/products) are public and require no authentication.Endpoints1. List All ProductsGet all available report products for listing on your website.GET /api/v1/productsAuthentication: None requiredExample:curl https://pdf.divineapi.com/api/v1/productsResponse (200):[ { "id": "9480c262-a91b-4569-a285-2fc4f674add8", "name": "Education & Academic Report", "slug": "education-academic-report", "creditCost": 99, "description": null, "shortDescription": null, "imageUrl": null, "reportType": "Vedic", "category": "Careers, Education & Finances", "sampleHtmlUrl": null, "samplePdfUrl": null, "docUrl": null, "isPopular": true, "sortOrder": 0, "template": {Astro Engine API DocumentationBase URL: https://pdf.divineapi.comAuthenticationAll report generation requests require two headers:HeaderValueDescriptionAuthorizationBearer <api_acc_token>User's bearer token from Divine APIx-api-key<api_key> or <test_api_key>Determines live or test mode-Live mode (api_key): Deducts from remaining_credits-Test mode (test_api_key): Deducts from remaining_test_creditsProduct listing endpoints (GET /api/v1/products) are public and require no authentication.Endpoints1. List All ProductsGet all available report products for listing on your website.GET /api/v1/productsAuthentication: None requiredExample:curl https://pdf.divineapi.com/api/v1/productsResponse (200):[ { "id": "9480c262-a91b-4569-a285-2fc4f674add8", "name": "Education & Academic Report", "slug": "education-academic-report", "creditCost": 99, "description": null, "shortDescription": null, "imageUrl": null, "reportType": "Vedic", "category": "Careers, Education & Finances", "sampleHtmlUrl": null, "samplePdfUrl": null, "docUrl": null, "isPopular": true, "sortOrder": 0, "template": { Astro Engine API DocumentationBase URL: https://pdf.divineapi.comAuthenticationAll report generation requests require two headers:HeaderValueDescriptionAuthorizationBearer <api_acc_token>User's bearer token from Divine APIx-api-key<api_key> or <test_api_key>Determines live or test mode-Live mode (api_key): Deducts from remaining_credits-Test mode (test_api_key): Deducts from remaining_test_creditsProduct listing endpoints (GET /api/v1/products) are public and require no authentication. Astro Engine API DocumentationBase URL: https://pdf.divineapi.com

Astro Engine — API Documentation

Base URL: https://pdf.divineapi.com


Authentication

All report generation requests require two headers:

HeaderValueDescription
AuthorizationBearer <api_acc_token>User's bearer token from Divine API
x-api-key<api_key> or <test_api_key>Determines live or test mode

Live mode (api_key): Deducts from remaining_credits

Test mode (test_api_key): Deducts from remaining_test_credits

Product listing endpoints (GET /api/v1/products) are public and require no authentication.


Endpoints

1. List All Products

Get all available report products for listing on your website.

GET /api/v1/products

Authentication: None required

Example:

curl https://pdf.divineapi.com/api/v1/products

Response (200):

[
  {
    "id": "9480c262-a91b-4569-a285-2fc4f674add8",
    "name": "Education & Academic Report",
    "slug": "education-academic-report",
    "creditCost": 99,
    "description": null,
    "shortDescription": null,
    "imageUrl": null,
    "reportType": "Vedic",
    "category": "Careers, Education & Finances",
    "sampleHtmlUrl": null,
    "samplePdfUrl": null,
    "docUrl": null,
    "isPopular": true,
    "sortOrder": 0,
    "template": {
      "name": "Education & Academic Report",
      "slug": "education-academic-report"
    }
  },
  {
    "id": "e384bef1-a927-4671-b81b-08240139114e",
    "name": "Vedic Health Report",
    "slug": "vedic-health-report",
    "creditCost": 1,
    "description": null,
    "shortDescription": null,
    "imageUrl": null,
    "reportType": null,
    "category": null,
    "sampleHtmlUrl": null,
    "samplePdfUrl": null,
    "docUrl": null,
    "isPopular": false,
    "sortOrder": 0,
    "template": {
      "name": "Vedic Health Report",
      "slug": "vedic-health-report"
    }
  },
  {
    "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "name": "Vedic Career Report",
    "slug": "vedic-career-report",
    "creditCost": 1,
    "description": null,
    "shortDescription": null,
    "imageUrl": null,
    "reportType": null,
    "category": null,
    "sampleHtmlUrl": null,
    "samplePdfUrl": null,
    "docUrl": null,
    "isPopular": false,
    "sortOrder": 0,
    "template": {
      "name": "Vedic Career Report",
      "slug": "vedic-career-report"
    }
  }
]

2. Get Single Product

Get details for a specific product by its slug.

GET /api/v1/products/:slug

Authentication: None required

Example:

curl https://pdf.divineapi.com/api/v1/products/vedic-health-report

3. Generate Report

Submit birth data to generate a full astrology report (HTML + PDF).

POST /api/v1/reports/generate

Authentication: Required (Bearer token + API key)


Request Headers

Content-Type: application/json
Authorization: Bearer <api_acc_token>
x-api-key: <api_key or test_api_key>

Request Body

FieldTypeRequiredValidationDescription
report_typestringYesMust be a valid template slugReport to generate
full_namestringYesFull name of the person
daynumberYes1–31Birth day
monthnumberYes1–12Birth month
yearnumberYes1900–2100Birth year
hournumberYes0–23Birth hour (24h format)
minnumberYes0–59Birth minute
secnumberYes0–59Birth second
genderstringYes"male" or "female"
placestringYesBirthplace name
latnumberYesLatitude (e.g. 28.6139)
lonnumberYesLongitude (e.g. 77.2090)
tzonenumberYesTimezone offset in hours (e.g.  5.5for IST)
lanstringNoDefault: "en"Language code
font_pairingstringNoclassic, modern, elegant, professional, minimal, boldFont style for the report

Available Report Types

report_typeNameCredit CostSectionsWord Count
vedic-career-report Vedic Career Report113~2,000
vedic-health-reportVedic Health Report122~6,500
education-academic-reportEducation & Academic Report9922~6,500

Example Request

curl -X POST https://pdf.divineapi.com/api/v1/reports/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJ0eXAiOiJKV1Q..." \
  -H "x-api-key: 83cd001efdc14045852ecb823f0f0e6e" \
  -d '{
    "report_type": "vedic-health-report",
    "full_name": "Rahul Sharma",
    "day": 15,
    "month": 5,
    "year": 1990,
    "hour": 14,
    "min": 30,
    "sec": 0,
    "gender": "male",
    "place": "New Delhi, India",
    "lat": 28.6139,
    "lon": 77.2090,
    "tzone": 5.5
  }'

Success Response (200)

{
  "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "htmlUrl": "https://pdf.divineapi.com/reports/a1b2c3d4.html",
  "pdfUrl": "https://pdf.divineapi.com/reports/a1b2c3d4.pdf",
  "status": "processing"
}

Important: The API returns immediately with status: "processing". The report is generated in the background and typically takes 30–90 seconds.

-The htmlUrl initially shows a loading page that auto-refreshes when the report is ready.

-The pdfUrl becomes downloadable once generation is complete.


Error Responses

StatusResponseCause
400{"error": "full_name is required, day is required, ..."}Missing or invalid fields
401{"error": "Bearer token required"}Missing Authorization header
401{"error": "x-api-key header required"}Missing x-api-key header
401{"error": "Invalid Bearer token"}Token not found in database
401{"error": "API key does not match authenticated user"}API key doesn't belong to this user
402{"error": "Insufficient credits", "required": 99, "available": 10, "isTestMode": false}Not enough credits to generate this report
403{"error": "Tenant account is inactive"}Account has been deactivated
429{"error": "Rate limit exceeded. Maximum 100 reports per hour."}Too many requests

Credits

-Credits are deducted atomically before report generation starts.

-If report generation fails, credits are refunded automatically.

-The credit cost for each report is defined in the Products table and can be managed via the admin dashboard.

-402 Insufficient credits response includes required (cost) and available (current balance) fields for user-friendly error messages.


Rate Limits

LimitValue
Report generation100 requests per hour per tenant

Font Pairings

Optional font_pairing parameter to customize the report's typography:

ValueHeading FontBody Font
classic(default)Georgia, Times New RomanGeorgia, Times New Roman
modernGoogle Sans (Montserrat)Google Sans (Open Sans)
elegantPlayfair DisplayLora
professionalRoboto SlabRoboto
minimalInterInter
boldOswaldSource Sans Pro

Admin Dashboard

Manage products, templates, tenants, and view reports at:

https://pdf.divineapi.com/admin/

Notes

-All timestamps are in UTC.

-The htmlUrl and pdfUrl are permanent links — they do not expire.

-Reports are stored on the server and served as static files.

-The same birth data parameters are used across all report types — only report_type changes.