Sweden sets one retail price for every prescription medicine in its benefits scheme. The price is the same in every pharmacy, and the authority that sets it, TLV, publishes the whole price database as a spreadsheet anyone may download and reuse.
We run Andningskollen , an independent Swedish site about asthma and COPD medicines, and we rebuild our price tables from that file every month. This post is about what the file looks like, the one trap that cost us a day, and a small finding you can reproduce in 20 lines of Python.
The data
TLV offers no API. There are two downloads:
the complete price database, one row per pack, with the pharmacy purchase price (AIP), the retail price (AUP) and a ready-made column for price per unit;
a monthly list of the "product of the period": the pack a pharmacy must offer when it substitutes within a group of interchangeable medicines.
The two files join on the pack id from the national product register (NPL).…