AstrologyAPI

Puja Suggestion

POSThttps://json.astrologyapi.com/v1/puja_suggestion
Copy

The puja_suggestion API provides puja suggestions based on the user's horoscope and planetary combinations. The response includes a summary of the puja suggestions and a list of suggested pujas, each with a title, description, and one-line recommendation.

POST/puja_suggestion
Copy
1import requests
2import json
3
4# Your API key
5api_key = "<YOUR_API_KEY>"
6
7# API endpoint URL
8api_url = "https://json.astrologyapi.com/v1/puja_suggestion"
9
10# Request data
11data = {
12        "day": 10,
13        "month": 5,
14        "year": 1990,
15        "hour": 19,
16        "min": 55,
17        "lat": 19.2056,
18        "lon": 25.2056,
19        "tzone": 5.5
20    }
21
22headers = {
23    'x-astrologyapi-key': api_key,
24    'Content-Type': 'application/json'
25    # Add 'Accept-Language': '<language_code>' if needed
26}
27
28try:
29    response = requests.post(api_url, headers=headers, json=data)
30    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
31
32    # Process the response
33    response_data = response.json()
34    print(json.dumps(response_data, indent=4))
35
36except requests.exceptions.RequestException as e:
37    print(f"Error making API request: {e}")
38    if hasattr(e, 'response') and e.response is not None:
39        try:
40            print(f"Error response: {e.response.json()}")
41        except json.JSONDecodeError:
42             print(f"Error response (non-JSON): {e.response.text}")
43
44
200Response
Copy
1{
2  "summary": "Following are the puja suggestions based on your horoscope and planetary combinations.",
3  "suggestions": [
4    {
5      "status": true,
6      "priority": 5,
7      "title": "Kal Sarpa Dosha Shanti Pujan",
8      "puja_id": "KAL_SARPA",
9      "summary": "If all the 7 planets are situated between Rahu and Ketu then Kaal Sarp Yog is formed.According to the situation of Rahu in 12 houses of horoscope there are Kaal Sarp Yogas of 12 types. These are : 1. Anant, 2. Kulik, 3. Vasuki, 4. Shankhpal, 5. Padma, 6. Mahapadma, 7. Takshak, 8. Karkotak, 9. Shankhchud, 10. Ghaatak, 11. Vishdhar and 12. Sheshnag. The Kaal Sarp Yog is of two types- Ascending and Descending. If all the 7 planets are eaten away by Rahus mouth then it is Ascending Kaal Sarp Yog. If all planets are situated in back of Rahu then Descending Kaal Sarp Yog is formed.",
10      "one_line": "You have ascending kalsarpa dosha direction, which is treated as powerful. The KalSarpa Dosha is having partial effect in your horoscope."
11    },
12    {
13      "status": true,
14      "priority": 3,
15      "title": "Nakshatra Pujan",
16      "puja_id": "NAKSHATRA_PUJA",
17      "summary": "Moon nakshatra is one of the most important nakshatra is horoscope. In horoscope, fifth, seventh and ninth houses are for children, life partner and luck respectively. And if their lords are in vedha (obstructive position) with Moon naksahtra then various hardships might be faced in your life. To reduce the effect of obsctructions and make your constellations in sync with other house lords, Nakshatra Puja is recommended.",
18      "one_line": "Ninth house lord is in VIPAT vedha with your Moon nakshatra and therefore it is recommended that you perform nakshatra puja to mitigate evil effects of vedha."
19    }
20  ]
21}

Request Headers

Authorization

string

required

Basic Authorization via header

Accept-Language

string

Preferred language for the response content

Properties

English - enHindi - hiMarathi - maBengali - bnTamil - taTelugu - teMalayalam - mlKannada - kn

Request Parameters

day

int

required

Date of birth, eg: 10

month

int

required

Month of birth, eg: 5

year

int

required

Year of birth, eg: 1990

hour

int

required

Hour of birth, eg: 19

min

int

required

Minute of birth, eg: 55

lat

float

required

Latitude, eg: 19.2056

lon

float

required

Longitude, eg: 25.2056

tzone

float

required

Timezone, eg: 5.5

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.