# Population Growth API
> Population-dynamics maths as an API, computed locally and deterministically. The exponential endpoint applies the Malthusian model N(t) = N0·e^(r·t) — unbounded growth at a constant continuous rate r — and returns the projected population, the growth factor and the doubling time; a population of 100 growing at r = 0.05 per period reaches about 165 after ten periods. The logistic endpoint applies the bounded model N(t) = K/(1 + ((K−N0)/N0)·e^(−r·t)), where growth slows as the population approaches the carrying capacity K and is fastest at the inflection point N = K/2; starting from 10 toward a capacity of 1000 at r = 0.5, the population is about 600 after ten periods and levels off near 1000. The doubling-time endpoint gives ln2/r for a continuous rate, or the Rule-of-70 quick estimate for a percentage growth per period. The rate and time share one period (years, days, generations). Everything is computed locally and deterministically, so it is instant and private. Ideal for biology, ecology, demography, conservation, education and simulation app developers, population-projection and carrying-capacity tools, and modelling software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is population growth; for disease spread use an epidemiology API and for population-genetics allele frequencies a genetics 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/populationgrowth-api/..."
```

## Pricing
- **Free** (Free) — 4,150 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 41,500 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 196,000 calls/Mo, 15 req/s
- **Mega** ($40/Mo) — 1,185,000 calls/Mo, 40 req/s

## Endpoints

### Population

#### `GET /v1/doubling-time` — Doubling time

**Parameters:**
- `rate` (query, optional, string) — Continuous rate r Example: `0.05`
- `percent_growth` (query, optional, string) — Or percent growth per period Example: `7`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/populationgrowth-api/v1/doubling-time?rate=0.05&percent_growth=7"
```

**Response:**
```json
{
    "data": {
        "note": "Doubling time = ln2 / r. For a percentage growth per period the quick estimate is the Rule of 70 (70 / percent).",
        "inputs": {
            "rate": 0.05
        },
        "rule_of_70": 10,
        "doubling_time": 13.862944
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:17.345Z",
        "request_id": "896db1f4-2eea-4d56-bca3-3fe612c03885"
    },
    "status": "ok",
    "message": "Doubling time",
    "success": true
}
```

#### `GET /v1/exponential` — Exponential (Malthusian) growth

**Parameters:**
- `initial` (query, required, string) — Initial population N0 Example: `100`
- `rate` (query, required, string) — Continuous growth rate r Example: `0.05`
- `time` (query, required, string) — Elapsed time Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/populationgrowth-api/v1/exponential?initial=100&rate=0.05&time=10"
```

**Response:**
```json
{
    "data": {
        "note": "Exponential (Malthusian) growth N(t) = N0·e^(r·t), r the continuous per-period rate. 100 at r=0.05 over 10 periods → ≈164.87.",
        "inputs": {
            "rate": 0.05,
            "time": 10,
            "initial": 100
        },
        "population": 164.872127,
        "doubling_time": 13.862944,
        "growth_factor": 1.64872127
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:17.489Z",
        "request_id": "9ee653db-09cc-4ec1-b204-cb7281467cbb"
    },
    "status": "ok",
    "message": "Exponential growth",
    "success": true
}
```

#### `GET /v1/logistic` — Logistic growth

**Parameters:**
- `initial` (query, required, string) — Initial population N0 Example: `10`
- `carrying_capacity` (query, required, string) — Carrying capacity K Example: `1000`
- `rate` (query, required, string) — Growth rate r Example: `0.5`
- `time` (query, required, string) — Elapsed time Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/populationgrowth-api/v1/logistic?initial=10&carrying_capacity=1000&rate=0.5&time=10"
```

**Response:**
```json
{
    "data": {
        "note": "Logistic growth N(t) = K/(1 + ((K−N0)/N0)·e^(−r·t)); growth slows as N approaches the carrying capacity K, fastest at N = K/2 (the inflection point).",
        "inputs": {
            "rate": 0.5,
            "time": 10,
            "initial": 10,
            "carrying_capacity": 1000
        },
        "population": 599.859602,
        "inflection_time": 9.19024,
        "fraction_of_capacity": 0.5998596
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:17.605Z",
        "request_id": "42f0f3f6-84e3-4f19-b004-2eab54c29296"
    },
    "status": "ok",
    "message": "Logistic growth",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Rate r is the continuous per-period growth rate; time and rate share the same period (years, days…). For disease spread use an epidemiology API and for compound interest a finance API.",
        "service": "populationgrowth-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/logistic": "Logistic growth toward a carrying capacity K.",
            "GET /v1/exponential": "Exponential growth N(t) = N0·e^(r·t) with doubling time.",
            "GET /v1/doubling-time": "Doubling time from a rate or percentage growth."
        },
        "description": "Population dynamics: exponential (Malthusian) and logistic growth with a carrying capacity, plus doubling time."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:17.747Z",
        "request_id": "2094f327-5286-4a2d-b26e-64e4f5802d72"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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