API


PDF Design

You can customize the design of the PDF by modifying the template files. To make this process easier, we provide an online editor at https://pdf-editor-v1-admin-ui-6xx.pages.dev/, where you can edit template files and preview the results in real time. The editor also allows you to apply custom CSS for further styling.

On the left side of the editor, you'll find a file browser to select the template file you wish to modify. The content of the selected file will appear in the center, where you can make edits. Once you're done, simply click the Save button at the bottom left corner. Your changes will be saved, and the PDF will automatically reload to reflect the updates. Additionally, the generated code will be copied to your clipboard.

To integrate the updated template with AstroAPI, include the copied code in the encodedTemplate parameter of your API request.

Natal Horoscope

The Natal horoscope, also known as a birth horoscope, calculates a person's unique and personal astrological report based on birthdate, birthplace and birthtime. This is the most widely used horoscope.

Basic Flow

To generate a Natal Horoscope PDF report from the AstroAPI, the system (your implementation) makes a POST-request to the /api/natal-pdf-report endpoint with the necessary parameters. With correct parameters the AstroAPI will provide a full natal horoscope in PDF format.

Generating a Natal Horoscope

GET /api/natal-pdf-report

Header Value
Accept-Encoding application/json
Content-Type application/json


Query params

{
    "name": "Matthias",
    "date": "1984-03-27",
    "time": "13:13",
    "place_id": 3,
    "lang": "en",
    "system": "p",
    "planets": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    "collect_text": true,
    "showLogo": true,
    "showNotes": true,
    "showEndAstroapiPage": true,
    "translations": {
      "Name:": "Naam:",
      "Date:": "Datum:"
    },
    "token": "your-access-token"
}


Example: /api/natal-pdf-report?name=Matthias&date=1984-03-27&time=13:13&place_id=3&planets[]=0&planets[]=1&planets[]=2&planets[]=3&token=your-access-token

Params explanation

Header Value
name The name of the person or event you wish to create a natal horoscope for
date The (birth)date of the person or event in format YYYY-mm-dd
time The (birth)time of the person or event in format HH:mm
place_id The (birth)place of the person or event retrieved from the /api/places request
lang The language you wish to receive the astrological interpretation texts associated with the horoscope in. Default: 'nl'
system The House system: or "p" (Placidus), "k" (Koch), "x" (Meridian House system) or "W" (Whole Sign)
planets An array of planets that need calculation (Sun = 0, Moon = 1, Mercury = 2, Venus = 3, Mars = 4, Jupiter = 5, Saturn = 6, Uranus = 7, Neptune = 8, Pluto = 9, Chiron = 10, Lilith = 11, ...)
collect_text Set to true if you want to retrieve the texts, false if you only want calculation
showLogo If true, shows the AstroAPI logo in the PDF. If false, the logo is hidden.
showNotes If true, a notes section is added at the end of the PDF. If false, the notes section is hidden.
showEndAstroapiPage If true, the last page of the PDF will contain the AstroAPI logo and a link to the AstroAPI website. If false, the last page is hidden.
encodedTemplate An encoded string containing the template to use for the PDF. See https://pdf-editor-v1-admin-ui-6xx.pages.dev/ for a live editor