oneapi
Sign in
Utile v1 / Coduri

Country detail

A whole country: the ISO codes, the names, the official currency with its details and the subdivisions, where we cover them.

GET
https://oneapi.ro/api/utile/v1/coduri/tari/{cod}

Path parameters

NameTypeDescriptionExample
codrequired string Country code — ISO 3166-1 alpha-2 or alpha-3 (e.g. RO, ROU).

Query parameters

This route accepts no query parameters.

How it behaves

  • The route accepts all three forms because the caller often has only one of them, and making them look up the equivalent themselves is exactly the work the route does for them.
  • valuta_detalii includes the currency's decimal places — which are NOT always 2. The Japanese yen has 0, the Tunisian dinar has 3. Rounding everything to two produces wrong invoices.

What it is for

  • Convert a code received from a partner into the form your system uses.
  • Find the currency and its decimal places, to format an amount correctly for a country.
  • Check whether a country code is valid before storing it.

Response structure

All fields below live inside data.

FieldTypeDescription
tara.alpha_2 string
tara.alpha_3 string
tara.numeric string
tara.nume string The name, exactly as the source publishes it.
tara.nume_en string
tara.continent string The continent it is on.
tara.valuta string ISO 4217 currency code.
tara.prima_zi_saptamana integer
tara.weekend array
tara.valuta_detalii object The official currency, with name, symbol and decimals.
tara.valuta_detalii.cod string Code from the source code list — the key you filter on.
tara.valuta_detalii.nume string The name, exactly as the source publishes it.
tara.valuta_detalii.nume_en string
tara.valuta_detalii.simbol null The symbol, where one exists distinct from the code; otherwise null.
tara.valuta_detalii.zecimale integer How many decimals the currency has. 0 for the yen, 3 for the Tunisian dinar.
tara.valuta_detalii.tari array All territories using this currency.
sursa.nume string Name of the official source.
sursa.versiune string Version of the dataset or artefact the values come from.
sursa.licenta string The licence under which the source allows reuse.
sursa.observatie string What to know about the source before using the data.

Response examples

GEThttps://oneapi.ro/api/utile/v1/coduri/tari/ROU
{
    "data": {
        "tara": {
            "alpha_2": "RO",
            "alpha_3": "ROU",
            "numeric": "642",
            "nume": "România",
            "nume_en": "Romania",
            "continent": "Europa",
            "valuta": "RON",
            "prima_zi_saptamana": 1,
            "weekend": [
                6,
                7
            ],
            "valuta_detalii": {
                "cod": "RON",
                "nume": "leu românesc",
                "nume_en": "Romanian Leu",
                "simbol": null,
                "zecimale": 2,
                "tari": [
                    "RO"
                ]
            }
        },
        "sursa": {
            "nume": "ICU / CLDR (Unicode Common Locale Data Repository), prin runtime-ul PHP",
            "versiune": "76.1",
            "licenta": "Unicode License.",
            "observatie": "Se actualizează la un upgrade de imagine, nu printr-un import — de aceea versiunea CLDR e în răspuns."
        }
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
404negasitNo country exists with the given code.
429cota_depasitaThe plan's monthly quota has been exceeded (see Retry-After).

All errors share the same shape. eroare.cod is stable and is the value you should branch on in code — not the text in mesaj, which may change.

{
    "eroare": {
        "cod": "negasit",
        "mesaj": "No country exists with the given code."
    }
}