AstrologyAPI

Matching Astro Details

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

This API provides astrological details for a male and a female. The response includes various details such as Varna, Vashya, Yoni, Gan, Nadi, SignLord, Naksahtra, Charan, Yog, Karan, Tithi, Yunja, Tatva, name alphabet, and paya for both male and female.

POST/match_astro_details
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/match_astro_details"
9
10# Request data
11data = {
12        "m_day": 10,
13        "m_month": 5,
14        "m_year": 1990,
15        "m_hour": 11,
16        "m_min": 55,
17        "m_lat": 19.2056,
18        "m_lon": 25.2056,
19        "m_tzone": 5.5,
20        "f_day": 10,
21        "f_month": 5,
22        "f_year": 1990,
23        "f_hour": 11,
24        "f_min": 55,
25        "f_lat": 19.2056,
26        "f_lon": 25.2056,
27        "f_tzone": 5.5
28    }
29
30headers = {
31    'x-astrologyapi-key': api_key,
32    'Content-Type': 'application/json'
33    # Add 'Accept-Language': '<language_code>' if needed
34}
35
36try:
37    response = requests.post(api_url, headers=headers, json=data)
38    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)
39
40    # Process the response
41    response_data = response.json()
42    print(json.dumps(response_data, indent=4))
43
44except requests.exceptions.RequestException as e:
45    print(f"Error making API request: {e}")
46    if hasattr(e, 'response') and e.response is not None:
47        try:
48            print(f"Error response: {e.response.json()}")
49        except json.JSONDecodeError:
50             print(f"Error response (non-JSON): {e.response.text}")
51
52
200Response
Copy
1{
2  "male_astro_details": {
3    "ascendant": "Libra",
4    "Varna": "Kshatriya",
5    "Vashya": "Chatuspad",
6    "Yoni": "Ashwa",
7    "Gan": "Dev",
8    "Nadi": "Adi",
9    "SignLord": "Mars",
10    "sign": "Aries",
11    "Naksahtra": "Ashwini",
12    "NaksahtraLord": "Ketu",
13    "Charan": 4,
14    "Yog": "Sukarma",
15    "Karan": "Vishti",
16    "Tithi": "Krishna Dashami",
17    "yunja": "Poorva",
18    "tatva": "Fire",
19    "name_alphabet": "La",
20    "paya": "Gold"
21  },
22  "female_astro_details": {
23    "ascendant": "Libra",
24    "Varna": "Kshatriya",
25    "Vashya": "Chatuspad",
26    "Yoni": "Ashwa",
27    "Gan": "Dev",
28    "Nadi": "Adi",
29    "SignLord": "Mars",
30    "sign": "Aries",
31    "Naksahtra": "Ashwini",
32    "NaksahtraLord": "Ketu",
33    "Charan": 4,
34    "Yog": "Sukarma",
35    "Karan": "Vishti",
36    "Tithi": "Krishna Dashami",
37    "yunja": "Poorva",
38    "tatva": "Fire",
39    "name_alphabet": "La",
40    "paya": "Gold"
41  }
42}

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

m_day

int

required

Day of birth, eg: 10

m_month

int

required

Month of birth, eg: 5

m_year

int

required

Year of birth, eg: 1990

m_hour

int

required

Hour of birth, eg: 11

m_min

int

required

Minute of birth, eg: 55

m_lat

float

required

Latitude, eg: 19.2056

m_lon

float

required

Longitude, eg: 25.2056

m_tzone

float

required

Timezone, eg: 5.5

f_day

int

required

Day of birth, eg: 10

f_month

int

required

Month of birth, eg: 5

f_year

int

required

Year of birth, eg: 1990

f_hour

int

required

Hour of birth, eg: 11

f_min

int

required

Minute of birth, eg: 55

f_lat

float

required

Latitude, eg: 19.2056

f_lon

float

required

Longitude, eg: 25.2056

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