search

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

Loshu Grid API 

The Loshu Grid API analyzes the numeric pattern derived from an individual’s date of birth and name, returning a structured 3x3 Loshu (Lo Shu) grid with both SVG and Base64 image data. This API is ideal for numerology and astrology platforms looking to provide interactive, number-based insights and visual reports.


Overview

This API helps you understand the energetic distribution of numbers (1–9) in a person’s chart. Each cell represents a number and how frequently it appears based on the date of birth. Missing numbers highlight lessons, while repeated ones show dominant traits.


Step by Step Loshu Grid API Postman Testing Integration

Step by Step Loshu Grid API Postman Testing Integration

This guide walks you through the process of testing the Loshu Grid API using Postman including setting headers, authentication, request body, and interpreting the response output.


API Endpoint

POST https://astroapi-7.divineapi.com/numerology/v1/loshu-grid

Returns a structured Loshu Grid in the response, complete with renderable SVG and Base64 image outputs.


Headers

NameTypeDescription
Authorization*StringYour API Access Token (e.g. Bearer {token})

Request Body

NameTypeDescription
api_key*StringYour DivineAPI key
day*IntegerDate of birth (e.g. 24)
month*IntegerMonth of birth (e.g. 05)
year*IntegerYear of birth (e.g. 2023)
fname*StringFirst name (e.g. Rahul)
lnameStringLast name (e.g. Kumar)
lanStringLanguage code (en or hi, default en)

200: OK Fetched Loshu Grid Successfully

{
    "status": "success",
    "code": 200,
    "message": "Request was successful",
    "data": {
        "grid": [
            {
                "grid": 1,
                "number": 4,
                "times": 1
            },
            {
                "grid": 2,
                "number": 9,
                "times": 1
            },
            {
                "grid": 3,
                "number": 2,
                "times": 3
            },
            {
                "grid": 4,
                "number": 3,
                "times": 1
            },
            {
                "grid": 5,
                "number": 5,
                "times": 1
            },
            {
                "grid": 6,
                "number": 7,
                "times": 0
            },
            {
                "grid": 7,
                "number": 8,
                "times": 1
            },
            {
                "grid": 8,
                "number": 1,
                "times": 0
            },
            {
                "grid": 9,
                "number": 6,
                "times": 1
            }
        ],
         "svg": "SVG CODE",  
        "base64_image": "base64_svg_image",     
    }
}

The response includes:

grid – Array showing each number’s frequency in the 3x3 matrix.

svg – Ready-to-render SVG vector format of the Loshu grid.

base64_image – Encoded version of the SVG suitable for direct embedding in image tags.


Example Code Implementations

Below are example implementations in various programming environments.


cURL

curl --location 'https://astroapi-7.divineapi.com/numerology/v1/loshu-grid' \
--header 'Bearer {Your Auth Token}' \
--form 'api_key="{Your API Key}"' \
--form 'day="24"' \
--form 'month="05"' \
--form 'year="2023"' \
--form 'fname="Rahul"' \
--form 'lname="Kumar"' \
--form 'lan="en"'

NodeJS

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://astroapi-7.divineapi.com/numerology/v1/loshu-grid',
  'headers': {
    'Authorization': 'Bearer {Your Auth Token}'
  },
  formData: {
    'api_key': '{Your API Key}',
    'day': '24',
    'month': '05',
    'year': '2023',
    'fname': 'Rahul',
    'lname': 'Kumar',
    'lan': 'en'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

JavaScript jQuery AJAX

var form = new FormData();
form.append("api_key", "{Your API Key}");
form.append("day", "24");
form.append("month", "05");
form.append("year", "2023");
form.append("fname", "Rahul");
form.append("lname", "Kumar");
form.append("lan", "en");

var settings = {
  "url": "https://astroapi-7.divineapi.com/numerology/v1/loshu-grid",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {Your Auth Token}"
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Python

import requests

url = "https://astroapi-7.divineapi.com/numerology/v1/loshu-grid"

payload = {'api_key': '{Your API Key}',
'day': '24',
'month': '05',
'year': '2023',
'fname': 'Rahul',
'lname': 'Kumar',
'lan': 'en'}

headers = {
  'Authorization': 'Bearer {Your Auth Token}'
}

response = requests.request("POST", url, headers=headers, data=payload,)

print(response.text)

Implementation Notes

Visual Integration:
Use the svg or base64_image fields directly to embed the Loshu grid in dashboards, PDFs, or reports.

Highlight Missing Numbers:
If "times": 0, visually indicate the number as missing or weak in the chart for user insight.

Security:
Always keep your api_key and Bearer token on the server side; never expose them in client applications.

Customization:
You can overlay the SVG grid with personalized interpretations or style the grid to match your platform’s theme.