Currencies API

Description

Lookup a currency by its ISO code to find out which countries actively use it.

Endpoint

> GET https://api.jsonrepo.com/v1/knowledge/finance/currencies

Headers

Field Description
api_key Required Your API Key

Parameters

Field Type Description
currency String Required The currency to lookup (case insensitive)
Format: ISO a-3
Example: USD

Response

A successful request will result in a populated payload field with the expected output.

A failed request will result in an error output as detailed in Error Rules. If the endpoint validation fails due to missing, badly formatted or invalid parameters, the endpoint will return HTTP code 400 along with a message detailing the error.

See the examples section for more information.

Request

  • Curl
// Look up `CHF`

curl -G \
https://api.jsonrepo.com/v1/knowledge/finance/currencies \
-H "api_key: {YOUR_API_KEY_HERE}" \
--data-urlencode "currency=CHF"

Success Response

{
    "http_code": 200,
    "http_message": "Ok",
    "message": "Successful execution",
    "payload": {
        "currency": {
            "iso_code": "CHF",
            "name": "Swiss franc",
            "symbol": "Fr.",
            "countries": [
                {
                    "country_name": "Swiss Confederation",
                    "country_iso_2": "CH",
                    "country_iso_3": "CHE",
                    "country_name_short": "Switzerland"
                },
                {
                    "country_name": "Principality of Liechtenstein",
                    "country_iso_2": "LI",
                    "country_iso_3": "LIE",
                    "country_name_short": "Liechtenstein"
                }
            ],
            "db_entry_last_updated_at": "2024-08-05 16:06:17"
        }
    }
}

Error Response Examples

// Request with missing `currency` parameter

{
    "http_code": 400,
    "http_message": "Bad Request",
    "message": "Malformed request: `currency` parameter must be provided.",
    "payload": []
}