Stream: programmēšanas pulciņš

Topic: Latvija Pasts data


view this post on Zulip markalex (Feb 20 2026 at 09:52):

So, let me put here info I found and some progress, because I'm not sure I'll be able to act on it.

URL

https://mans.pasts.lv/api/public/addresses/service_location?type[]=6&type[]=1&type[]=2&country[]=LV&search=&itemsPerPage=10000&page=1 is "curlable", so we can fetch and use this data.
Without filtration data also has locations at LT and EE, but filtration by countries can be done in the URL (already in the example url above)

Types

7 - UniSend
6 - Latvija Pasts parcel locker
2 - post box
1 - post office
Don't know (didn't look) what 3-5 mean or if they exist.

Data

Example of data

    {
      "@id": "/api/addresses/service_location/3122",
      "@type": "ServiceLocation",
      "id": "3122",
      "type": 2,
      "countryCode": "LV",
      "postCode": "LV-1055",
      "readableAddress": "Cementa iela 12, Rīga, LV-1055",
      "label": "Iļģuciema pasta nodaļa",
      "latitude": 56.969091258159,
      "longitude": 24.061597193063,
      "workingHours": {
        "@type": "WorkingHours",
        "monday": "09:00-18:00",
        "tuesday": "09:00-18:00",
        "wednesday": "09:00-18:00",
        "thursday": "09:00-18:00",
        "friday": "09:00-18:00",
        "saturday": "-",
        "sunday": "-"
      },
      "workingHoursCombined": [],
      "outside": false,
      "status": 1,
      "info": "",
      "locationPostCode": "LV-1055",
      "officeFcd": "LV1055"
    }

view this post on Zulip markalex (Feb 20 2026 at 09:53):

I guess everything what was implemented in Osmalyzer before can be updated, and also a bunch more (for example stuff like inside flag)

view this post on Zulip markalex (Feb 20 2026 at 13:50):

@HellMap, I think that maybe I fixed fetching data. You can see here: https://github.com/OSMLatvija/Osmalyzer/compare/main...markalex2209:Osmalyzer:main

But results for post offices and boxes look very suspicious.
I've heard that some offices were closed, but I don't think so much.
And boxes - it's like almost all of them are missing? Were they just replaced with lockers or something?

Parsing OSM data in Latvia against various data sources - Comparing OSMLatvija:main...markalex2209:main · OSMLatvija/Osmalyzer

view this post on Zulip HellMap (Feb 20 2026 at 14:48):

I'll check it out

view this post on Zulip HellMap (Feb 20 2026 at 16:17):

So the type values have changed from before

case 1: // e.g. "Juglas pasta nodaļa" or Klientu centrs Kauguri"
case 2: // e.g. "Iļģuciema pasta nodaļa" or "Klientu centrs Ziepniekkalns"
    return LatviaPostItemType.Office;
// I have no idea what the difference between 1 and 2 is - both have offices and client centers
// and none of the other data fields suggest any clear difference

case 6: // e.g. "Rīga Biķernieku iela Rimi" or "Jelgava TC Valdeka" or "Unisend 8009 Rimi"
    return LatviaPostItemType.ParcelLocker;

// 7 appear to be Unisend LT and EE parcel lockers
// e.g. "Visalaukio g. 1, Vilnius, 08428" or "Ehitajate tee 107, Tallinn, 13511"

case 9: // e.g. "Jelgava vēstuļu kastīte Nr.3007" or "Rīga vēstuļu kastīte Nr.5"
    return LatviaPostItemType.PostBox;

view this post on Zulip markalex (Feb 20 2026 at 20:04):

Nice find!
I'm baffled that both type 1 and 2 are post offices, to be honest.
But very glad you caught it

view this post on Zulip HellMap (Feb 20 2026 at 20:14):

Yeah, I loaded the json into Excel to just look at the values. It's weird, I cannot determine what possible difference there is between 1 and 2. It seems completely arbitrary. Thei website doesn't have a filter for mailboxes, but you can still get them from API (although there seem to only be 160 or so, it's possible they are being dismantled slowly as few people use letters).

view this post on Zulip HellMap (Feb 20 2026 at 20:16):

I don't know if I trust their data to mass-update. But also current OSM data is so out of date that even broken LP data would be better...

view this post on Zulip markalex (Feb 20 2026 at 20:23):

Only thing what can theoretically split post offices I can think right now is a boring old office versus one responsible for multiple post codes. But based on the data I don't think it's the case.

Also possibly there is some kind of invisible difference, like office handles packages or not, or accepts payments or not, etc. I suspect we'll never know.

view this post on Zulip markalex (Feb 20 2026 at 20:27):

Regarding mail boxes - I remember we discussed a year ago that they started setting up locker with integrated mailbox. I suspect those will eventually kill mailboxes entirely.

view this post on Zulip markalex (Feb 20 2026 at 20:27):

HellMap said:

I don't know if I trust their data to mass-update. But also current OSM data is so out of date that even broken LP data would be better...

IMO, mass-update is reasonable here. Indeed too much of outdated offices and mailboxes to process them manually in any kind of time.

view this post on Zulip Rihards Olups (Feb 27 2026 at 21:42):

markalex said:

Only thing what can theoretically split post offices I can think right now is a boring old office versus one responsible for multiple post codes. But based on the data I don't think it's the case.

Also possibly there is some kind of invisible difference, like office handles packages or not, or accepts payments or not, etc. I suspect we'll never know.

Two years ;)
#general > Latvijas Pasts pakomātu vēstuļu sūtīšana


Last updated: Mar 13 2026 at 01:19 UTC