oneapi
Sign in
Financiar v1 / Inflatie

External trade — total and trade balance

FOB exports, CIF imports, the two trade balances and the two indices, annually from 1991 to 2025. 630 values from the TEMPO matrices EXP101A, EXP102A, EXP103A, EXP103B, EXP104A and EXP105A.

⚠️ The currency is a dimension, not a label. The same quantity is published simultaneously in lei, dollars and euro; without moneda, the response would carry the same series three times over. The default is euro. The indices are in percent and have no currency — the filter does not remove them from the response.

⚠️ The lei series hides the 2005 denomination, with a different factor from the rest of the module. It is in millions of old lei, not billions: total exports jump from 767,940,109 in 2004 to 80,663 in 2005, that is a division by 10,000. The publicat block keeps the raw value.

✅ FOB exports − CIF imports = the fob_cif balance closes 35 of 35 years, with a derived tolerance of 1 million — the source publishes whole millions, and two rounded terms can deviate by that much.

⚠️ The fob_fob balance is NOT a presentational variant of the other and cannot be checked from the published data: it would require imports valued FOB, which are not published separately. The difference between the two balances is the CIF−FOB margin, that is transport and insurance on imports — 446 million dollars in 1991, 5,503 in 2024. The response gives it computed, in identitati.marja_cif_fob.

⚠️ The private ownership breakdown stops in 2006, 16 years out of 35.

GET
https://oneapi.ro/api/financiar/v1/comert-exterior

Query parameters

NameTypeDescriptionAccepted values
variantaoptional string | null Optional, for the balance only: fob_cif or fob_fob. fob_fobfob_cif
proprietateoptional string | null Optional: total (default) or privata, the latter only up to 2006. totalprivata
de_laoptional integer | null Optional, a year, from 1991. 1991 – 2100
pana_laoptional integer | null Optional, a year. 1991 – 2100
indicatorlistoptional text Optional, comma-separated: valoare, sold, indice_valoric, indice_valoare_unitara. All by default. valoaresoldindice_valoricindice_valoare_unitara
fluxlistoptional text Optional: export, import. The balance has no flux — it is the difference between them. exportimport
monedalistoptional text Optional: lei, usd, eur. eur by default. The indices have no currency. leiusdeur

How it behaves

  • Exports FOB, imports CIF, both trade-balance figures and the two indices — annually from 1991 to 2025. 630 values from TEMPO matrices EXP101A, EXP102A, EXP103A, EXP103B, EXP104A and EXP105A.
  • ⚠️ Currency is a dimension, not a label. The same magnitude is published in lei, dollars and euro at once; without moneda the response would carry the same series three times. The default is euro. The two indices are percentages and have no currency — the currency filter does not drop them from the response.
  • ⚠️ The lei series hides the 2005 denomination, with a DIFFERENT factor from the rest of the module. Here the source publishes in millions of old lei, not billions: total exports fall from 767,940,109 in 2004 to 80,663 in 2005. So million ROL → million RON means dividing by 10,000, not multiplying by 0.1 as in /financiar/v1/intreprinderi/rezultate. Verified: 767,940,109 / 10,000 = 76,794 against 80,663 in 2005 — a 5% rise, a continuous series. The publicat block keeps the raw value and the factor.
  • ✅ exports FOB − imports CIF = the fob_cif balance closes in 35 of 35 years, at a derived tolerance of 1 million: the source publishes whole millions, and two rounded terms can drift by that much. The identity is computed from the database rather than the filtered response — asking for exports alone could never close it.
  • ⚠️ The fob_fob balance is NOT a presentational variant of the other and cannot be verified from published data: it would require imports valued FOB, which are not published separately. The difference between the two balances IS the CIF−FOB margin — freight and insurance on imports: 446 million dollars in 1991, 5,503 in 2024. The response returns it computed, in identitati.marja_cif_fob, so nobody has to perform a subtraction they might do the wrong way round.
  • ⚠️ The private-ownership breakdown stops in 2006 — 16 years out of 35. The total runs to the present.
  • ⚠️ The source writes “the total” two ways on the same dimension: - for exports, Total for imports. The projection normalises both to total; a literal match would have missed half the pair.

What it is for

  • Romania’s trade deficit across thirty-five years, in the currency of choice.
  • The freight and insurance cost of imports, as a series in its own right.
  • Separating price growth from volume growth through the two indices.
  • The same series in lei, dollars and euro, without doing the conversion yourself.

Response structure

FieldTypeDescription
data.de_la integer Start of the interval the response covers.
data.pana_la integer End of the interval the response covers, inclusive.
data.filtre.moneda array Currency the values are expressed in.
data.filtre.proprietate string Form of ownership.
data.ani array Years for which values exist.
data.serii[].indicator string The statistical indicator the value refers to.
data.serii[].denumire string The name, exactly as the source publishes it.
data.serii[].flux string Direction of the flow (usually import or export).
data.serii[].unitate string Unit of measure of the values. Read it before plotting or summing them.
data.serii[].ani_publicati integer Years the source actually published for this series.
data.serii[].valori object The values of the series, by period.
data.identitati.sold object The exports − imports = fob_cif balance check, computed from the database, at a tolerance derived from the published precision.
data.identitati.sold.identitate string The identity being checked — which sum must equal which total.
data.identitati.sold.toleranta string How much deviation is accepted before the identity counts as unclosed — the source rounding, not an error.
data.identitati.sold.nota string A note on how to read the data — a pitfall, a convention or a limit of the source.
data.identitati.sold.verificari integer How many combinations were checked.
data.identitati.sold.inchise integer How many checks closed within tolerance.
data.identitati.sold.abatere_maxima string Largest deviation found between the sum of components and the total.
data.identitati.sold.unde null The category and period with the largest deviation. Absent when everything closes.
data.identitati.marja_cif_fob object The difference between the two balances: the freight and insurance cost of imports, computed for each year.
data.identitati.marja_cif_fob.ce_e string
data.identitati.marja_cif_fob.nota string A note on how to read the data — a pitfall, a convention or a limit of the source.
data.identitati.marja_cif_fob.unitate string Unit of measure of the values. Read it before plotting or summing them.
data.identitati.marja_cif_fob.valori object The values of the series, by period.
meta.sursa string The official source the data comes from, with its licence where one is required.
meta.acoperire.de_la integer The first period we have data for.
meta.acoperire.pana_la integer The last period we have data for.
meta.serii_returnate integer How many series were actually returned, after filters and the cell ceiling.
meta.nota_implicit string Which value was used when the parameter was not sent.
meta.nota_identitate string How the identity above is checked and what it means when it does not close.
meta.nota_sold string A note on how to read the response: a caveat, a convention or a limit of the source.
meta.nota_proprietate string A note on how to read the response: a caveat, a convention or a limit of the source.
data.serii[].publicat Present only on lei years up to 2004: the raw value in millions of old lei and the 0.0001 factor.
data.serii[].varianta On the balance only: fob_cif or fob_fob. The two are not variants of one figure.
meta.fara_date data is null and this says why. The projection over the INS data is empty. The combination has no series; note that varianta exists only on the balance and privata stops in 2006. As for the other series.
meta.fara_date_cod The short, STABLE word for the reason, for clients that branch on it in code: fara_date is prose and may be rephrased, this is not.

Response examples

GEThttps://oneapi.ro/api/financiar/v1/comert-exterior
{
    "data": {
        "de_la": 1991,
        "pana_la": 2025,
        "filtre": {
            "moneda": [
                "eur"
            ],
            "proprietate": "total"
        },
        "ani": [
            1991,
            1992,
            1993,
            1994,
            1995,
            1996,
            1997,
            1998,
            1999,
            2000,
            2001,
            2002,
            2003,
            2004,
            2005,
            2006,
            2007,
            2008,
            2009,
            2010,
            2011,
            2012,
            2013,
            2014,
            2015,
            2016,
            2017,
            2018,
            2019,
            2020,
            2021,
            2022,
            2023,
            2024,
            2025
        ],
        "serii": [
            {
                "indicator": "indice_valoare_unitara",
                "denumire": "Indicele valorii unitare",
                "flux": "export",
                "unitate": "procente",
                "ani_publicati": 25,
                "valori": {
                    "1991": null,
                    "1992": null,
                    "1993": null,
                    "1994": null,
                    "1995": null,
                    "1996": null,
                    "1997": null,
                    "1998": null,
                    "1999": null,
                    "2000": "108.9",
                    "2001": "100.6",
                    "2002": "98.5",
                    "2003": "98.2",
                    "2004": "105.1",
                    "2005": "109.5",
                    "2006": "108.2",
                    "2007": "106",
                    "2008": "103.8",
                    "2009": "89.3",
                    "2010": "107",
                    "2011": "107.9",
                    "2012": "103.9",
                    "2013": "97",
                    "2014": "98.5",
                    "2015": "100.2",
                    "2016": "98.2",
                    "2017": "101.6",
                    "2018": "103.8",
                    "2019": "101.4",
                    "2020": "98.8",
                    "2021": "109.4",
                    "2022": "116.8",
                    "2023": "100.8",
                    "2024": "99.9",
                    "2025": null
                }
            }
        ],
        "identitati": {
            "sold": {
                "identitate": "export FOB − import CIF = sold `fob_cif`",
                "toleranta": "1",
                "nota": "Cerută din bază, pe moneda şi proprietatea răspunsului — un răspuns filtrat pe un singur flux n-ar avea cum s-o închidă. Toleranţa e derivată: sursa publică milioane întregi, iar doi termeni rotunjiţi pot devia cu 1. Măsurat pe toată seria: 35 din 35 de ani.",
                "verificari": 35,
                "inchise": 35,
                "abatere_maxima": "0",
                "unde": null
            },
            "marja_cif_fob": {
                "ce_e": "Diferenţa dintre cele două solduri publicate: costul de transport şi asigurare al importurilor, adică exact ce separă evaluarea CIF de cea FOB.",
                "nota": "⚠️ `sold fob_fob` NU se poate verifica din datele publicate — ar cere importul evaluat FOB, care nu se publică separat. Nu e o variantă de prezentare a celuilalt sold.",
                "unitate": "milioane EUR",
                "valori": {
                    "1991": "365",
                    "1992": "371",
                    "1993": "429",
                    "1994": "461",
                    "1995": "612",
                    "1996": "702",
                    "1997": "769",
                    "1998": "811",
                    "1999": "764",
                    "2000": "1095",
                    "2001": "1338",
                    "2002": "1454",
                    "2003": "1632",
                    "2004": "2023",
                    "2005": "2507",
                    "2006": "3137",
                    "2007": "3951",
                    "2008": "4406",
                    "2009": "2999",
                    "2010": "3608",
                    "2011": "4230",
                    "2012": "2255",
                    "2013": "2280",
                    "2014": "2412",
                    "2015": "2596",
                    "2016": "2777",
                    "2017": "3117",
                    "2018": "3340",
                    "2019": "3478",
                    "2020": "3247",
                    "2021": "3965",
                    "2022": "5080",
                    "2023": "4920",
                    "2024": "5082",
                    "2025": "5213"
                }
            }
        }
    },
    "meta": {
        "sursa": "Institutul Naţional de Statistică — comerţul internaţional cu bunuri (TEMPO, matricile EXP101A, EXP102A, EXP103A, EXP103B, EXP104A şi EXP105A).",
        "acoperire": {
            "de_la": 1991,
            "pana_la": 2025
        },
        "serii_returnate": 8,
        "nota_implicit": "Fără `moneda` şi `proprietate`, răspunsul ar purta aceeaşi mărime de mai multe ori. Implicit: euro, total.",
        "nota_identitate": "Verificat pe acest răspuns: 35 din 35 ani se închid la toleranţa de 1 milion.",
        "nota_sold": "Cele două solduri nu sunt variante de prezentare: `fob_cif` se verifică din export şi import, `fob_fob` nu. Diferenţa dintre ele e marja de transport şi asigurare a importurilor.",
        "nota_proprietate": "Defalcarea `privata` se opreşte în 2006; totalul merge până la zi."
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatMissing or invalid token.
403feature_indisponibilfinanciar.indici is not in the current plan.
422validareIndicator, flux, currency, variant or form outside the list; year outside the range.
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": "validare",
        "mesaj": "Indicator, flux, currency, variant or form outside the list; year outside the range.",
        "detalii": {
            "varianta": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}