Copy page

Copy page as Markdown for LLMs

View as Markdown

View this page as plain text


Open in ChatGPT

Ask ChatGPT about this page

Open in Claude

Ask Claude about this page

KP Prashna Instant Questions API

Introducing the KP Prashna Instant Questions API, a simple and reliable way to fetch a predefined list of commonly asked horary astrology questions along with their corresponding house significators. This API is designed to help users select questions from a predefined list rather than entering free-text questions.


Supported Language Codes

Reference Article:
https://support.divineapi.com/general-api-support/translating-an-indian-vedic-apis-into-a-different-language

CodeLanguage
enEnglish
hiHindi
bnBengali
maMarathi
tmTamil
tlTelugu
mlMalayalam
knKannada

Guide:
Use the lan parameter in your request body to set your preferred response language. Default language is English (en).


API Endpoint

POST https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions

This endpoint calculates the KP-style planetary positions based on provided birth details.


Headers

NameTypeDescription
AuthorizationStringYour API access token. Example: Bearer {token}

Request Body

NameTypeRequiredDescription
api_keyStringYesYour API key.

200: OK KP Prashna Instant Questions fetched successfully

{
    "success": 1,
    "data": {
        "questions": [
            {
                "key": "marriage",
                "question": "Will I get married soon?",
                "house_hint": [
                    2,
                    7,
                    11
                ]
            },
            {
                "key": "job",
                "question": "Will I get a job soon?",
                "house_hint": [
                    2,
                    6,
                    10,
                    11
                ]
            },
            {
                "key": "health",
                "question": "Will I recover from this illness?",
                "house_hint": [
                    1,
                    6,
                    8,
                    12
                ]
            },
            {
                "key": "property",
                "question": "Will I acquire this property?",
                "house_hint": [
                    4,
                    11,
                    12
                ]
            },
            {
                "key": "foreign_travel",
                "question": "Will I travel/settle abroad?",
                "house_hint": [
                    3,
                    9,
                    12
                ]
            },
            {
                "key": "business",
                "question": "Will my business succeed?",
                "house_hint": [
                    7,
                    10,
                    11
                ]
            },
            {
                "key": "litigation",
                "question": "Will I win this court case?",
                "house_hint": [
                    1,
                    6,
                    7,
                    11
                ]
            },
            {
                "key": "education",
                "question": "Will I pass this exam?",
                "house_hint": [
                    4,
                    9,
                    11
                ]
            },
            {
                "key": "finance",
                "question": "Will I recover this money?",
                "house_hint": [
                    2,
                    6,
                    11
                ]
            },
            {
                "key": "lost_object",
                "question": "Will I find this lost item?",
                "house_hint": [
                    2,
                    8,
                    11
                ]
            },
            {
                "key": "progeny",
                "question": "Will I have a child soon?",
                "house_hint": [
                    2,
                    5,
                    11
                ]
            },
            {
                "key": "short_travel",
                "question": "Will this journey be successful?",
                "house_hint": [
                    3,
                    11
                ]
            }
        ]
    }
}

Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions' \
--header 'Authorization: Bearer {Your Auth Token}' \
--form 'api_key="{Your API Key}"'
curl -X POST "https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions" \
  -H "Authorization: Bearer {Your Auth Token}" \
  --form 'api_key="{Your API Key}"'
const FormData = require('form-data');
const axios = require('axios');

const form = new FormData();
form.append('api_key', '{Your API Key}');

const response = await axios.post('https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions', form, {
  headers: {
    ...form.getHeaders(),
    'Authorization': 'Bearer {Your Auth Token}',
  }
});

console.log(response.data);
import requests

url = "https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions"
headers = {
    "Authorization": "Bearer {Your Auth Token}",
}
payload = {
    "api_key": "{Your API Key}",
}

response = requests.post(url, headers=headers, data=payload)

print(response.json())
const formData = new FormData();
formData.append('api_key', '{Your API Key}');

const response = await fetch('https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions', {
  method: 'POST',
  headers: {
      'Authorization': "Bearer {Your Auth Token}",
    },
  body: formData,
});

const data = await response.json();
console.log(data);
<?php

use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('POST', 'https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions', [
    'headers' => [
        'Authorization' => 'Bearer {Your Auth Token}',
    ],
    'multipart' => [
        ['name' => 'api_key', 'contents' => '{Your API Key}'],
    ],
]);

echo $response->getBody();
package main

import (
    "bytes"
    "fmt"
    "mime/multipart"
    "net/http"
    "io"
)

func main() {
    body := &bytes.Buffer{}
    writer := multipart.NewWriter(body)
    writer.WriteField("api_key", "{Your API Key}")
    writer.Close()

    req, _ := http.NewRequest("POST", "https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions", body)
    req.Header.Set("Content-Type", writer.FormDataContentType())
    req.Header.Set("Authorization", "Bearer {Your Auth Token}")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body2, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body2))
}
import okhttp3.*;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();

        RequestBody body = new MultipartBody.Builder()
            .setType(MultipartBody.FORM)
            .addFormDataPart("api_key", "{Your API Key}")
            .build();

        Request request = new Request.Builder()
            .url("https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions")
            .post(body)
            .addHeader("Authorization", "Bearer {Your Auth Token}")
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}
import Foundation

let url = URL(string: "https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer {Your Auth Token}", forHTTPHeaderField: "Authorization")

let boundary = "Boundary-\(UUID().uuidString)"
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

var bodyData = Data()
bodyData.append("--\(boundary)\r\n".data(using: .utf8)!)
bodyData.append("Content-Disposition: form-data; name=\"api_key\"\r\n\r\n".data(using: .utf8)!)
bodyData.append("{Your API Key}\r\n".data(using: .utf8)!)
bodyData.append("--\(boundary)--\r\n".data(using: .utf8)!)
request.httpBody = bodyData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}
task.resume()
import okhttp3.*

fun main() {
    val client = OkHttpClient()

    val body = MultipartBody.Builder()
        .setType(MultipartBody.FORM)
        .addFormDataPart("api_key", "{Your API Key}")
        .build()

    val request = Request.Builder()
        .url("https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions")
        .post(body!!)
        .addHeader("Authorization", "Bearer {Your Auth Token}")
        .build()

    client.newCall(request).execute().use { response ->
        println(response.body?.string())
    }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
    static async Task Main() {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer {Your Auth Token}");

        var content = new MultipartFormDataContent();
        content.Add(new StringContent("{Your API Key}"), "api_key");

        var response = await client.PostAsync("https://astroapi-3.divineapi.com/indian-api/v1/kp-prashna/instant-questions", content);
        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}
Response 200
{
    "success": 1,
    "data": {
        "questions": [
            {
                "key": "marriage",
                "question": "Will I get married soon?",
                "house_hint": [
                    2,
                    7,
                    11
                ]
            },
            {
                "key": "job",
                "question": "Will I get a job soon?",
                "house_hint": [
                    2,
                    6,
                    10,
                    11
                ]
            },
            {
                "key": "health",
                "question": "Will I recover from this illness?",
                "house_hint": [
                    1,
                    6,
                    8,
                    12
                ]
            },
            {
                "key": "property",
                "question": "Will I acquire this property?",
                "house_hint": [
                    4,
                    11,
                    12
                ]
            },
            {
                "key": "foreign_travel",
                "question": "Will I travel/settle abroad?",
                "house_hint": [
                    3,
                    9,
                    12
                ]
            },
            {
                "key": "business",
                "question": "Will my business succeed?",
                "house_hint": [
                    7,
                    10,
                    11
                ]
            },
            {
                "key": "litigation",
                "question": "Will I win this court case?",
                "house_hint": [
                    1,
                    6,
                    7,
                    11
                ]
            },
            {
                "key": "education",
                "question": "Will I pass this exam?",
                "house_hint": [
                    4,
                    9,
                    11
                ]
            },
            {
                "key": "finance",
                "question": "Will I recover this money?",
                "house_hint": [
                    2,
                    6,
                    11
                ]
            },
            {
                "key": "lost_object",
                "question": "Will I find this lost item?",
                "house_hint": [
                    2,
                    8,
                    11
                ]
            },
            {
                "key": "progeny",
                "question": "Will I have a child soon?",
                "house_hint": [
                    2,
                    5,
                    11
                ]
            },
            {
                "key": "short_travel",
                "question": "Will this journey be successful?",
                "house_hint": [
                    3,
                    11
                ]
            }
        ]
    }
}