# Currency & Unit Converter API (ECB Rates since 1999) (`geeky_goth_gamer/currency-unit-converter`) Actor

Convert money between 30 currencies with official European Central Bank reference rates (latest or any date since 1999), and convert 1,000+ physical units (length, mass, temperature, energy, speed, pressure, data) in one batch call. Standby API for AI agents.

- **URL**: https://apify.com/geeky_goth_gamer/currency-unit-converter.md
- **Developed by:** [Chris Day](https://apify.com/geeky_goth_gamer) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 conversions

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Currency & Unit Converter API (ECB Rates since 1999)

Convert money between 30 currencies with official European Central Bank reference rates (latest or any date since 1999), and convert 1,000+ physical units (length, mass, temperature, energy, speed, pressure, data) in one batch call. Standby API for AI agents.

### When an AI agent should use this

Use it whenever an answer depends on an exact conversion: invoice totals in another currency, historical prices on a given date, recipe or engineering units, temperatures. LLMs often get these wrong or use stale rates.

Rates are the ECB's daily euro reference rates (published around 16:00 CET on TARGET working days), so they're official mid-market reference values, not live trading quotes. Don't use them for trading.

### Example input

```json
{
  "conversions": [
    {
      "amount": 100,
      "from": "USD",
      "to": "EUR"
    },
    {
      "amount": 250,
      "from": "GBP",
      "to": "AUD",
      "date": "2024-06-28"
    },
    {
      "value": 26.2,
      "from": "mile",
      "to": "km"
    },
    {
      "value": 72,
      "from": "degF",
      "to": "degC"
    }
  ]
}
```

### Output

Currency: `result`, `rate`, `inverseRate`, `rateDate` (the ECB fixing used; weekends and holidays use the previous fixing, up to 7 days back), `requestedDate`, names and `attribution`. Cross rates are computed via EUR.

Units: `result` (12 significant digits), `fromUnit`, `toUnit`, `dimension`. Units are auto-detected and use [pint](https://github.com/hgrecco/pint) names: `km`, `mile`, `ft`, `inch`, `kg`, `lb`, `oz`, `degC`, `degF`, `kelvin`, `kWh`, `MJ`, `BTU`, `m/s`, `km/h`, `mph`, `knot`, `psi`, `kPa`, `bar`, `liter`, `gallon`, `cup`, `GB`, `GiB`, `hectare` and more. `acre` is the US survey acre.

Mode `rates` returns every available ECB rate for a `base` currency on a `date`.

Currencies (ECB list, latest): AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HUF IDR ILS INR ISK JPY KRW MXN MYR NOK NZD PHP PLN RON SEK SGD THB TRY USD ZAR, plus historical ones (e.g. CYP before 2008).

### Pricing

| Event | Price (USD) |
|---|---|
| `conversion` | $0.001 per successful conversion (or one `rates` table) |
| `apify-actor-start` | $0.00005 per run |

Failed conversions (unknown currency or unit, incompatible dimensions, bad dates) are free.

### Standby HTTP API

Base URL: `https://geeky-goth-gamer--currency-unit-converter.apify.actor` (send `Authorization: Bearer <APIFY_TOKEN>`).

- `POST /convert`: up to 100 conversions, or top-level `amount`/`value`, `from`, `to`, `date`
- `POST /rates`: `base`, `date`
- `GET /health`

```bash
curl -s -X POST "https://geeky-goth-gamer--currency-unit-converter.apify.actor/convert" -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" -d '{"amount":100,"from":"USD","to":"EUR"}'
```

### MCP

```
https://mcp.apify.com/?tools=geeky_goth_gamer/currency-unit-converter
```

### Data and limits

Source: Euro foreign exchange reference rates, European Central Bank (ecb.europa.eu); reuse permitted with source acknowledgement. The rate table is downloaded from the ECB (fixed URL) and cached for an hour. 1,000 conversions per run, 100 per Standby call. Unit strings are limited to 64 characters of letters, digits and `/ * ^ ( ) . - _ ° µ Ω ² ³`, with exponents up to 12.

### Related tools

- [Global Public Holidays & Business Days](https://apify.com/geeky_goth_gamer/global-public-holidays-business-days)
- [Validated Table & Invoice Extractor](https://apify.com/geeky_goth_gamer/validated-table-invoice-extractor)
- [All tools](https://apify.com/geeky_goth_gamer)

# Actor input Schema

## `conversions` (type: `array`):

Up to 1,000 per run (100 per Standby call). Each item: amount (or value), from, to; optional date (YYYY-MM-DD, currencies), decimals (0–10, default 4) and kind ("currency" or "unit"; auto-detected).

## `mode` (type: `string`):

"rates" returns every ECB rate for "base" on "date" (one event).

## `base` (type: `string`):

For mode "rates", e.g. USD. Default EUR.

## `date` (type: `string`):

For mode "rates": YYYY-MM-DD; default latest.

## Actor input object example

```json
{
  "conversions": [
    {
      "amount": 100,
      "from": "USD",
      "to": "EUR"
    },
    {
      "amount": 250,
      "from": "GBP",
      "to": "AUD",
      "date": "2024-06-28"
    },
    {
      "value": 26.2,
      "from": "mile",
      "to": "km"
    },
    {
      "value": 72,
      "from": "degF",
      "to": "degC"
    }
  ],
  "mode": "convert"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "conversions": [
        {
            "amount": 100,
            "from": "USD",
            "to": "EUR"
        },
        {
            "amount": 250,
            "from": "GBP",
            "to": "AUD",
            "date": "2024-06-28"
        },
        {
            "value": 26.2,
            "from": "mile",
            "to": "km"
        },
        {
            "value": 72,
            "from": "degF",
            "to": "degC"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("geeky_goth_gamer/currency-unit-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "conversions": [
        {
            "amount": 100,
            "from": "USD",
            "to": "EUR",
        },
        {
            "amount": 250,
            "from": "GBP",
            "to": "AUD",
            "date": "2024-06-28",
        },
        {
            "value": 26.2,
            "from": "mile",
            "to": "km",
        },
        {
            "value": 72,
            "from": "degF",
            "to": "degC",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("geeky_goth_gamer/currency-unit-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "conversions": [
    {
      "amount": 100,
      "from": "USD",
      "to": "EUR"
    },
    {
      "amount": 250,
      "from": "GBP",
      "to": "AUD",
      "date": "2024-06-28"
    },
    {
      "value": 26.2,
      "from": "mile",
      "to": "km"
    },
    {
      "value": 72,
      "from": "degF",
      "to": "degC"
    }
  ]
}' |
apify call geeky_goth_gamer/currency-unit-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,geeky_goth_gamer/currency-unit-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/f3duZ6nhjnECz7Mfk/builds/HMvy5b9w1wqFzfuzF/openapi.json
