News for hackers. Stuff that matters.
Re:Why my favourite API is a zipfile on the European Central... by xg15 on Friday September 15, 2023 @02:07PM (#37526969)
I think for <1MB of data, with changes once (or twice) a year, the correct API is a static webserver with working ETag/If-Modified-Since support.

If you want to get really fancy, offer an additional webhook which triggers if the file changes - so clients know when to redownload it and don't have to poll once a day.

...or make a script that sends a predefined e-mail to a mailing list when there is a change.

Re:Why my favourite API is a zipfile on the European Central... by justsomehnguy on Friday September 15, 2023 @02:32PM (#37527329)
> ETag/If-Modified-Since

See above. Also you can just publish the version in DNS with a long enough TTL

Re:Why my favourite API is a zipfile on the European Central... by calpaterson on Friday September 15, 2023 @02:59PM (#37527688)
> working ETag/If-Modified-Since support

I completely agree and csvbase already implements this (so does curl btw), try:

    curl --etag-compare stock-exchanges-etag.txt --etag-save stock-exchanges-etag.txt https://csvbase.com/meripaterson/stock-exchanges.parquet -O
Re:Why my favourite API is a zipfile on the European Central... by carl_dr on Friday September 15, 2023 @03:32PM (#37528097)
Honestly, for <1MB, anything more then “just serve the file” is overthinking it both for the server and the clients.