# 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"
```

**Response:**
```json
{
    "data": {
        "note": "The metric carat is exactly 0.2 grams (200 mg), and one carat is split into 100 points — so a 1.5 ct stone is 0.3 g and 150 points, and a 0.25 ct stone is a 'twenty-five pointer'. The carat is a mass unit, not a size: a 1 ct diamond and a 1 ct emerald weigh the same but look very different in size because their densities differ.",
        "grams": 0.3,
        "inputs": {
            "carat": 1.5
        },
        "points": 150,
        "milligrams": 300
    },
    "meta": {
        "timestamp": "2026-06-07T08:17:54.155Z",
        "request_id": "b3f0f3d5-6b3f-4421-b762-d09b58b30fda"
    },
    "status": "ok",
    "message": "Carat to grams",
    "success": true
}
```

#### `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"
```

**Response:**
```json
{
    "data": {
        "note": "Grams to carats: divide by 0.2 (or multiply by 5), since a carat is a fifth of a gram. A 0.3 g stone is 1.5 ct. Loose-stone scales read directly in carats, but a weight taken in grams — say on a kitchen or lab balance — converts straight across with this factor.",
        "carat": 1.5,
        "inputs": {
            "grams": 0.3
        },
        "points": 150,
        "milligrams": 300
    },
    "meta": {
        "timestamp": "2026-06-07T08:17:54.244Z",
        "request_id": "093c3ae7-f092-458c-86f5-f58d72f64dec"
    },
    "status": "ok",
    "message": "Grams to carat",
    "success": true
}
```

#### `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"
```

**Response:**
```json
{
    "data": {
        "note": "When a stone is set and cannot be weighed, the trade estimates a round brilliant's weight from its measurements: carat ≈ diameter² × depth × 0.0061, with the diameter and depth in millimetres. A 6.5 mm round about 4 mm deep estimates near 1 carat — which is why a 1 ct round brilliant is roughly 6.5 mm across. Adjust the factor for a thick girdle or different cut; it is an estimate, not a substitute for a scale.",
        "inputs": {
            "factor": 0.0061,
            "depth_mm": 4,
            "diameter_mm": 6.5
        },
        "estimated_carat": 1.0309,
        "estimated_grams": 0.20618,
        "estimated_points": 103.09
    },
    "meta": {
        "timestamp": "2026-06-07T08:17:54.332Z",
        "request_id": "f9fe03c4-8a0c-415b-9f1c-6b079e276b45"
    },
    "status": "ok",
    "message": "Round brilliant weight",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "1 carat = 0.2 g = 200 mg = 100 points. Round brilliant estimate: ct ≈ d²·depth·0.0061 (mm). The carat is mass, not size. For gold purity/karat use a gold-purity API.",
        "service": "gemstone-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/carat-to-grams": "Grams, milligrams and points from a carat weight.",
            "GET /v1/grams-to-carat": "Carat and points from a weight in grams.",
            "GET /v1/round-brilliant-weight": "Estimated carat of a round brilliant from diameter and depth."
        },
        "description": "Gemstone weight maths: carat to grams/points and back, and the estimated carat of a mounted round-brilliant diamond from its measurements."
    },
    "meta": {
        "timestamp": "2026-06-07T08:17:54.401Z",
        "request_id": "ccc2971a-32af-432c-8906-a58859cd48be"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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