Astro ChatBot API
Introducing the Astro ChatBot API, a simple and reliable way to let users ask any astrology question in plain language and get one grounded, chart-based answer back. You send a question and the person's birth details; DivineAPI fetches and compresses their chart, and streams back an answer written for a reader, not a developer. This API is designed for websites, mobile apps, chatbots, CRM dashboards, or astrology portals that want a conversational astrology experience instead of static reports.
It supports seven endpoints: one to ask a question inside a stored conversation, four to manage and inspect those conversations and your account, and one liveness check.
API Endpoint
POST https://ask.divineapi.com/sessionGuide: The full history of one conversation, for restoring a chat screen. Returns every message in order with its role and timestamp, plus the birth details stored against the session. Returns 404 if the session does not exist.
Authentication
Every request requires two headers:
| Header | Description |
|---|---|
Authorization | Bearer {api_acc_token} - identifies the user |
x-api-key | Use api_key |
Headers
| Name | Type | Description |
|---|---|---|
Content-Type* | String | application/json. Example: Content-Type: application/json |
Fields marked with * are mandatory.
Request Body
| Name | Type | Description |
|---|---|---|
user_id* | String | Your ID for the end user. Recorded on every request and used for usage reporting. |
| session_id* | String | Your ID for this conversation. A new ID starts a fresh thread. |
200: OK Answered Successfully
{
"session_id": "session090091",
"messages": [
{
"role": "user",
"text": "When will I get job?",
"ts": 1790748381.631
},
{
"role": "assistant",
"text": "Your chart suggests a meaningful job opportunity is most likely to develop from late 2026 into 2027, with progress building through persistence rather than one sudden stroke of luck.\n\nYou are approaching your Saturn return in Aries, exact around March 27, 2026. Because natal Saturn is in your 6th house of work and daily responsibilities, this is a serious career-building period: applications, training, routines, and accepting greater responsibility can lead to something more stable. It may feel slower than you want, but it favors lasting employment.\n\nYour progressed Midheaven is in Sagittarius, while progressed Jupiter is in the 11th house, supporting opportunities through networking, friends, professional communities, online platforms, education, or international connections.",
"ts": 1790748381.639
}
],
"birth_details": {
"day": "24",
"lat": "28.7041",
"lon": "77.1025",
"min": "40",
"hour": "14",
"year": "1996",
"month": "05",
"place": "New Delhi",
"tzone": "5.5",
"gender": "female",
"full_name": "Priya Sharma"
}
}Example Code Implementations
Below are example implementations in various programming environments.
cURL
curl --location 'https://ask.divineapi.com/session' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_acc_token}' \
--header 'x-api-key: {api-key}' \
--data '{
"session_id": "session090091",
"user_id": "u_8812dwqdq"
}'