In general, the indoor temperature in your home should be no more than 24C, but this is raised to 26C during the summer, under recommendations from Sweden's Public Health Agency.
However, the guideline is that tenants shouldn't be living in conditions where indoor temperatures are above these levels for an "enduring" period of time. Exactly how long that can be isn't written in law, according to housing magazine Hem&Hyra, but it's usually considered to be at least a couple of weeks.
If the indoor temperature in your home exceeds these levels for longer than this, it's considered an "inconvenience to health", meaning that landlords are obligated to take measures aimed at reducing the temperature. This might be by installing special blinds or applying sun protection films to windows, for example.
But during temporary heatwaves -- like the one Sweden is currently experiencing -- the maximum habitable temperature is raised another 2C to 28C. That means that if your apartment has been 27C inside for two weeks, unfortunately you're not entitled to ask for these same measures.
And the temperature guidelines do not apply during "extreme weather conditions", which means that during an extreme heatwave (or cold spell during winter) you might need to live with uncomfortable temperatures for a short period of time.
In cases where you've been living in a rental property where the temperature has exceeded these maximum levels over a long period of time, you could be entitled to claim a partial refund of rent. In other words, this applies if the indoor temperature was over 24C for at least a few weeks outside summer, or over 26C for several weeks during the summer season.
In order to make this kind of claim, you'd need to keep a regular record of the indoor and outdoor temperatures over an extended period of time. You first need to ask your landlord to try to fix the problem, but if that doesn't work you can contact the Rent and Tenancy Tribunal (Hyresnämnden).
There are no fixed guidelines on how much you can claim back, since each case is addressed individually.
In the meantime, if you're struggling in the heat there are several measures you can take independently to reduce the temperature in the apartment. These could include keeping blinds closed during the day while you're out, opening windows at night to let in cooler air, and perhaps using fans.