# Gemstone Weight API
> Gemstone weight maths as an API, computed locally and deterministically — the carat, gram, point and measured-weight numbers a jeweller, gem dealer, appraiser or lapidary works to. The carat-to-grams endpoint converts a carat weight to grams, milligrams and points: the metric carat is exactly 0.2 g (200 mg) and is split into 100 points, so a 1.5 ct stone is 0.3 g and 150 points and a quarter-carat is a twenty-five pointer — the carat is a mass unit, not a size, so a 1 ct diamond and a 1 ct emerald weigh the same but look different because their densities differ. The grams-to-carat endpoint inverts it (divide grams by 0.2, or multiply by 5), for a weight taken on a gram balance. The round-brilliant-weight endpoint gives the trade estimate used when a stone is set and cannot be put on a scale: carat ≈ diameter² × depth × 0.0061, with the girdle diameter and total depth in millimetres — a 6.5 mm round about 4 mm deep estimates near 1 carat, which is exactly why a 1 ct round brilliant measures roughly 6.5 mm across; the factor can be nudged for a thick girdle or a different cut. Everything is computed locally and deterministically, so it is instant and private. Ideal for jewellery and appraisal tools, gem-dealer and auction apps, and lapidary calculators. Pure local computation — no key, no third-party service, instant. Weight maths only — it does not price the stone or grade the colour and clarity. 3 compute endpoints. For gold karat and fineness use a gold-purity 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/gemstone-api/..."
```

## Pricing
- **Free** (Free) — 7,300 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 62,000 calls/Mo, 6 req/s
- **Pro** ($26/Mo) — 252,000 calls/Mo, 15 req/s
- **Mega** ($79/Mo) — 1,190,000 calls/Mo, 40 req/s

## Endpoints

### Gemstone

#### `GET /v1/carat-to-grams` — Carat to grams, mg and points

**Parameters:**
- `carat` (query, required, string) — Carat weight Example: `1.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gemstone-api/v1/carat-to-grams?carat=1.5"
```

#### `GET /v1/grams-to-carat` — Grams to carat and points

**Parameters:**
- `grams` (query, required, string) — Weight in grams Example: `0.3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gemstone-api/v1/grams-to-carat?grams=0.3"
```

#### `GET /v1/round-brilliant-weight` — Estimated carat of a round brilliant

**Parameters:**
- `diameter_mm` (query, required, string) — Girdle diameter (mm) Example: `6.5`
- `depth_mm` (query, required, string) — Total depth (mm) Example: `4.0`
- `factor` (query, optional, string) — Weight factor (default 0.0061) Example: `0.0061`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gemstone-api/v1/round-brilliant-weight?diameter_mm=6.5&depth_mm=4.0&factor=0.0061"
```

### Meta

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

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


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