Retrieve information about world currencies, including ISO codes, symbols, and decimal precision.
Standards Used
- ISO 4217
- ISO 3166-1
Minor Units#
The minor_units field indicates decimal places. It is null for non-decimal currencies like XAU (gold) or XBT (Bitcoin) where decimal subdivision doesn't apply.
The Currency object#
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | ISO 4217 alphabetic code. Example: USD |
| countries | string[] | Yes | Countries using this currency (alpha-2 codes). Example: ["US","EC","SV"] |
| minor_units | integer | null (int32) | No | Decimal places (minor units). Example: 2 |
| name | string | Yes | Currency name. Example: United States dollar |
| numeric | integer (int32) | Yes | ISO 4217 numeric code. Example: 840 |
| symbol | string | No | Common currency symbol. Example: $ |
Endpoints#
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| pagequery | integer | No | Page number (1-indexed). Example: 1 |
| per_pagequery | integer | No | Number of results per page (1-100). Example: 20 |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | Yes | The data items for this page. |
| pagination | object | Yes | Pagination metadata in response. |
| page | integer | Yes | Current page number. Example: 1 |
| per_page | integer | Yes | Items per page. Example: 20 |
| total_items | integer | Yes | Total number of items. Example: 100 |
| total_pages | integer | Yes | Total number of pages. Example: 5 |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/currencies?page=1&per_page=20',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/currencies',
params={
'page': 'eyJpZCI6MTB9',
'per_page': 'eyJpZCI6MTB9'
},
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/currencies?page=1&per_page=20"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 429 | Rate limit exceeded |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| identifierpath | string | Yes | Currency code (alphabetic or numeric) or name |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | ISO 4217 alphabetic code. Example: USD |
| countries | string[] | Yes | Countries using this currency (alpha-2 codes). Example: ["US","EC","SV"] |
| minor_units | integer | null (int32) | No | Decimal places (minor units). Example: 2 |
| name | string | Yes | Currency name. Example: United States dollar |
| numeric | integer (int32) | Yes | ISO 4217 numeric code. Example: 840 |
| symbol | string | No | Common currency symbol. Example: $ |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/currencies/example',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/currencies/example',
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/currencies/example"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 404 | Currency not found |