---
title: "Kundli API-cURL example"
description: "Kundli Pro can be accessed through cURL as per example below. ``` ```"
url: "https://jyotishapi.com/docs/kundli-pro-curl-example/"
updated: "2026-08-23"
category: Kundli
---

# Kundli API-cURL example

Kundli Pro can be accessed through cURL as per example below.

```
<?php

    $url = "https://webastrohost.com/v2/vedic_ml/"; // use $url = "https://webastrohost.com/v2/kp_ml/"; for kp

$userid = 'xxxxx'; Your user id, will be sent to you through mail
$token = 'xxxxxxxxxxxxxxxxx';   your api key,will be sent to you through mail
$headers = array(
    'Method: GET',
    'Authorization: Basic '. base64_encode($userid.':'.$token)
);

$curl = curl_init();
$fields = array(

    'date' => $_POST["date"],
    'time' => $_POST["time"],
    'long' => $_POST["long"],
    'lat' => $_POST["lat"],
    'tzone' => $_POST["tzone"],
    'ayan' =>$_POST["ayan"]

);
$fields_string = http_build_query($fields);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
	echo "cURL Error #:" . $err;
} else {

  $data = json_decode($response);
?>
```
