Current vs. typical traffic volumes comparison
The dataset compares current traffic volumes measured by a selected traffic counter with typical (average) values for the given day of the week. For the "day" period it returns hourly values for the last 2 days, for the "week" period daily values for the last 8 days, always for the selected vehicle class.
Publisher
Transport Department, City of Trnava
Format
API JSON
License
CC BY 4.0
Update frequency
Daily
Last modified
3. 11. 2026
Download data
- API JSON Sample
- CSV Sample
- XML Sample
- API Documentation
Parameters
{
"item": [
"6544fa3a6290fa000100c229"
],
"class": 2,
"period": "week",
"limit": 4
}
item (array of strings, required) – List of traffic counter identifiers.
class (number, required) – Vehicle class (category) according to the counter classification, e.g. 2 – passenger cars.
period (string, required) – Period: "day" (hourly values for the last 2 days) or "week" (daily values for the last 8 days).
limit (number, optional) – Maximum number of returned (most recent) time intervals, default 100.
Request
POST https://opendata.trnava.sk/api/datasets/v2/traffic-counters/history-comparison-total
Answer
{
"labels": [
"2026-10-10T22:00:00.000Z",
"2026-10-11T22:00:00.000Z",
"2026-10-12T22:00:00.000Z"
],
"datasets": [
{
"label": "current",
"data": [
16070,
24462,
24922
]
},
{
"label": "typical",
"data": [
12764,
17700,
17591
]
}
]
}
labels – List of timestamps of interval starts (hours or days, UTC).
datasets – List of data series.
datasets.label – Series label: "current" (currently measured values) or "typical" (typical values).
datasets.data – Series values ordered by labels: for "current" the number of vehicles of the selected class in the interval, for "typical" the average number of vehicles for the given day of the week over the last 365 days.
Request
GET https://opendata.trnava.sk/api/datasets/v2/traffic-counters/history-comparison-total?outputType=csv
Answer
"labels.0","labels.1","labels.2","labels.3","datasets.0.label","datasets.0.data.0","datasets.0.data.1","datasets.0.data.2","datasets.0.data.3","datasets.1.label","datasets.1.data.0","datasets.1.data.1","datasets.1.data.2","datasets.1.data.3"
"2026-10-10T22:00:00.000Z","2026-10-11T22:00:00.000Z","2026-10-12T22:00:00.000Z","2026-10-13T22:00:00.000Z","current",16070,24462,24922,25141,"typical",12764,17700,17591,17921
labels – List of timestamps of interval starts (hours or days, UTC).
datasets – List of data series.
datasets.label – Series label: "current" (currently measured values) or "typical" (typical values).
datasets.data – Series values ordered by labels: for "current" the number of vehicles of the selected class in the interval, for "typical" the average number of vehicles for the given day of the week over the last 365 days.
Request
GET https://opendata.trnava.sk/api/datasets/v2/traffic-counters/history-comparison-total?outputType=xml
Answer
<root>
<labels>
<item>2026-10-10T22:00:00.000Z</item>
<item>2026-10-11T22:00:00.000Z</item>
<item>2026-10-12T22:00:00.000Z</item>
</labels>
<datasets>
<item>
<label>current</label>
<data>
<item>16070</item>
<item>24462</item>
<item>24922</item>
</data>
</item>
<item>
<label>typical</label>
<data>
<item>12764</item>
<item>17700</item>
<item>17591</item>
</data>
</item>
</datasets>
</root>
labels – List of timestamps of interval starts (hours or days, UTC).
datasets – List of data series.
datasets.label – Series label: "current" (currently measured values) or "typical" (typical values).
datasets.data – Series values ordered by labels: for "current" the number of vehicles of the selected class in the interval, for "typical" the average number of vehicles for the given day of the week over the last 365 days.