AstrologyAPI

Professional Horoscope PDF API

POSThttps://pdf.astrologyapi.com/v1/pro_horoscope_pdf
Copy

The Professional PDF 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/pro_horoscope_pdf
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/pro_horoscope_pdf"
9
10# Request data
11data = {
12        "name": 15,
13        "gender": 15,
14        "day": 15,
15        "month": 8,
16        "year": 1990,
17        "hour": 10,
18        "min": 30,
19        "lat": 39.9526,
20        "lon": -75.1652,
21        "language": "tropical",
22        "tzone": -5,
23        "place": "tropical",
24        "chart_style": "tropical",
25        "footer_link": "tropical",
26        "logo_url": "tropical",
27        "company_name": "tropical",
28        "company_info": "tropical",
29        "domain_url": "tropical",
30        "company_email": "tropical",
31        "company_landline": "tropical",
32        "company_mobile": "tropical"
33    }
34
35headers = {
36    'x-astrologyapi-key': api_key,
37    'Content-Type': 'application/json'
38    # Add 'Accept-Language': '<language_code>' if needed
39}
40
41try:
42    response = requests.post(api_url, headers=headers, json=data)
43    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
44
45    # Process the response
46    response_data = response.json()
47    print(json.dumps(response_data, indent=4))
48
49except requests.exceptions.RequestException as e:
50    print(f"Error making API request: {e}")
51    if hasattr(e, 'response') and e.response is not None:
52        try:
53            print(f"Error response: {e.response.json()}")
54        except json.JSONDecodeError:
55             print(f"Error response (non-JSON): {e.response.text}")
56
57
200Response
Copy
1{
2  "status": true,
3  "pdf_url": "https://s3.amazonaws.com/astrologyapi-pdfs/professional_horoscope_sample.pdf"
4}

Request Headers

Authorization

string

required

Basic Authorization via header

Accept-Language

string

Preferred language for the response content

Properties

English - enHindi - hi

Request Parameters

name

string

required

Name of the user, eg: "Ajeet Kanojia"

gender

string

required

Gender of the user, eg: "male"

day

integer

required

Birth day (1-31)

month

integer

required

Birth month (1-12)

year

integer

required

Birth year (e.g., 1990)

hour

integer

required

Birth hour (0-23)

min

integer

required

Birth minute (0-59)

lat

float

required

Latitude of birth location

lon

float

required

Longitude of birth location

language

string

required

Pdf Language eg. en,hi,ma,bn,ta,te,kn,ml

Properties

enhimabntateknml
tzone

float

required

Timezone offset (e.g., -5 for EST)

place

string

required

User birth place , eg: "Mumbai,Maharashtra India"

chart_style

string

required

For south style SOUTH_INDIAN OR for eastern style EAST_INDIAN , eg: "NORTH_INDIAN"

footer_link

string

required

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

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"

Professional PDF Horoscope Samples

Following are the Professional PDF horoscope samples you can download. These generated PDFs are using Vedic Rishi Astro branding and everything can be customised to suit your company branding and style.

 PDF Sample Sample
View Sample

PDF Sample

Hindi PDF Sample Sample
View Sample

Hindi 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.