API Reference
Official SDKs
Install and use the official CurrencyCore SDKs for TypeScript, Python, Dart/Flutter, Kotlin/Java, and Swift.
We publish official, typed clients for five ecosystems, each generated from the
same OpenAPI 3.1 spec and wrapped with a thin helper for API-key and version
handling. They’re optional, the API is plain authenticated GETs, so every
endpoint page also shows raw fetch/cURL. Reach for an
SDK when you want typed responses and key handling done for you.
| SDK | Package | Platforms | Registry |
|---|---|---|---|
| TypeScript | @currencycore/sdk | Node, browser, React Native | npm |
| Python | currencycore | CPython 3.x | PyPI |
| Dart | currencycore | Dart, Flutter | pub.dev |
| Kotlin / Java | com.github.CurrencyCore:currencycore-kotlin | Android, JVM | JitPack |
| Swift | currencycore-swift | iOS, macOS | Swift Package Manager |
Install
npm install @currencycore/sdkpip install currencycore# pubspec.yaml
dependencies:
currencycore: ^0.1.0// build.gradle.kts — distributed via JitPack
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("com.github.CurrencyCore:currencycore-kotlin:0.1.0")
}// Package.swift — then add "CurrencyCoreSDK" to your target's dependencies
.package(url: "https://github.com/CurrencyCore/currencycore-swift.git", from: "0.1.0")Convert an amount
Convert 100 USD to EUR. Pass your key explicitly, or set the
CURRENCYCORE_API_KEY environment variable and omit it.
import { createClient } from '@currencycore/sdk';
const api = createClient({ apiKey: 'cc_live_...' }); // or set CURRENCYCORE_API_KEY
const res = await api.convert({ from: 'USD', to: 'EUR', amount: 100 });
console.log(res.results[0]);from currencycore.client import create_client
api = create_client(api_key="cc_live_...") # or set CURRENCYCORE_API_KEY
res = api.convert(var_from="USD", to="EUR", amount=100)
print(res.results[0])import 'package:currencycore/currencycore.dart';
import 'package:currencycore/currencycore_client.dart';
final client = createCurrencyCoreClient(apiKey: 'cc_live_...');
final api = client.getCurrencyCoreApi();
final res = await api.convert(from: 'USD', to: 'EUR', amount: 100);
print(res.data?.results.first);import com.currencycore.sdk.CurrencyCore
val api = CurrencyCore.client(apiKey = "cc_live_...") // or set CURRENCYCORE_API_KEY
val res = api.convert(from = "USD", to = "EUR", amount = java.math.BigDecimal(100))
println(res.results.first())import CurrencyCoreSDK
CurrencyCore.configure(apiKey: "cc_live_...") // or set CURRENCYCORE_API_KEY
let res = try await CurrencyCoreAPI.convert(from: "USD", to: "EUR", amount: 100)
print(res.results.first as Any)The Python from parameter is spelled var_from because from is a reserved
word in Python. The Kotlin SDK is usable from Java as well as Kotlin.
Public endpoints, no key
Reference data like /currencies and /countries is public, construct the
client without a key.
const api = createClient();
const currencies = await api.currencies();api = create_client()
print(api.currencies())final api = createCurrencyCoreClient().getCurrencyCoreApi();
print((await api.currencies()).data?.length);val api = CurrencyCore.client()
println(api.currencies())CurrencyCore.configure()
let currencies = try await CurrencyCoreAPI.currencies()API key & environment
Every client resolves the key in the same order: the explicit argument first,
then the CURRENCYCORE_API_KEY environment variable (handy for servers and
CLIs). See Authentication for key management and rate
limits.
Never ship a secret key in a browser bundle, mobile app, or anything you distribute — it’s extractable. On the browser, React Native, Flutter, Android, and iOS, pass a key you control at request time, proxy through your backend, or use a short-lived token.
API version
The base URL is https://api.currency-core.com/{version} (default v1). The
version is a client option, so a future /v2 won’t disturb your existing
integration.
createClient({ version: 'v1' });
createClient({ baseUrl: 'https://api.currency-core.com/v1' }); // full overridecreate_client(version="v1")
create_client(base_url="https://api.currency-core.com/v1")createCurrencyCoreClient(version: 'v1');
createCurrencyCoreClient(baseUrl: 'https://api.currency-core.com/v1');CurrencyCore.client(version = "v1")
CurrencyCore.client(baseUrl = "https://api.currency-core.com/v1")CurrencyCore.configure(version: "v1")
CurrencyCore.configure(baseURL: "https://api.currency-core.com/v1")Reference
Each SDK’s README documents every endpoint, the low-level client, and how to regenerate from the spec:
- TypeScript — npm
@currencycore/sdk· GitHub - Python — PyPI
currencycore· GitHub - Dart / Flutter — pub.dev
currencycore· GitHub - Kotlin / Java — JitPack · GitHub
- Swift — Swift Package Manager · GitHub
Need a language we don’t cover yet? Email support, the raw HTTP API works everywhere in the meantime.