Hora chart (D2 Chart) SVG Image Code
Generate Hora (D2) divisional horoscope charts in SVG format using birth date, time, and geographical details. Visualize planetary placements in the D2 chart with customizable chart layouts, language, and display settings. Ideal for integrating wealth and financial astrology analysis into Vedic astrology applications.
Overview
The D2 Chart SVG API generates a Hora (D2) divisional horoscope chart in scalable vector graphics (SVG) format using an individual's birth date, time, latitude, longitude, and timezone. In Vedic astrology, the Hora chart is derived by dividing each zodiac sign into two equal parts and is primarily used to study wealth, financial status, accumulated resources, and material prosperity.
The generated chart provides a visual representation of planetary placements in the two Hora divisions. Astrologers use the D2 chart to examine financial potential, wealth accumulation, family finances, inheritance, and other aspects of material well-being.
The API supports configuration options such as Ayanamsha selection and observation point, allowing developers to choose between geocentric and topocentric planetary calculations. It also supports multiple languages, including English and Telugu, for generating localized horoscope charts.
The response contains the generated SVG markup, which can be embedded directly into websites, mobile applications, and astrology software. You can also save the SVG output as an image file while retaining its scalability and visual quality.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
year
|
integer | Yes | Year number, eg: 2023 | 2023 |
month
|
integer | Yes | Month number,with no leading zero | 7 |
date
|
integer | Yes | Day number,with no leading zero | 5 |
hours
|
integer | Yes | Hours number,with no leading zero | 1 |
minutes
|
integer | Yes | Minutes number,with no leading zero | 1 |
seconds
|
integer | Yes | Seconds number, with no leading zero | 0 |
latitude
|
float | Yes | Latitude number, in the range from -90 to 90 | 12.86 |
longitude
|
float | Yes | Longitude number, in the range from -180 to 180 | 123.5 |
timezone
|
float | Yes | Timezone of birth location, eg: 5.5 | 5.5 |
config
|
object | No | Contains optional configuration values | |
ayanamsha
|
string | No | Either "tropical" or "sayana" or "lahiri" | Either "tropical" or "sayana" or "lahiri" |
language
|
string | No | Valid 2 letter ISO 639-1 language code | Either "en" For English or "te" for Telugu or "hi" for Hindi or "ta" for Tamil or "kn" for Kannada or "ml" for Malayalam or "or" for Odia or "gu" for Gujarati or "pa" for Punjabi or "bn" for Bengali or "mr" for Marathi or "as" for Assamese or "ur" for Urdu or "ne" for Nepali |
observation_point
|
string | No | Geocentric positions are calculated with respect to the center of Earth. Topocentric positions are calculated with respect to the actual given place | Either "topocentric" or "geocentric" |
chart_config
|
object | No | Configuration properties of Chart | |
font_family
|
string | No | Font name | Mallana or Roboto |
hide_time_location
|
boolean | No | Whether to write or hide Time and Location information on chart | "True" or "False" |
hide_outer_planets
|
boolean | No | Whether to hide Outer Planets or not | "True" or "False" |
chart_style
|
string | No | Chart Style | "south_india" or "north_india" |
sign_number_font_color
|
string | No | HEX color code to be used for Sign Numbers (works for north_india chart only) | #A5243D |
native_name
|
string | No | Native Name | Mr Ram Charan |
native_name_font_size
|
string | No | Font Size to be used to show Native Name | 20px |
native_details_font_size
|
string | No | Font size to be used to print Native Details | 22px |
chart_border_width
|
integer | No | Border width of Chart | 1 |
planet_name_font_size
|
string | No | Font size to be used to show Planet names | 22px |
chart_heading_font_size
|
string | No | Font Size to be used to show Chart Heading | 25px |
chart_background_color
|
string | No | HEX color code to be used for Chart Background | #FEE1C7 |
chart_border_color
|
string | No | HEX color code to be used for chart borders | #B5A886 |
native_details_font_color
|
string | No | HEX color code to be used to show Native details | #000000 |
native_name_font_color
|
string | No | HEX color code to be uses to show native name | #231F20 |
planet_name_font_color
|
string | No | HEX color code to be used tp show Planet names | #BC412B |
chart_heading_font_color
|
string | No | HEX color code to be used to show Chart Heading | #2D3319 |
Supported Languages
This API endpoint supports the following languages.
Use the corresponding 2-letter language code
in the language parameter when making your request.
| Language | Code |
|---|---|
| English |
en
|
| Telugu |
te
|
| Hindi |
hi
|
| Tamil |
ta
|
| Kannada |
kn
|
| Malayalam |
ml
|
| Odia |
or
|
| Gujarati |
gu
|
| Punjabi |
pa
|
| Bengali |
bn
|
| Marathi |
mr
|
| Assamese |
as
|
| Urdu |
ur
|
| Nepali |
ne
|
To request the response in Telugu, use
te as the language code:
{
"language": "te"
}
Request Example
{
"year": 2024,
"month": 1,
"date": 1,
"hours": 10,
"minutes": 30,
"seconds": 31,
"latitude": 17.38333,
"longitude": 78.4666,
"timezone": 5.5,
"config": {
"observation_point": "topocentric", /* geocentric / topocentric */
"ayanamsha": "lahiri", /* lahiri / sayana */
"language":"te" /* en / te / hi / ta / kn / ml / or / gu / pa / bn / mr / as / ur / ne */
},
"chart_config" : {
"font_family":"Mallanna", /* Mallanna / Roboto */
"hide_time_location":"False", /* True / False */
"hide_outer_planets":"False", /* True / False */
"chart_style":"south_india", /* south_india / north_india */
"sign_number_font_color":"#A5243D",/* works for north_india chart only */
"native_name":"Mr. Ram Charan",
"native_name_font_size": "20px",
"native_details_font_size":"15px",
"chart_border_width":1,
"planet_name_font_size": "20px",
"chart_heading_font_size":"25px",
"chart_background_color":"#FEE1C7",
"chart_border_color":"#B5A886",
"native_details_font_color":"#000",
"native_name_font_color": "#231F20",
"planet_name_font_color": "#BC412B",
"chart_heading_font_color":"#2D3319"
}
}
Response Examples
Example responses returned by this API.
{
"statusCode": 200,
"output": "<svg width=\"400\" height=\"400\" xmlns=\"http://www.w3.org/2000/svg\"><defs><style>@import url('https://fonts.googleapis.com/css2?family=Mallanna&display=swap');</style></defs><g><rect stroke=\"#B5A886\" height=\"400\" width=\"400\" y=\"0\" x=\"0\" stroke-width=\"3\" fill=\"#FEE1C7\"/><line stroke-linecap=\"undefined\" stroke-linejoin=\"undefined\" y2=\"400\" x2=\"400\" y1=\"0\" x1=\"0\" stroke-width=\"1\" stroke=\"#B5A886\" fill=\"none\"/><line stroke-linecap=\"null\" stroke-linejoin=\"null\" y2=\"400\" x2=\"0\" y1=\"0\" x1=\"400\" fill-opacity=\"null\" stroke-opacity=\"null\" stroke-width=\"1\" stroke=\"#B5A886\" fill=\"none\"/><line stroke=\"#B5A886\" stroke-linecap=\"null\" stroke-linejoin=\"null\" y2=\"200\" x2=\"0\" y1=\"0\" x1=\"200\" fill-opacity=\"null\" stroke-opacity=\"null\" stroke-width=\"1\" fill=\"none\"/><line stroke-linecap=\"null\" stroke-linejoin=\"null\" y2=\"400\" x2=\"200\" y1=\"200\" x1=\"0\" fill-opacity=\"null\" stroke-opacity=\"null\" stroke-width=\"1\" stroke=\"#B5A886\" fill=\"none\"/><line stroke-linecap=\"null\" stroke-linejoin=\"null\" y2=\"0\" x2=\"200\" y1=\"200\" x1=\"400\" fill-opacity=\"null\" stroke-opacity=\"null\" stroke-width=\"1\" stroke=\"#B5A886\" fill=\"none\"/><line stroke-linecap=\"null\" stroke-linejoin=\"null\" y2=\"200\" x2=\"400\" y1=\"400\" x1=\"200\" fill-opacity=\"null\" stroke-opacity=\"null\" stroke-width=\"1\" stroke=\"#B5A886\" fill=\"none\"/><text font-size=\"11px\" x=\"197\" y=\"193\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">4</text><text font-size=\"11px\" x=\"95\" y=\"90\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">5</text><text font-size=\"11px\" x=\"85\" y=\"105\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">6</text><text font-size=\"11px\" x=\"185\" y=\"205\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">7</text><text font-size=\"11px\" x=\"85\" y=\"305\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">8</text><text font-size=\"11px\" x=\"98\" y=\"315\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">9</text><text font-size=\"11px\" x=\"195\" y=\"217\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">10</text><text font-size=\"11px\" x=\"298\" y=\"315\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">11</text><text font-size=\"11px\" x=\"305\" y=\"305\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">12</text><text font-size=\"11px\" x=\"208\" y=\"205\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">1</text><text font-size=\"11px\" x=\"305\" y=\"104\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">2</text><text font-size=\"11px\" x=\"298\" y=\"95\" style=\"fill: #A5243D\" font-family=\"'Mallanna', sans-serif\">3</text><text font-size=\"20px\" x=\"190\" y=\"115\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Asc</text><text font-size=\"20px\" x=\"210\" y=\"145\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Su</text><text font-size=\"20px\" x=\"155\" y=\"115\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Ve</text><text font-size=\"20px\" x=\"230\" y=\"120\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">(Ur)</text><text font-size=\"20px\" x=\"135\" y=\"80\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Ne</text><text font-size=\"20px\" x=\"165\" y=\"80\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Pl</text><text font-size=\"20px\" x=\"75\" y=\"45\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Mo</text><text font-size=\"20px\" x=\"40\" y=\"18\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Ma</text><text font-size=\"20px\" x=\"70\" y=\"18\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">(Me)</text><text font-size=\"20px\" x=\"100\" y=\"18\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Ju</text><text font-size=\"20px\" x=\"140\" y=\"18\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Sa</text><text font-size=\"20px\" x=\"45\" y=\"45\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Ra</text><text font-size=\"20px\" x=\"75\" y=\"65\" style=\"fill: #BC412B\" font-family=\"'Mallanna', sans-serif\">Ke</text></g></svg>"
}
Code Examples
Use the following examples to integrate this API into your application.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://json.freeastrologyapi.com/d2-chart-svg-code',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"year": 2024,
"month": 1,
"date": 1,
"hours": 10,
"minutes": 30,
"seconds": 31,
"latitude": 17.38333,
"longitude": 78.4666,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri",
"language":"en"
},
"chart_config" : {
"font_family":"Mallanna",
"hide_time_location":"False",
"hide_outer_planets":"False",
"chart_style":"south_india",
"sign_number_font_color":"#A5243D",
"native_name":"Mr. Ram Charan",
"native_name_font_size": "20px",
"native_details_font_size":"15px",
"chart_border_width":1,
"planet_name_font_size": "20px",
"chart_heading_font_size":"25px",
"chart_background_color":"#FEE1C7",
"chart_border_color":"#B5A886",
"native_details_font_color":"#000",
"native_name_font_color": "#231F20",
"planet_name_font_color": "#BC412B",
"chart_heading_font_color":"#2D3319"
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'x-api-key: YOUR_API_KEY_HERE'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://json.freeastrologyapi.com/d2-chart-svg-code"
payload = json.dumps({
"year": 2024,
"month": 1,
"date": 1,
"hours": 10,
"minutes": 30,
"seconds": 31,
"latitude": 17.38333,
"longitude": 78.4666,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri",
"language": "en"
},
"chart_config": {
"font_family": "Mallanna",
"hide_time_location": "False",
"hide_outer_planets": "False",
"chart_style": "south_india",
"sign_number_font_color": "#A5243D",
"native_name": "Mr. Ram Charan",
"native_name_font_size": "20px",
"native_details_font_size": "15px",
"chart_border_width": 1,
"planet_name_font_size": "20px",
"chart_heading_font_size": "25px",
"chart_background_color": "#FEE1C7",
"chart_border_color": "#B5A886",
"native_details_font_color": "#000",
"native_name_font_color": "#231F20",
"planet_name_font_color": "#BC412B",
"chart_heading_font_color": "#2D3319"
}
})
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://json.freeastrologyapi.com/d2-chart-svg-code',
'headers': {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
"year": 2024,
"month": 1,
"date": 1,
"hours": 10,
"minutes": 30,
"seconds": 31,
"latitude": 17.38333,
"longitude": 78.4666,
"timezone": 5.5,
"config": {
"observation_point": "topocentric",
"ayanamsha": "lahiri",
"language": "en"
},
"chart_config": {
"font_family": "Mallanna",
"hide_time_location": "False",
"hide_outer_planets": "False",
"chart_style": "south_india",
"sign_number_font_color": "#A5243D",
"native_name": "Mr. Ram Charan",
"native_name_font_size": "20px",
"native_details_font_size": "15px",
"chart_border_width": 1,
"planet_name_font_size": "20px",
"chart_heading_font_size": "25px",
"chart_background_color": "#FEE1C7",
"chart_border_color": "#B5A886",
"native_details_font_color": "#000",
"native_name_font_color": "#231F20",
"planet_name_font_color": "#BC412B",
"chart_heading_font_color": "#2D3319"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});