Back to Docs

Manual Compatibility

POST/api/v1/vedic/compatibility

Calculate Ashtakoota compatibility using Moon Nakshatra and Sign IDs directly. Use this if you already have chart data and want to avoid recalculating positions.

Tip: If you have birth times, use /match instead - it calculates Moon positions automatically.

Full URL

https://astro-api-1qnc.onrender.com/api/v1/vedic/compatibility

Request Parameters

ParameterTypeRequiredDescription
person1_moon_nakshatraintegerYesPerson 1 Moon Nakshatra ID (1-27)
person1_moon_signintegerYesPerson 1 Moon Sign ID (1-12)
person2_moon_nakshatraintegerYesPerson 2 Moon Nakshatra ID (1-27)
person2_moon_signintegerYesPerson 2 Moon Sign ID (1-12)

Nakshatra ID Reference (1-27)

1
Ashwini
2
Bharani
3
Krittika
4
Rohini
5
Mrigashira
6
Ardra
7
Punarvasu
8
Pushya
9
Ashlesha
10
Magha
11
P.Phalguni
12
U.Phalguni
13
Hasta
14
Chitra
15
Swati
16
Vishakha
17
Anuradha
18
Jyeshtha
19
Mula
20
P.Ashadha
21
U.Ashadha
22
Shravana
23
Dhanishta
24
Shatabhisha
25
P.Bhadra
26
U.Bhadra
27
Revati

Moon Sign ID Reference (1-12)

1
Aries
2
Taurus
3
Gemini
4
Cancer
5
Leo
6
Virgo
7
Libra
8
Scorpio
9
Sagittarius
10
Capricorn
11
Aquarius
12
Pisces

Sample Code

import requests
import json

url = "https://astro-api-1qnc.onrender.com/api/v1/vedic/compatibility"

# Use Moon Nakshatra IDs (1-27) and Sign IDs (1-12)
payload = {
    "person1_moon_nakshatra": 1,   # Ashwini
    "person1_moon_sign": 1,         # Aries
    "person2_moon_nakshatra": 10,   # Magha
    "person2_moon_sign": 5          # Leo
}

headers = {
    "Content-Type": "application/json",
    "x-api-key": "YOUR_API_KEY"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

Response Data

{
  "total_score": 28.5,
  "max_score": 36.0,
  "percentage": 79.2,
  "recommendation": "Good match",
  
  "details": {
    "varna": {
      "score": 1.0,
      "max": 1.0,
      "p1_varna": "Kshatriya",
      "p2_varna": "Kshatriya"
    },
    "vashya": {
      "score": 2.0,
      "max": 2.0,
      "p1_vashya": "Chatushpad",
      "p2_vashya": "Vanchar"
    },
    "tara": {
      "score": 3.0,
      "max": 3.0,
      "tara_count": 2,
      "tara_name": "Sampat"
    },
    "yoni": {
      "score": 4.0,
      "max": 4.0,
      "p1_yoni": "Horse",
      "p2_yoni": "Rat",
      "compatibility": "Friendly"
    },
    "graha_maitri": {
      "score": 5.0,
      "max": 5.0,
      "p1_lord": "Mars",
      "p2_lord": "Sun",
      "relationship": "Friend"
    },
    "gana": {
      "score": 6.0,
      "max": 6.0,
      "p1_gana": "Deva",
      "p2_gana": "Deva"
    },
    "bhakoot": {
      "score": 7.0,
      "max": 7.0,
      "distance": 5,
      "bhakoot_type": "5-9 (Auspicious)"
    },
    "nadi": {
      "score": 0.5,
      "max": 8.0,
      "p1_nadi": "Vata",
      "p2_nadi": "Pitta",
      "dosha": false
    }
  }
}

Related Endpoints