AstrologyAPI

Synastry Report PDF API

POSThttps://pdf.astrologyapi.com/v1/synastry_couple_report/tropical
Copy

The Synastry Report API generates PDF horoscope based on the birth details provided in the request data.

The request data also has number of other options such as border style, footer links, lord Ganesha picture style and other last page details. These options can be used to customise the PDF as per your company and brand requirement.

The PDF API in response provides you with a PDF URL from where either your user can download the PDF or you can directly send the PDF horoscope on your user’s email address. The usage of PDF horoscope can be completely customised as per your requirements.

POST/synastry_couple_report/tropical
Copy
1import requests
2import json
3
4# Your API key
5api_key = "<YOUR_API_KEY>"
6
7# API endpoint URL
8api_url = "https://pdf.astrologyapi.com/v1/synastry_couple_report/tropical"
9
10# Request data
11data = {
12        "p_first_name": 15,
13        "p_last_name": 15,
14        "p_day": 15,
15        "p_month": 8,
16        "p_year": 1990,
17        "p_hour": 10,
18        "p_minute": 30,
19        "p_latitude": 39.9526,
20        "p_longitude": -75.1652,
21        "p_timezone": -5,
22        "p_place": "tropical",
23        "footer_link": "tropical",
24        "s_first_name": 15,
25        "s_last_name": 15,
26        "s_day": 15,
27        "s_month": 8,
28        "s_year": 1990,
29        "s_hour": 10,
30        "s_minute": 30,
31        "s_latitude": 39.9526,
32        "s_longitude": -75.1652,
33        "s_timezone": -5,
34        "s_place": "tropical",
35        "language": "tropical",
36        "logo_url": "tropical",
37        "company_name": "tropical",
38        "company_info": "tropical",
39        "domain_url": "tropical",
40        "company_email": "tropical",
41        "company_landline": "tropical",
42        "company_mobile": "tropical"
43    }
44
45headers = {
46    'x-astrologyapi-key': api_key,
47    'Content-Type': 'application/json'
48    # Add 'Accept-Language': '<language_code>' if needed
49}
50
51try:
52    response = requests.post(api_url, headers=headers, json=data)
53    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
54
55    # Process the response
56    response_data = response.json()
57    print(json.dumps(response_data, indent=4))
58
59except requests.exceptions.RequestException as e:
60    print(f"Error making API request: {e}")
61    if hasattr(e, 'response') and e.response is not None:
62        try:
63            print(f"Error response: {e.response.json()}")
64        except json.JSONDecodeError:
65             print(f"Error response (non-JSON): {e.response.text}")
66
67
200Response
Copy
1{
2  "status": true,
3  "pdf_url": "https://s3.amazonaws.com/astrologyapi-pdfs/synastry_report_sample.pdf"
4}

Request Headers

Authorization

string

required

Basic Authorization via header

Accept-Language

string

Preferred language for the response content

Properties

English - enPortuguese - ptGerman - deFrench - frSpanish - esItalian - itRussian - ru

Request Parameters

p_first_name

string

required

Your first name, eg: "Sanjay"

p_last_name

string

required

Your last name, eg: "Sharma"

p_day

integer

required

Birth date of your's, eg: 01

p_month

integer

required

Birth month of your's, eg: 05

p_year

integer

required

Birth year of your's, eg: 2000

p_hour

integer

required

Birth hour of your's, eg: 07

p_minute

integer

required

Birth minute of your's, eg: 10

p_latitude

float

required

Latitude of your's birth place, eg: 19.231

p_longitude

float

required

Longitude of your's birth place, eg: 72.4242

p_timezone

float

required

Timezone of your's birth place, eg: 5.5

p_place

string

required

Your's birth place, eg: "Mumbai,Maharashtra India"

footer_link

string

required

Your domain link , eg: "astrologyapi.com""

s_first_name

string

required

Your first name, eg: "Sanjay"

s_last_name

string

required

Your last name, eg: "Sharma"

s_day

integer

required

Birth date of your's, eg: 01

s_month

integer

required

Birth month of your's, eg: 05

s_year

integer

required

Birth year of your's, eg: 2000

s_hour

integer

required

Birth hour of your's, eg: 07

s_minute

integer

required

Birth minute of your's, eg: 10

s_latitude

float

required

Latitude of your's birth place, eg: 19.231

s_longitude

float

required

Longitude of your's birth place, eg: 72.4242

s_timezone

float

required

Timezone of your's birth place, eg: 5.5

s_place

string

required

Your's birth place, eg: "Mumbai,Maharashtra India"

language

string

required

Pdf Language, eg :en,hi

Properties

enhi
logo_url

string

required

Your company logo url , eg: "logo_url"

company_name

string

required

Your company name , eg: "Vedic Rishi Astro Solutions Pvt. Ltd."

company_info

string

required

NOTE- SHOULD BE LESS THAN 500 CHARACTER , eg: "Your Company Info"

domain_url

string

required

Your domain full url , eg: "https://www.astrologyapi.com"

company_email

string

required

Your company email , eg: "[email protected]"

company_landline

string

required

Your company Landline number , eg: "+91- 221232 22"

company_mobile

string

required

Your company mobile number, eg: "+91 1212 1212 12"

The Synastry Report PDF Samples

Following are the The Synastry Report PDF API samples you can download. These generated PDFs are using AstrologyAPI branding and everything can be customised to suit your company branding and style.

English PDF Sample Sample
View Sample

English PDF Sample

 Portuguese PDF Sample Sample
View Sample

Portuguese PDF Sample

 Spanish PDF Sample Sample
View Sample

Spanish PDF Sample

 French PDF Sample Sample
View Sample

French PDF Sample

 German PDF Sample Sample
View Sample

German PDF Sample

 Italian PDF Sample Sample
View Sample

Italian PDF Sample

 Russian PDF Sample Sample
View Sample

Russian PDF Sample

Errors

400
Bad Request

Something is wrong with your request format or parameters.

401
Unauthorized

Your API key is missing or invalid.

403
Forbidden

You don't have permission to access this specific resource.

404
Not Found

The API endpoint you're trying to reach doesn't exist.

500
Internal Server Error

Our server is having a temporary glitch.