API Reference
AI Astrology API · Kundali API · Compatibility Matching API — trusted by 350,000+ users.
Quick Start
Go from zero to a working astrology integration in about 15 minutes.
Sign up free — 10 credits included.
Copy from your dashboard.
POST birth details to start_chat.
Ask questions via send_message.
Get detailed Vedic predictions.
Introduction
AstroVoice API exposes our production Vedic astrology engine for three use cases: AI astrology chat, Kundali analysis, and compatibility matching (matrimony). Use POST /api/start_chat.php with type: single or type: matchmaking, then send follow-up questions via send_message.
Credits: 1 credit = 1 successful astrology API request (chat, kundali, compatibility, numerology, or horoscope). View pricing.
Base URL: https://astrovoice.ai/astrovoice-apis/api/
Content-Type: application/json for all POST requests.
Authentication
Include your API key in every request header. Get your key from the dashboard after signing up.
Never expose your API key in client-side code. Make requests from your backend server.
Rate Limits & Credits
- Plans include monthly credits: Free (10), Developer (40), Starter (250), Growth (2,500), Business (10,000)
- 402 returned when your credit balance is exhausted
- 429 returned when per-minute rate limit is exceeded
- Check remaining credits in your dashboard
Built for profitable businesses. Most customers charge ₹5–₹50 per consultation while spending only a fraction of that through AstroVoice API.
Error Handling
All errors return JSON with status and message fields.
| HTTP Code | Meaning | Action |
|---|---|---|
| 401 | Invalid or missing API Key | Check X-API-Key header |
| 402 | Credit Balance Exhausted | Upgrade plan or purchase more credits |
| 404 | Chat Session Not Found | Verify chat_id from start_chat |
| 429 | Rate Limit Exceeded | Retry after a short delay |
| 500 | Internal Server Error | Retry; contact support if persistent |
Endpoints
Two endpoints power the full astrology conversation flow.
POST /api/start_chat.php
Creates a new astrology session. Set type to single (default) for individual chat, or matchmaking for kundali compatibility between two profiles.
Common Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | No | single (default) or matchmaking |
| user_language | string | Yes | One of 56+ supported languages — see full list |
| astrologer_name | string | Yes | Oracle or Astra |
Single Mode (type: single)
| Field | Type | Required | Description |
|---|---|---|---|
| user_name | string | Yes | User's full name |
| dob | string | Yes | Date of birth (DD/MM/YYYY) |
| tob | string | Yes | Time of birth (HH:MM) |
| pob | string | Yes | Place of birth (city) |
| gender | string | Yes | Male / Female |
| married_status | string | No | Defaults to Single |
| birth_lat | string | Yes | Birth latitude |
| birth_lang | string | Yes | Birth longitude |
Single Request Example
{
"type": "single",
"user_name": "John Doe",
"dob": "15/08/1990",
"tob": "10:30",
"pob": "Delhi",
"gender": "Male",
"married_status": "Single",
"birth_lat": "28.6139",
"birth_lang": "77.2090",
"user_language": "English",
"astrologer_name": "Oracle"
}
Single Response Example
{
"success": true,
"status": "success",
"type": "single",
"chat_id": "chat_847291",
"message": "Namaste John Doe ji, I am Oracle. Based on your birth chart..."
}
Compatibility Matching API
Generate Ashtakoot kundali matching and compatibility scores for matrimony, dating, and relationship apps. Uses the same production engine as the AstroVoice consumer app (chats/startChat.php partner matching workflow).
Purpose: Compare boy and girl birth charts, compute Ashtakoot score (out of 36), return compatibility percentage, summary, and a chat_id for follow-up questions via send_message.
Each compatibility report consumes 1 credit at start_chat time — same as any astrology request.
Matchmaking Parameters (type: matchmaking)
| Field | Type | Required | Description |
|---|---|---|---|
| boy_name | string | Yes | Boy's full name |
| boy_dob | string | Yes | DD/MM/YYYY |
| boy_tob | string | Yes | HH:MM |
| boy_pob | string | Yes | Place of birth |
| boy_birth_lat | string | Yes | Boy birth latitude |
| boy_birth_lang | string | Yes | Boy birth longitude |
| girl_name | string | Yes | Girl's full name |
| girl_dob | string | Yes | DD/MM/YYYY |
| girl_tob | string | Yes | HH:MM |
| girl_pob | string | Yes | Place of birth |
| girl_birth_lat | string | Yes | Girl birth latitude |
| girl_birth_lang | string | Yes | Girl birth longitude |
Matchmaking Request Example
{
"type": "matchmaking",
"boy_name": "Rahul",
"boy_dob": "15/08/1990",
"boy_tob": "10:30",
"boy_pob": "Delhi",
"boy_birth_lat": "28.6139",
"boy_birth_lang": "77.2090",
"girl_name": "Priya",
"girl_dob": "20/03/1992",
"girl_tob": "15:45",
"girl_pob": "Mumbai",
"girl_birth_lat": "19.0760",
"girl_birth_lang": "72.8777",
"user_language": "English",
"astrologer_name": "Oracle"
}
Matchmaking Response Example
{
"success": true,
"status": "success",
"type": "matchmaking",
"chat_id": "match_847291",
"compatibility_score": 82,
"ashtakoot_score": 29.5,
"ashtakoot_full_score": 36,
"summary": "Strong compatibility with excellent emotional and communication alignment.",
"message": "Based on both birth charts, Rahul and Priya have an Ashtakoot compatibility score of 29.5/36 (82%)...",
"astakoot_data": { "current_score": 29.5, "full_score": 36, "verdict": "...", "kootas": [] }
}
PHP — Matchmaking
<?php
$apiKey = 'YOUR_API_KEY';
$ch = curl_init('https://astrovoice.ai/astrovoice-apis/api/start_chat.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'X-API-Key: ' . $apiKey],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'matchmaking',
'boy_name' => 'Rahul', 'boy_dob' => '15/08/1990', 'boy_tob' => '10:30', 'boy_pob' => 'Delhi',
'boy_birth_lat' => '28.6139', 'boy_birth_lang' => '77.2090',
'girl_name' => 'Priya', 'girl_dob' => '20/03/1992', 'girl_tob' => '15:45', 'girl_pob' => 'Mumbai',
'girl_birth_lat' => '19.0760', 'girl_birth_lang' => '72.8777',
'user_language' => 'English', 'astrologer_name' => 'Oracle',
]),
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
echo 'Score: ' . $result['compatibility_score'] . '%';
Node.js — Matchmaking
const res = await fetch('https://astrovoice.ai/astrovoice-apis/api/start_chat.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': 'YOUR_API_KEY' },
body: JSON.stringify({
type: 'matchmaking',
boy_name: 'Rahul', boy_dob: '15/08/1990', boy_tob: '10:30', boy_pob: 'Delhi',
boy_birth_lat: '28.6139', boy_birth_lang: '77.2090',
girl_name: 'Priya', girl_dob: '20/03/1992', girl_tob: '15:45', girl_pob: 'Mumbai',
girl_birth_lat: '19.0760', girl_birth_lang: '72.8777',
user_language: 'English', astrologer_name: 'Oracle'
})
});
const data = await res.json();
console.log(data.compatibility_score, data.summary);
Python — Matchmaking
import requests
r = requests.post('https://astrovoice.ai/astrovoice-apis/api/start_chat.php',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={
'type': 'matchmaking',
'boy_name': 'Rahul', 'boy_dob': '15/08/1990', 'boy_tob': '10:30', 'boy_pob': 'Delhi',
'boy_birth_lat': '28.6139', 'boy_birth_lang': '77.2090',
'girl_name': 'Priya', 'girl_dob': '20/03/1992', 'girl_tob': '15:45', 'girl_pob': 'Mumbai',
'girl_birth_lat': '19.0760', 'girl_birth_lang': '72.8777',
'user_language': 'English', 'astrologer_name': 'Oracle'
})
print(r.json()['compatibility_score'])
cURL — Matchmaking
curl -X POST 'https://astrovoice.ai/astrovoice-apis/api/start_chat.php' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"type":"matchmaking","boy_name":"Rahul","boy_dob":"15/08/1990","boy_tob":"10:30","boy_pob":"Delhi","boy_birth_lat":"28.6139","boy_birth_lang":"77.2090","girl_name":"Priya","girl_dob":"20/03/1992","girl_tob":"15:45","girl_pob":"Mumbai","girl_birth_lat":"19.0760","girl_birth_lang":"72.8777","user_language":"English","astrologer_name":"Oracle"}'
POST /api/send_message.php
Continue an existing astrology conversation. Use the chat_id returned from start_chat.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| chat_id | string | Yes | Session ID from start_chat |
| message | string | Yes | User's astrology question (max 2000 chars) |
Request Example
{
"chat_id": "chat_847291",
"message": "Will I get a promotion this year?"
}
Response Example
{
"status": "success",
"response": "According to your birth chart, Jupiter transits your 10th house..."
}
Supported Languages
Pass the exact language name in user_language on every start_chat request. AstroVoice supports 56 languages — the same lists exposed by apis/languages.php (Indian) and apis/languages_usd.php (international).
Indian Languages (23)
International Languages (33)
Example
Welcome messages and AI responses are returned in the requested language. Use the exact spelling from the lists above (e.g. Chinese (Mandarin), Filipino (Tagalog)).
Code Examples
PHP
<?php
$apiKey = 'YOUR_API_KEY';
$base = 'https://astrovoice.ai/astrovoice-apis/api/';
// Step 1: Start chat
$ch = curl_init($base . 'start_chat.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'X-API-Key: ' . $apiKey],
CURLOPT_POSTFIELDS => json_encode([
'user_name' => 'John Doe',
'dob' => '15/08/1990',
'tob' => '10:30',
'pob' => 'Delhi',
'gender' => 'Male',
'married_status' => 'Single',
'birth_lat' => '28.6139',
'birth_lang' => '77.2090',
'user_language' => 'English',
'astrologer_name' => 'Oracle',
]),
CURLOPT_RETURNTRANSFER => true,
]);
$session = json_decode(curl_exec($ch), true);
$chatId = $session['chat_id'];
// Step 2: Send message
$ch = curl_init($base . 'send_message.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'X-API-Key: ' . $apiKey],
CURLOPT_POSTFIELDS => json_encode(['chat_id' => $chatId, 'message' => 'Will I get married this year?']),
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
Node.js
const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://astrovoice.ai/astrovoice-apis/api/';
const session = await fetch(BASE + 'start_chat.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY },
body: JSON.stringify({
user_name: 'John Doe', dob: '15/08/1990', tob: '10:30', pob: 'Delhi',
gender: 'Male', married_status: 'Single',
birth_lat: '28.6139', birth_lang: '77.2090',
user_language: 'English', astrologer_name: 'Oracle'
})
}).then(r => r.json());
const answer = await fetch(BASE + 'send_message.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY },
body: JSON.stringify({ chat_id: session.chat_id, message: 'Will I get married this year?' })
}).then(r => r.json());
console.log(answer);
Python
import requests
API_KEY = 'YOUR_API_KEY'
BASE = 'https://astrovoice.ai/astrovoice-apis/api/'
headers = {'X-API-Key': API_KEY}
session = requests.post(f'{BASE}start_chat.php', headers=headers, json={
'user_name': 'John Doe', 'dob': '15/08/1990', 'tob': '10:30', 'pob': 'Delhi',
'gender': 'Male', 'married_status': 'Single',
'birth_lat': '28.6139', 'birth_lang': '77.2090',
'user_language': 'English', 'astrologer_name': 'Oracle'
}).json()
answer = requests.post(f'{BASE}send_message.php', headers=headers, json={
'chat_id': session['chat_id'],
'message': 'Will I get married this year?'
}).json()
print(answer)
cURL
curl -X POST 'https://astrovoice.ai/astrovoice-apis/api/start_chat.php' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"user_name":"John Doe","dob":"15/08/1990","tob":"10:30","pob":"Delhi","gender":"Male","married_status":"Single","birth_lat":"28.6139","birth_lang":"77.2090","user_language":"English","astrologer_name":"Oracle"}'
Best Practices
- Server-side only: Never embed API keys in mobile apps or browser JavaScript.
- Store chat_id: Persist the
chat_idper user session for follow-up questions. - Validate birth data: Ensure accurate DOB, TOB, and coordinates for best predictions.
- Handle credits: Monitor remaining credits in dashboard; prompt users to upgrade before balance runs out.
- Retry logic: Retry 429 and 500 errors with exponential backoff.
- Language: Pass the user's preferred language in
user_languagefor localized responses.
Common Errors
| Error | Cause | Fix |
|---|---|---|
| Missing API Key | No X-API-Key header | Add header with your dashboard key |
| Invalid API Key | Wrong or regenerated key | Copy active key from dashboard |
| Chat not found | Invalid or expired chat_id | Call start_chat again |
| Quota exceeded | Monthly credit limit reached | Upgrade plan |
| Missing field | Required parameter omitted | Check request body against docs |
FAQ
Ready to build?
Get your API key in under 2 minutes. 10 free credits included.