# Thermal Expansion API
> Thermal-expansion maths as an API, computed locally and deterministically. The linear endpoint computes how much a solid grows or shrinks when its temperature changes, ΔL = α·L0·ΔT, returning the change in length and the new length from an original length, a temperature change (given directly or as an initial and final temperature) and the linear expansion coefficient α — taken from a built-in material table (steel, aluminium, copper, concrete, glass, invar and more) or supplied directly; lengths accept metres, centimetres, millimetres, feet or inches. The volume endpoint computes volumetric expansion, ΔV = β·V0·ΔT, where for a solid the volumetric coefficient is β ≈ 3α and for a liquid (water, ethanol, mercury, petrol and others) β is taken directly; volumes accept cubic metres, litres, millilitres or cubic feet. The materials endpoint lists the coefficients. A negative temperature change gives contraction. Everything is computed locally and deterministically, so it is instant and private. Ideal for civil and mechanical engineering tools, rail, pipe and bridge expansion-gap design, manufacturing-tolerance and HVAC apps, and physics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is thermal expansion; for heat energy and temperature change use a specific-heat 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/thermalexpansion-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 25,000 calls/Mo, 6 req/s
- **Pro** ($24/Mo) — 150,000 calls/Mo, 20 req/s
- **Mega** ($75/Mo) — 1,024,000 calls/Mo, 60 req/s

## Endpoints

### Thermal

#### `GET /v1/linear` — Linear thermal expansion

**Parameters:**
- `material` (query, optional, string) — steel|aluminium|copper|… (or coefficient) Example: `steel`
- `coefficient` (query, optional, string) — Or linear coefficient α (per K)
- `length` (query, required, string) — Original length Example: `10`
- `unit` (query, optional, string) — m|cm|mm|km|ft|in (default m) Example: `m`
- `delta_t` (query, optional, string) — Temperature change Example: `50`
- `initial_temperature` (query, optional, string) — Or initial temperature
- `final_temperature` (query, optional, string) — And final temperature

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thermalexpansion-api/v1/linear?material=steel&length=10&unit=m&delta_t=50"
```

**Response:**
```json
{
    "data": {
        "delta_t": 50,
        "formula": "ΔL = α·L0·ΔT; new length = L0·(1 + α·ΔT).",
        "material": "steel",
        "new_length": {
            "m": 10.006,
            "value_in_unit": 10.006
        },
        "original_length": {
            "m": 10,
            "unit": "m",
            "value": 10
        },
        "change_in_length": {
            "m": 0.006,
            "in": 0.2362205,
            "mm": 6,
            "value_in_unit": 0.006
        },
        "coefficient_per_K": 1.2e-5
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:55.461Z",
        "request_id": "52a2e6e5-b7b3-4bd5-8168-3a9c94511a7c"
    },
    "status": "ok",
    "message": "Linear thermal expansion",
    "success": true
}
```

#### `GET /v1/materials` — Expansion coefficient reference

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

**Response:**
```json
{
    "data": {
        "note": "Linear coefficients α for solids (per K); volumetric β for liquids. For solids the volumetric coefficient is β ≈ 3α.",
        "linear_alpha_per_K": {
            "pvc": 5.2e-5,
            "gold": 1.4e-5,
            "iron": 1.2e-5,
            "lead": 2.9e-5,
            "wood": 5.0e-6,
            "zinc": 3.0e-5,
            "brass": 1.9e-5,
            "brick": 5.5e-6,
            "glass": 9.0e-6,
            "invar": 1.2e-6,
            "pyrex": 3.3e-6,
            "steel": 1.2e-5,
            "bronze": 1.8e-5,
            "copper": 1.7e-5,
            "marble": 7.0e-6,
            "nickel": 1.3e-5,
            "quartz": 5.9e-7,
            "rubber": 7.7e-5,
            "silver": 1.8e-5,
            "diamond": 1.1e-6,
            "granite": 8.0e-6,
            "aluminum": 2.3e-5,
            "concrete": 1.2e-5,
            "titanium": 8.6e-6,
            "tungsten": 4.5e-6,
            "aluminium": 2.3e-5,
            "cast_iron": 1.04e-5,
            "stainless_steel": 1.7e-5
        },
        "volumetric_beta_per_K_liquids": {
            "oil": 0.0007,
            "water": 0.000207,
            "petrol": 0.00095,
            "acetone": 0.00143,
            "alcohol": 0.00075,
            "benzene": 0.0012,
            "ethanol": 0.00075,
            "mercury": 0.000182,
            "gasoline": 0.00095,
            "glycerin": 0.000485
        }
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:55.563Z",
        "reques
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/volume` — Volumetric thermal expansion

**Parameters:**
- `material` (query, optional, string) — Solid (β=3α) or liquid (water/ethanol/…) Example: `water`
- `volumetric_coefficient` (query, optional, string) — Or volumetric coefficient β
- `volume` (query, required, string) — Original volume Example: `1`
- `volume_unit` (query, optional, string) — m3|l|ml|cm3|ft3 (default m3) Example: `m3`
- `delta_t` (query, optional, string) — Temperature change Example: `20`
- `initial_temperature` (query, optional, string) — Or initial temperature
- `final_temperature` (query, optional, string) — And final temperature

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/thermalexpansion-api/v1/volume?material=water&volume=1&volume_unit=m3&delta_t=20"
```

**Response:**
```json
{
    "data": {
        "delta_t": 20,
        "formula": "ΔV = β·V0·ΔT; for solids β ≈ 3α.",
        "material": "water (liquid)",
        "new_volume": {
            "m3": 1.00414,
            "value_in_unit": 1.00414
        },
        "original_volume": {
            "m3": 1,
            "unit": "m3",
            "value": 1
        },
        "change_in_volume": {
            "m3": 0.00414,
            "litres": 4.14,
            "value_in_unit": 0.00414
        },
        "volumetric_coefficient_per_K": 0.000207
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:55.666Z",
        "request_id": "51301295-d624-4495-84f9-85d0468fdbc7"
    },
    "status": "ok",
    "message": "Volumetric thermal expansion",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "thermalexpansion",
        "note": "Thermal-expansion maths — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/linear",
            "/v1/volume",
            "/v1/materials",
            "/v1/meta"
        ],
        "length_units": [
            "m",
            "cm",
            "mm",
            "km",
            "ft",
            "in"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:55.771Z",
        "request_id": "f93fad4c-9c86-4dce-ae1b-04b3e41db9a2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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