Skip to content

PDF Reports

Generate professional PDF reports for natal charts, synastry, solar returns, and more. The PDF Reports module allows you to create customizable astrology reports with interpretations, charts, and tables.

Overview

The PDF Reports feature provides:

  • Multiple report types: Natal, synastry, composite, transit, solar return, lunar return, progressions, numerology, and Chinese astrology
  • Customizable templates: Create and manage your own PDF templates with custom layouts
  • Automatic calculations: Astrology data is calculated on-the-fly and merged into your template
  • Professional output: High-quality PDF generation with support for headers, footers, page numbers, and custom CSS

Supported Report Types

Report TypeDescription
natalBirth chart analysis with planetary positions, houses, and aspects
synastryRelationship compatibility between two charts
compositeCombined chart for relationships
transitCurrent planetary transits to natal chart
solar-returnAnnual birthday chart
lunar-returnMonthly lunar return chart
progressionsSecondary progressions
numerologyNumerology calculations and analysis
chineseChinese astrology report

Generate a PDF Report

Generate a PDF report by providing birth data and optionally specifying a template.

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/generate" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "reportType": "natal",
    "subject": {
      "name": "John Doe",
      "birthDate": {
        "year": 1990,
        "month": 6,
        "day": 15,
        "hour": 14,
        "minute": 30
      },
      "birthPlace": {
        "name": "London, UK",
        "latitude": 51.5074,
        "longitude": -0.1278,
        "timezone": "Europe/London"
      }
    }
  }' \
  --output natal-report.pdf

Request Parameters

ParameterTypeRequiredDescription
reportTypestringYesType of report (see supported types above)
templateIdstringNoSpecific template ID to use (uses default if not provided)
subjectobjectYesBirth data for the main subject
partnerobjectNoBirth data for partner (required for synastry/composite)
transitDateobjectNoTarget date for transit/return reports

Subject Object

FieldTypeRequiredDescription
namestringYesName of the person
birthDateobjectYesBirth date and time
birthDate.yearnumberYesBirth year
birthDate.monthnumberYesBirth month (1-12)
birthDate.daynumberYesBirth day (1-31)
birthDate.hournumberYesBirth hour (0-23)
birthDate.minutenumberYesBirth minute (0-59)
birthPlaceobjectYesBirth location
birthPlace.namestringYesLocation name
birthPlace.latitudenumberYesLatitude (-90 to 90)
birthPlace.longitudenumberYesLongitude (-180 to 180)
birthPlace.timezonestringYesIANA timezone identifier

Response

The endpoint returns a PDF file (application/pdf) with the generated report.

Synastry Report Example

Generate a synastry report comparing two birth charts:

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/generate" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "reportType": "synastry",
    "subject": {
      "name": "Person A",
      "birthDate": {
        "year": 1990,
        "month": 6,
        "day": 15,
        "hour": 14,
        "minute": 30
      },
      "birthPlace": {
        "name": "London, UK",
        "latitude": 51.5074,
        "longitude": -0.1278,
        "timezone": "Europe/London"
      }
    },
    "partner": {
      "name": "Person B",
      "birthDate": {
        "year": 1988,
        "month": 3,
        "day": 22,
        "hour": 9,
        "minute": 15
      },
      "birthPlace": {
        "name": "Paris, France",
        "latitude": 48.8566,
        "longitude": 2.3522,
        "timezone": "Europe/Paris"
      }
    }
  }' \
  --output synastry-report.pdf

Solar Return Report Example

Generate a solar return chart for a specific year:

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/generate" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "reportType": "solar-return",
    "subject": {
      "name": "John Doe",
      "birthDate": {
        "year": 1990,
        "month": 6,
        "day": 15,
        "hour": 14,
        "minute": 30
      },
      "birthPlace": {
        "name": "London, UK",
        "latitude": 51.5074,
        "longitude": -0.1278,
        "timezone": "Europe/London"
      }
    },
    "transitDate": {
      "year": 2025,
      "month": 6,
      "day": 15,
      "hour": 0,
      "minute": 0
    }
  }' \
  --output solar-return-2025.pdf

Template Management

Templates define the layout and content of your PDF reports. Each template is associated with a specific report type.

List Templates

bash
curl -X GET "https://api.astroapi.cloud/api/pdf-reports/templates" \
  -H "X-Api-Key: your-api-key"

Returns both organization-specific templates and global (shared) templates.

Get a Specific Template

bash
curl -X GET "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
  -H "X-Api-Key: your-api-key"

Create a Template

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "templates",
      "attributes": {
        "name": "My Natal Report Template",
        "description": "Custom natal chart report",
        "reportType": "natal",
        "editorConfig": {},
        "pageSettings": {
          "format": "A4",
          "orientation": "portrait",
          "margins": {
            "top": 20,
            "right": 20,
            "bottom": 20,
            "left": 20
          }
        },
        "isDefault": true
      }
    }
  }'

Template Attributes

AttributeTypeDescription
namestringTemplate name (1-100 characters)
descriptionstringOptional description
reportTypestringReport type this template is for
editorConfigobjectEditor.js block configuration
pageSettingsobjectPage layout settings
customCssstringCustom CSS styles
isDefaultbooleanSet as default for this report type
isActivebooleanWhether the template is active

Page Settings

SettingTypeDescription
formatstringPage size: "A4" or "Letter"
orientationstring"portrait" or "landscape"
marginsobjectPage margins in mm (top, right, bottom, left)
headerobjectHeader configuration
footerobjectFooter configuration
pageNumbersobjectPage number settings
json
{
  "header": {
    "enabled": true,
    "height": 15,
    "content": "My Astrology Report"
  },
  "footer": {
    "enabled": true,
    "height": 15,
    "content": "Generated by AstroAPI"
  },
  "pageNumbers": {
    "enabled": true,
    "position": "bottom-center",
    "format": "Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span>"
  }
}

Update a Template

bash
curl -X PATCH "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "templates",
      "attributes": {
        "name": "Updated Template Name"
      }
    }
  }'

Delete a Template

bash
curl -X DELETE "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
  -H "X-Api-Key: your-api-key"

Duplicate a Template

Copy an existing template (including global templates) to your organization:

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}/duplicate" \
  -H "X-Api-Key: your-api-key"

Set Default Template

Set a template as the default for its report type:

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}/set-default" \
  -H "X-Api-Key: your-api-key"

Preview a Template

Preview how a template will render with sample data (returns HTML):

bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/preview" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "your-template-id"
  }'

Template Resolution

When generating a PDF, the system resolves which template to use in this order:

  1. Specific template: If templateId is provided in the request
  2. Organization default: The organization's default template for the report type
  3. Global default: A global (shared) default template for the report type

Required Permissions

EndpointPermission
List/Get templatescontent:read
Generate PDFcontent:read
Preview templatecontent:read
Create templatecontent:create
Update templatecontent:update
Delete templatecontent:delete
Duplicate templatecontent:create
Set defaultcontent:update

Report Content

Generated reports include:

  • Subject information: Name, birth date, time, and location
  • Planetary positions: All major planets with sign, house, and degree
  • House cusps: All 12 house cusps with signs
  • Aspects: Planetary aspects with orbs and interpretations
  • Interpretations: CMS-sourced text content for each placement and aspect

The actual content depends on the template configuration and available CMS content.

AstroAPI Documentation