oneapi
Sign in
Mediu v1 / Mediu

Station ranking

The stations ranked by their period average for a pollutant — cleanest to most polluted. The averages come only from days with measurements, not from zeros.

GET
https://oneapi.ro/api/mediu/v1/aer/clasament

Query parameters

NameTypeDescriptionAccepted values
poluantrequired string The pollutant. Required. PM10PM2.5NO2O3SO2CO
de_laoptional string | null First day included, YYYY-MM-DD. e.g. 2026-01-01
pana_laoptional string | null Last day included, YYYY-MM-DD. e.g. 2026-06-30
ordineoptional string | null descrescator (default) or crescator. crescatordescrescator
limitaoptional integer | null How many stations to return, maximum 200. Defaults to 50. 1 – 200
zile_minimeoptional integer | null How many days with data a station needs to enter the ranking. Defaults to 30. 1 – 365

How it behaves

  • Pollutants are not measured at the same stations. PM10 has 171 stations, NO2 149, SO2 116, CO 99, O3 83, and PM2.5 only 78. A ranking or a comparison between two pollutants is in fact comparing two different networks, not just two substances. When comparing counties on PM2.5, remember that some have no station measuring it at all.
  • STATIONS are compared, not cities. A traffic station and a background station in the same city measure different realities; a ranking that mixes them says nothing about the city. Filter mentally on tip before drawing a conclusion.
  • zile_minime (default 30) is the coverage threshold: without it, a station with three days of data could top the ranking. Lower it only if you know what you are doing.
  • The default ordering is descending — with air quality, what matters first is who is doing badly.
  • The average is computed only over days with a publishable mean (at least 18 valid hours).

What it is for

  • Find where the most polluted air was measured in a period.
  • Compare stations of the same type across cities, correctly.
  • Illustrate in an article the difference between traffic and background stations.

Response structure

All fields below live inside data.

FieldTypeDescription
poluant object Poluantul, cu unitatea și valorile-limită.
perioada object The interval ranked; null means the whole series.
perioada.de_la string Începutul perioadei.
perioada.pana_la string Sfârșitul perioadei.
ordine string Ordinea aplicată.
zile_minime integer Pragul de acoperire aplicat.
inregistrari integer Câte stații conține clasamentul.
rezultate[].pozitie integer Poziția, de la 1.
rezultate[].statie string Codul EoI.
rezultate[].localitate string UAT-ul stației.
rezultate[].judet string Județul.
rezultate[].judet_cod string Indicativul auto.
rezultate[].tip string Tipul stației.
rezultate[].zona string Mediul de amplasare.
rezultate[].media number Media mediilor zilnice din perioadă.
rezultate[].maxim number Cea mai mare valoare orară din perioadă.
rezultate[].zile integer Câte zile cu medie publicabilă au intrat în calcul.
observatie string Avertismentul că se compară stații, nu orașe.
sursa object Sursa și licența.
poluant.cod integer The numeric pollutant code, as used by the EEA.
poluant.poluant string The symbol: PM10, NO2, O3, SO2, CO, PM2.5.
poluant.denumire string The name spelled out.
poluant.unitate string The unit of measure.
poluant.limite[] array The applicable legal limits: type, value, how many exceedances are tolerated per year, and the legal basis.

Response examples

GEThttps://oneapi.ro/api/mediu/v1/aer/clasament?poluant=PM10&limita=10
{
    "data": {
        "poluant": {
            "cod": 5,
            "poluant": "PM10",
            "denumire": "Pulberi în suspensie PM10",
            "unitate": "µg/m³",
            "limite": [
                {
                    "tip": "zilnic",
                    "valoare": 50,
                    "depasiri_tolerate_pe_an": 35,
                    "temei": "Directiva 2008/50/CE, anexa XI"
                }
            ]
        },
        "perioada": {
            "de_la": null,
            "pana_la": null
        },
        "ordine": "descrescator",
        "zile_minime": 30,
        "inregistrari": 10,
        "rezultate": [
            {
                "pozitie": 1,
                "statie": "RO0151A",
                "localitate": "Rovinari",
                "judet": "Gorj",
                "judet_cod": "GJ",
                "tip": "industrial",
                "zona": "suburban",
                "media": 40.34,
                "maxim": 448.322,
                "zile": 380
            }
        ],
        "observatie": "Se compară STAȚII, nu orașe. O stație de trafic și una de fond din același oraș măsoară realități diferite — `tip` spune care e care, iar un clasament care le amestecă nu spune nimic despre oraș.",
        "sursa": {
            "nume": "European Environment Agency — Air Quality Download Service (date raportate de România prin RNMCA/ANPM)",
            "url": "https://eeadmz1-downloads-webapp.azurewebsites.net/",
            "licenta": "Politica de reutilizare a EEA — reutilizare permisă cu indicarea sursei."
        }
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
422validarepoluant is missing, or ordine is neither of the two values.
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": "poluant is missing, or ordine is neither of the two values.",
        "detalii": {
            "poluant": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}