API reference › Biorhythm

Biorhythm Compatibility API

How far two people's cycles sit apart, scored for each cycle

POST/v1/biorhythm/compatibility

1 credit · Secret key (test or live) · getBiorhythmCompatibility

The distance between two people's cycles never changes, so this takes no date. The score is a labelled convention.

Request body

  • birth_date_a string (date) required

    The date of birth. It is used for this response and not stored.

    e.g. "1990-08-13"

  • birth_date_b string (date) required

    The date of birth. It is used for this response and not stored.

    e.g. "1990-08-13"

  • lang string

    one of en, hi · default "en"

No other fields are accepted.

Response

JSON { data, meta, warnings }, where data is:

  • days_apart integer required
  • cycles array of object required
    • id string required

      one of physical, emotional, intellectual

    • name string required
    • offset_days integer required
    • score number required

      ≥ 0 · ≤ 100

  • overall number required

    ≥ 0 · ≤ 100

  • basis string required

    one of convention

  • rule string required
  • note string required

Errors: 400, 401, 403, 404, 422, 429, 500. See error codes.

Example request

curl -X POST 'https://api.astrologics.in/v1/biorhythm/compatibility' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"birth_date_a":"1990-05-15","birth_date_b":"1992-01-20"}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/biorhythm/compatibility", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "birth_date_a": "1990-05-15",
    "birth_date_b": "1992-01-20"
  }),
});
console.log(JSON.stringify(await res.json(), null, 2));
Python
import json
import urllib.error
import urllib.request

body = {
    "birth_date_a": "1990-05-15",
    "birth_date_b": "1992-01-20",
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/biorhythm/compatibility",
    method="POST",
    headers={"Authorization": "Bearer al_test_YOUR_KEY", "Content-Type": "application/json"},
    data=json.dumps(body).encode(),
)
try:
    with urllib.request.urlopen(req) as res:
        print(json.dumps(json.load(res), indent=2, ensure_ascii=False))
except urllib.error.HTTPError as err:
    print(err.code, err.read().decode())
PHP
<?php
$ch = curl_init('https://api.astrologics.in/v1/biorhythm/compatibility');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"birth_date_a":"1990-05-15","birth_date_b":"1992-01-20"}',
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

200 OK · 931 characters
{
  "data": {
    "days_apart": 615,
    "cycles": [
      {
        "id": "physical",
        "name": "Physical",
        "offset_days": 17,
        "score": 46.6
      },
      {
        "id": "emotional",
        "name": "Emotional",
        "offset_days": 27,
        "score": 98.7
      },
      {
        "id": "intellectual",
        "name": "Intellectual",
        "offset_days": 21,
        "score": 17.3
      }
    ],
    "overall": 54.2,
    "basis": "convention",
    "rule": "score = 50 × (1 + cos(2π × days apart ÷ period)); overall is the mean of the three.",
    "note": "Biorhythm is a tradition of counting days from birth. Controlled studies have not found that it predicts events, so read this for interest and not for decisions."
  },
  "meta": {
    "request_id": "req_example",
    "api_version": "v1",
    "engine_version": "2026.10.10",
    "mode": "live",
    "credits_charged": 1
  },
  "warnings": []
}
Try it

Leave empty to use the shared demo key (limited). Test keys only: never charged. Kept in this browser tab and sent through this site to the API. Create one

More in Biorhythm

Get a free API key Biorhythm product page