Till senaste kommentaren

Corrupted empty 7z files (32 bytes) from KoDa API - SL TripUpdates

Hi Trafiklab team,

I am trying to download historical data via the KoDa API (v2) and running into an issue where the API returns an HTTP 200 OK, but the downloaded .7z file is exactly 32 bytes (which is just an empty archive header with no data).

It seems to affect multiple hours within most days from 2024 to now when querying SL realtime data with TripUpdates. I have verified this behaviour using this curl command:
curl "https://api.koda.trafiklab.se/KoDa/api/v2/gtfs-rt/sl/TripUpdates?date=2024-01-14&hour=11&key=**********" --output -
which returns 7z��'
whereas regular requests return much more data. This is verifiable with                     curl "https://api.koda.trafiklab.se/KoDa/api/v2/gtfs-rt/sl/TripUpdates?date=2024-01-14&hour=11&key=**********" -I
which in turn returns
HTTP/2 200
cache-control: no-cache
content-disposition: attachment; filename=sl-TripUpdates-2024-01-14-11.7z
content-type: application/x-7z-compressed
date: Tue, 27 Oct 2026 13:19:14 GMT
last-modified: Fri, 14 Aug 2026 00:12:16 GMT
server: Apache/2.4.29 (Ubuntu)
content-length: 32

Am ​I using the API in a wrong way or is there a problem ​delivering the files?

Thank you in advance for your help!
Raffael Huwe

Kommentarer

  • Hi,

    While the issue, corrupt files on the server, should be fixed now, please download data per day instead of per hour. You should not download more than one file at once. Downloading data for one hour only performs actually worse since downloading per day ​would give you a 100% cache hit rate for SL ​Tripupdates in 2024.

    Regards,
    Bert

    Bert på Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.