---
title: "Inflation API developer guide"
description: "Integrate inflation adjustments, historical currency conversions, and metal prices into your application."
url: "https://valuethen.com/developers/"
language: "en"
site: "ValueThen"
publisher: "Rising Throne"
updated: "2026-11-14"
license: "Data: World Bank CC BY 4.0, ECB, FRED"
---

# Inflation API developer guide

Integrate inflation adjustments, historical currency conversions, and metal prices into your application.
[ValueThen](https://valuethen.com/) / Developer guide

# Developer guide

Integrate inflation adjustments, historical currency conversions, and metal prices into your application.

**On this page**

[Quickstart](#quickstart)[Endpoints](#endpoints)[Dates and coverage](#coverage)[Errors and rate limits](#errors)[Integration options](#integration)[Support](#support)

## Make your first request

Public read endpoints return JSON over HTTPS and do not require an API key. Start with a same-currency calculation, then add cross-currency conversion once you have checked the available dates.

```
curl "https://api.valuethen.com/v1/convert?amount=100&from=USD&to=USD&fromYear=1970&toYear=2024"
```

```
const response = await fetch(
  "https://api.valuethen.com/v1/convert?amount=100&from=USD&to=USD&fromYear=1970&toYear=2024"
);
const data = await response.json();
if (!response.ok) {
  throw new Error(data.detail ?? "Calculation failed");
}
console.log(data.result, data.inputs.to, data.sources);
```

Read `result` together with `inputs`, `coverage`, and `sources`. A result without its dates and source is insufficient for a reproducible comparison.

[View this JSON response →](https://api.valuethen.com/v1/convert?amount=100&from=USD&to=USD&fromYear=1970&toYear=2024)[Download OpenAPI →](https://api.valuethen.com/openapi.json)

## Core endpoints

| Request | Purpose |
| --- | --- |
| `GET /v1/convert` | Convert an amount across dates and currencies. Metals use troy ounces. |
| `GET /v1/inflate` | Adjust purchasing power within one currency. |
| `GET /v1/coverage` | List supported currencies and their annual and monthly date ranges. |
| `GET /v1/series/{currency}` | Get the annual index; use `?freq=monthly` for monthly data where available. |
| `GET /v1/metals/{metal}` | Recorded XAU or XAG prices in their original currency. Add `?year=1258` for a dated quote. |
| `GET /v1/historical/currencies` | Approved historical monetary systems. An empty catalog means historical research has not yet passed publication review. |
| `GET /v1/historical/currencies/{id}` | A published historical record by its URL-encoded stable ID. |
| `POST /v1/historical/value` | Evidence-bounded index, wage, fine-metal or basket comparison. Unsupported periods, units and localities return 422; no conversion bridge is inferred. |
| `GET /api/historical-boundaries?year=1900` | Approximate political-boundary geometry for one year from the version-pinned Cliopatria baseline. This endpoint is served by valuethen.com and returns source, license, interval and attribution metadata. |
| `GET|POST /ask` | Bounded natural-language access to one validated annual calculation. Accepts `query` or `q`; JSON POST may request SSE with `streaming`. |

The [OpenAPI document](https://api.valuethen.com/openapi.json) is the machine-readable reference for the money API parameters, responses, and additional operations. The map boundary endpoint is a separate site endpoint; it accepts years 1209 through 2024, plus `current` for Natural Earth source metadata, and labels historical geometry as approximate.

## Handle dates explicitly

Historical comparisons use the exact `sourcePeriod` and `targetPeriod` identifiers returned by their source series. Use `seriesId` to choose evidence and a worker category when several series exist. Supported wage series can return paid workdays when no target period is supplied. Missing historical periods are not interpolated. These historical contracts are implemented locally; the public catalog remains empty pending review.

1.  Request `/v1/coverage` before offering dates in your interface.
2.  Specify `fromYear` and `toYear` when a result must be reproducible. Omitting the target year uses the latest supported period, which may precede the current year.
3.  For monthly requests, send both `fromMonth` and `toMonth`. Inspect the response’s `frequency`: unavailable monthly data can fall back to annual data.
4.  For cross-currency calculations, inspect `methods`. A method can be unavailable when an index or historical exchange rate is missing.

Gold begins in 1258 and silver in 1688. Early prices are recorded in GBP; USD records begin in 1792. These are dated price observations, not medieval CPI or live spot prices. [Read the metal-price methodology](https://valuethen.com/reference/#metals).

## Errors, limits, and caching

Check the HTTP status before using a result. Error responses use problem details with a readable `detail` and a machine-readable `code`. A coverage error indicates that the requested data is unavailable; choose a supported period rather than repeatedly sending the same request.

On `429`, respect `Retry-After`. Read the returned rate-limit headers and avoid embedding private API keys in browser code. Cache successful responses according to `Cache-Control`; source providers can revise historical observations.

`/ask` limits queries to 1,024 UTF-8 bytes, request bodies to 8,192 bytes, and upstream responses to 262,144 bytes. Calculations time out after five seconds. It allows 30 requests per 60 seconds; beyond that it returns 429 with `Retry-After: 60`, and 503 when the limit cannot be checked. Annual answers must echo the requested inputs exactly and cannot use a provisional year; use explicit supported months for a current partial year.

## Other integration options

Use the [embed builder](https://valuethen.com/embed/) for articles and websites that need a visible calculator. For agents, the [agent guide](https://valuethen.com/llms.txt) and [MCP endpoint](https://api.valuethen.com/mcp) describe programmatic access. The [CLI repository](https://github.com/Rising-Throne/valuethen-cli) contains installation and usage instructions.

[Interactive API reference →](https://api.valuethen.com/docs)[API overview →](https://valuethen.com/api/)

## Support and commercial use

For higher request volumes or redistribution, [contact us with your use case and expected traffic](mailto:contact@therisingthrone.com?subject=valuethen.com%3A%20commercial%20%2F%20high-volume%20API%20use). Provider licences and attribution requirements still apply; see the [terms of use](https://valuethen.com/terms/).

For technical support, include the request URL, HTTP status, response body, and timestamp. Remove API keys before sending anything to [contact@therisingthrone.com](mailto:contact@therisingthrone.com?subject=valuethen.com).

## Use this page programmatically

The same figure from the free API, no key required:

```bash
curl "https://api.valuethen.com/v1/convert?amount=100&from=USD&to=EUR&fromYear=1970&toYear=2024"
```

```json
{ "result": 777.71, "method": "cpi-then-fx", "sources": ["World Bank FP.CPI.TOTL, 2010=100"] }
```

---

Data sources: World Bank FP.CPI.TOTL, ECB HICP and reference rates, FRED CPI-U, MeasuringWorth and bullion market records via freegoldapi.com.
Free JSON API: https://api.valuethen.com/openapi.json · Agent guide: https://valuethen.com/llms.txt · MCP: https://api.valuethen.com/mcp
