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

Love Calculator

The Love Calculator API calculates a compatibility percentage between two individuals based on their names and (optionally) gender. It uses name-matching algorithms and vibrational numerology to determine relationship harmony, providing an easy and engaging way for apps or websites to display love compatibility results.


API Endpoint

POST https://astroapi-7.divineapi.com/calculator/v1/love-calculator

Returns Love Percentage in response.


Headers

NameTypeDescription
Authorization*StringYour API Access Token. Example: Bearer {token}

Request Body

NameTypeDescription
api_key*StringYour API key obtained from the DivineAPI dashboard.
your_name*StringFull name of the first person. Example: Rahul kumar.
your_genderStringGender of the first person. Example: male.
partner_name*StringFull name of the partner. Example: Rita kumari.
partner_genderStringGender of the partner. Example: female.

200: OK Love Percentage fetched successfully

{
    "status": "success",
    "code": 200,
    "message": "Calculation was successful",
    "data": {
        "compatibility_percentage": 25
    }
}

Example Integrations

Below are examples of how you might call this API using different programming languages and environments.


cURL

curl --location 'https://astroapi-7.divineapi.com/calculator/v1/love-calculator' \
--header 'Authorization: Bearer {Your Auth Token}' \
--form 'api_key="{Your API Key}"' \
--form 'your_name="Rahul kumar"' \
--form 'your_gender="male"' \
--form 'partner_name="Rita kumari"' \
--form 'your_gender="female"' 

NodeJS

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://astroapi-7.divineapi.com/calculator/v1/love-calculator',
  'headers': {
    'Authorization': 'Bearer {Your Auth Token}'
  },
  formData: {
    'api_key': '{Your API Key}',
    'your_name': 'Rahul kumar',
    'your_gender': 'male',
    'partner_name': 'Rita kumari',
    'partner_gender': 'female'
  }
};
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("your_name", "Rahul kumar");
form.append("your_gender", "male");
form.append("partner_name", "Rita kumari");
form.append("partner_gender", "female");

var settings = {
  "url": "https://astroapi-7.divineapi.com/calculator/v1/love-calculator",
  "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/calculator/v1/love-calculator"

payload = {'api_key': '{Your API Key}',
'your_name': 'Rahul kumar',
'your_gender': 'male',
'partner_name: 'Rita kumari',
'partner_gender: 'female'
}

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

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

print(response.text)

Implementation Notes

Input Formatting:
Ensure both your_name and partner_name fields are strings containing full names for accurate compatibility analysis.

Optional Genders:
Gender inputs (your_gender and partner_gender) are optional but improve result accuracy when provided.

Response Handling:
The returned compatibility_percentage is a numerical value ranging from 0 to 100, ideal for visualization in love meters or progress bars.

Use Case Integration:
Suitable for astrology platforms, relationship apps, or interactive entertainment sites looking to add love or compatibility calculators.