# Biorhythm API
> Biorhythm calculation as an API, computed locally and deterministically — a fun, for-entertainment model of three sine-wave cycles that supposedly run from the day you are born: a 23-day physical cycle, a 28-day emotional cycle and a 33-day intellectual cycle, each given by sin(2π·days/period). The cycles endpoint computes the three percentages and their phase (rising, falling or a critical zero-crossing where the cycle changes sign) for a given date, plus the average. The range endpoint returns the daily values over a window of up to 60 days from a start date, ready to plot as three sine waves. The compatibility endpoint compares two birthdates and gives, for each cycle, a defined heuristic compatibility score (1 + cos(2π·Δdays/period))/2 — 100 % when two people's cycles are perfectly in phase and 0 % when exactly opposite — and an overall score. Dates are in YYYY-MM-DD form. Biorhythms have no scientific basis; this is purely an entertainment tool. Everything is computed locally and deterministically, so it is instant and private. Ideal for lifestyle, horoscope, wellness, game and novelty app developers, daily-widget and compatibility tools, and fun dashboards. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the entertainment biorhythm; for name and birthdate numerology use a numerology API and for star signs a zodiac API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/biorhythm-api/..."
```

## Pricing
- **Free** (Free) — 6,000 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 50,000 calls/Mo, 6 req/s
- **Pro** ($9/Mo) — 210,000 calls/Mo, 15 req/s
- **Mega** ($29/Mo) — 1,280,000 calls/Mo, 40 req/s

## Endpoints

### Biorhythm

#### `GET /v1/compatibility` — Compatibility

**Parameters:**
- `birthdate1` (query, required, string) — First birthdate Example: `2000-01-01`
- `birthdate2` (query, required, string) — Second birthdate Example: `1998-06-15`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/biorhythm-api/v1/compatibility?birthdate1=2000-01-01&birthdate2=1998-06-15"
```

**Response:**
```json
{
    "data": {
        "note": "Compatibility (defined heuristic, for fun): for each cycle, (1 + cos(2π·Δdays/period))/2 — 100 % when two people's cycles are perfectly in phase, 0 % when exactly opposite.",
        "inputs": {
            "birthdate1": "2000-01-01",
            "birthdate2": "1998-06-15"
        },
        "days_apart": 565,
        "overall_compatibility": 54.01,
        "physical_compatibility": 4.14,
        "emotional_compatibility": 71.69,
        "intellectual_compatibility": 86.19
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.694Z",
        "request_id": "35a81e00-7c02-4f42-9152-d252079cf456"
    },
    "status": "ok",
    "message": "Compatibility",
    "success": true
}
```

#### `GET /v1/cycles` — Biorhythm cycles

**Parameters:**
- `birthdate` (query, required, string) — Birthdate (YYYY-MM-DD) Example: `2000-01-01`
- `date` (query, optional, string) — Target date (YYYY-MM-DD) Example: `2000-02-01`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/biorhythm-api/v1/cycles?birthdate=2000-01-01&date=2000-02-01"
```

**Response:**
```json
{
    "data": {
        "note": "Biorhythm (for entertainment): value = sin(2π·days/period) with physical 23-day, emotional 28-day and intellectual 33-day cycles. A 'critical' day is a zero crossing where the cycle changes sign.",
        "inputs": {
            "date": "2000-02-01",
            "birthdate": "2000-01-01"
        },
        "physical": {
            "phase": "falling",
            "percent": 81.7
        },
        "emotional": {
            "phase": "rising",
            "percent": 62.35
        },
        "days_alive": 31,
        "intellectual": {
            "phase": "rising",
            "percent": -37.17
        },
        "average_percent": 35.63
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.797Z",
        "request_id": "afa3aa7a-f0b8-4ee0-a0eb-d1597a05ad21"
    },
    "status": "ok",
    "message": "Biorhythm cycles",
    "success": true
}
```

#### `GET /v1/range` — Daily series

**Parameters:**
- `birthdate` (query, required, string) — Birthdate (YYYY-MM-DD) Example: `2000-01-01`
- `start` (query, optional, string) — Start date (YYYY-MM-DD) Example: `2000-02-01`
- `days` (query, optional, string) — Number of days (max 60) Example: `14`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/biorhythm-api/v1/range?birthdate=2000-01-01&start=2000-02-01&days=14"
```

**Response:**
```json
{
    "data": {
        "note": "Daily biorhythm values over the requested window (max 60 days). Plot each cycle as a sine wave to see the chart.",
        "inputs": {
            "days": 14,
            "start": "2000-02-01",
            "birthdate": "2000-01-01"
        },
        "series": [
            {
                "date": "2000-02-01",
                "physical": 81.7,
                "emotional": 62.35,
                "days_alive": 31,
                "intellectual": -37.17
            },
            {
                "date": "2000-02-02",
                "physical": 63.11,
                "emotional": 78.18,
                "days_alive": 32,
                "intellectual": -18.93
            },
            {
                "date": "2000-02-03",
                "physical": 39.84,
                "emotional": 90.1,
                "days_alive": 33,
                "intellectual": 0
            },
            {
                "date": "2000-02-04",
                "physical": 13.62,
                "emotional": 97.49,
                "days_alive": 34,
                "intellectual": 18.93
            },
            {
                "date": "2000-02-05",
                "physical": -13.62,
                "emotional": 100,
                "days_alive": 35,
                "intellectual": 37.17
            },
            {
                "date": "2000-02-06",
                "physical": -39.84,
                "emotional": 97.49,
                "days_alive": 36,
 
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/biorhythm-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Dates are YYYY-MM-DD. Cycles: physical 23 days, emotional 28 days, intellectual 33 days. Biorhythms have no scientific basis — this is an entertainment tool.",
        "cycles": {
            "physical": 23,
            "emotional": 28,
            "intellectual": 33
        },
        "service": "biorhythm-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/range": "Daily biorhythm series over a window (max 60 days).",
            "GET /v1/cycles": "Physical/emotional/intellectual percentages and phase for a date.",
            "GET /v1/compatibility": "Cycle compatibility between two birthdates."
        },
        "description": "Biorhythm calculator (for entertainment): physical, emotional and intellectual cycles for a date, a daily series, and the compatibility between two birthdates."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:32.992Z",
        "request_id": "3b95be4b-7b4b-4e92-8d7a-f867ff280fbc"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/biorhythm-api
OpenAPI spec: https://www.oanor.com/api/biorhythm-api/openapi.json
