# Railway Tractive Effort API
> Railway train-performance maths as an API, computed locally and deterministically — the tractive-effort, resistance and adhesion numbers a railway engineer, train planner or rail-sim developer rates motive power with. The tractive-effort endpoint gives the pulling force a locomotive develops = 375 × horsepower × efficiency ÷ speed (mph), the classic hyperbolic curve where a constant-power loco pulls hardest at low speed and tapers as it accelerates — 4,000 hp at 25 mph and 82 % efficiency is about 49,200 lbf at the rail. The resistance endpoint gives the forces a train fights: grade resistance ≈ 20 lb per ton per 1 % of grade (the weight component along the slope, the dominant force on a hill — a 5,000-ton train on a 1 % grade fights 100,000 lbf) plus curve resistance ≈ 0.8 lb per ton per degree of curve from flange friction. The adhesion endpoint gives the hard ceiling: however much power a loco has, it can only pull as hard as the wheels grip — maximum starting tractive effort = the adhesion coefficient (≈ 0.25 dry, more with sand) × the weight on the driving wheels, so 200 tons on the drivers is about 100,000 lbf before slip. Everything is computed locally and deterministically, so it is instant and private. Ideal for rail-operations and motive-power planning tools, train-simulator and railfan apps, and transport-engineering utilities. Pure local computation — no key, no third-party service, instant. Excludes the speed-dependent Davis rolling/air resistance. 3 compute endpoints. For highway curve geometry use a horizontal-curve 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/railway-api/..."
```

## Pricing
- **Free** (Free) — 4,750 calls/Mo, 2 req/s
- **Starter** ($13/Mo) — 49,500 calls/Mo, 6 req/s
- **Pro** ($41/Mo) — 211,000 calls/Mo, 15 req/s
- **Mega** ($126/Mo) — 1,115,000 calls/Mo, 40 req/s

## Endpoints

### Rail

#### `GET /v1/adhesion` — Adhesion-limited starting effort

**Parameters:**
- `weight_on_drivers_tons` (query, required, string) — Weight on driving wheels (tons) Example: `200`
- `adhesion_coefficient` (query, optional, string) — Adhesion coefficient (default 0.25) Example: `0.25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/railway-api/v1/adhesion?weight_on_drivers_tons=200&adhesion_coefficient=0.25"
```

#### `GET /v1/resistance` — Grade and curve resistance

**Parameters:**
- `train_weight_tons` (query, required, string) — Train weight (tons) Example: `5000`
- `grade_pct` (query, optional, string) — Grade % (default 0) Example: `1`
- `curve_degrees` (query, optional, string) — Curve (degrees, default 0) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/railway-api/v1/resistance?train_weight_tons=5000&grade_pct=1&curve_degrees=2"
```

#### `GET /v1/tractive-effort` — Tractive effort from power and speed

**Parameters:**
- `power_hp` (query, required, string) — Locomotive power (hp) Example: `4000`
- `speed_mph` (query, required, string) — Speed (mph) Example: `25`
- `efficiency_pct` (query, optional, string) — Efficiency % (default 82) Example: `82`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/railway-api/v1/tractive-effort?power_hp=4000&speed_mph=25&efficiency_pct=82"
```

### Meta

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

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


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