Read data
Every list in the API works the same way. Learn it once and it holds for companies, values, property units and the rest. Which filters a list takes is in the API reference.
Pages
page starts at 1. pageSize is 50 unless you say otherwise, and at most 500. If you ask for more you get 500, and the header Sedis-Page-Size-Clamped: true says so.
totalPages tells you when to stop. Counting takes time on large lists: add count=false and totalCount and totalPages are left out. Then carry on until data is empty.
Filter, sort and choose fields
Filter with the named parameters of each list, such as companyId, parameterCode or nameContains. Several filters all have to match. sedisIdIn takes several ids with commas between them.
Sort with sort, and a minus sign for descending order. sort=-figure puts the highest first, and sort=parameterCode,-quarterId sorts on two fields.
Choose fields with fields=companyId,name to get only those and a smaller answer. On property units, collections and comparison areas a few fields are only sent when you ask for them. Name the others you want as well, such as fields=sedisId,name,geometry:
| Field | What it is |
|---|---|
geometry |
The location or outline, as GeoJSON |
belongsToComparisonAreas |
Which of your comparison areas the property unit is in |
containsPropertyUnits |
Which of your property units are in the comparison area |
A field or a sort order that does not exist gives 400, and the answer names it.
Language
Names and descriptions are in English. Add lang=sv, or send Accept-Language: sv, for Swedish. A text that has not been translated yet comes in Swedish: today that goes for the names of the parameter groups, the property types and the periods in Bolagsanalys.
Field names, codes and ids are the same in both languages.
Find by place
Property units, collections and comparison areas can be found by where they are. Coordinates are longitude and latitude in degrees (WGS 84).
| To find what is | Send |
|---|---|
| In a rectangle | bbox=17.8,59.2,18.2,59.4 (west, south, east, north) |
| Near a point | nearLon=18.07&nearLat=59.33&radiusM=2000 |
| In a shape | wkt=POLYGON((…)) |
A large shape does not fit in an address. Send it with POST to /search after the same list instead. The body takes a GeoJSON geometry or a wkt, and the same filters and paging:
curl -X POST -H "X-Api-Key: $SEDIS_API_KEY" -H "Content-Type: application/json" \
"https://api.sedis.se/v2/fastighetsbenchmark/property-units/search" \
-d '{
"geometry": { "type": "Polygon",
"coordinates": [[[17.8,59.2],[18.2,59.2],[18.2,59.4],[17.8,59.4],[17.8,59.2]]] },
"pageSize": 100
}'
Bolagsanalys has a similar search, for when you want figures for a chosen set of companies: POST data/search with up to 50 companyIds.
Keep a copy up to date
Many customers fetch everything once and then only what is new, every night.
Only what has changed
curl -H "X-Api-Key: $SEDIS_API_KEY" \
"https://api.sedis.se/v2/bolagsanalys/data?changedSince=2025-12-02&pageSize=500"
changedSince gives new figures and corrections of old quarters alike. Most nights there is nothing. Send a day, or better, the highest lastUpdatedUtc you have saved: then your own clock does not matter. What was changed at exactly that moment comes once more, so overwrite on company, parameter and quarter.
Your own values
Values change when you write them, when Sedis publishes an upload, and when a comparison area is recalculated. Fetch the values again for what you follow. If you wait for something you have just written, wait until calculation.status is current on the property unit.
Has it changed at all?
The answer to a GET of property units, collections or comparison areas has an ETag. Send it back in If-None-Match next time, and if nothing has changed you get an empty 304 Not Modified.
curl -i -H "X-Api-Key: $SEDIS_API_KEY" -H 'If-None-Match: W/"…"' \
"https://api.sedis.se/v2/fastighetsbenchmark/property-units"
Compressed answers
Ask for compressed answers. They are about a tenth of the size. Python, R, Power Query and browsers do it by themselves. In .NET you turn it on, as in the example below, and curl needs --compressed.
Example in Python
Fetches the figures that have changed since last time, and saves them in a local database. Run it every night.
import os
import sqlite3
import requests
API = "https://api.sedis.se/v2"
session = requests.Session()
session.headers["X-Api-Key"] = os.environ["SEDIS_API_KEY"]
db = sqlite3.connect("sedis.db")
db.execute("""create table if not exists figure (
company text, parameter text, quarter int, figure real, text text, updated text,
primary key (company, parameter, quarter))""")
# None the first time, which fetches everything
latest = db.execute("select max(updated) from figure").fetchone()[0]
page = 1
while True:
answer = session.get(f"{API}/bolagsanalys/data", timeout=60, params={
"changedSince": latest, "page": page, "pageSize": 500, "count": "false"})
answer.raise_for_status()
rows = answer.json()["data"]
if not rows:
break
db.executemany("insert or replace into figure values (?, ?, ?, ?, ?, ?)", [
(r["companyId"], r["parameterCode"], r["quarterId"], r.get("figure"), r.get("text"), r["lastUpdatedUtc"])
for r in rows])
page += 1
db.commit()
print(f"{db.total_changes} figures saved")
The first run fetches everything: several hundred thousand figures, in ten to twenty minutes. Ask info@sedis.se for a file to start from if you would rather load that. A field without a value is left out of the answer, and that is why the example reads figure and text with get.
Example in C#
Prints the total return of your property units next to that of a comparison area.
using System.Net;
using System.Net.Http.Json;
using var http = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.All })
{
BaseAddress = new Uri("https://api.sedis.se/v2/fastighetsbenchmark/")
};
http.DefaultRequestHeaders.Add("X-Api-Key", Environment.GetEnvironmentVariable("SEDIS_API_KEY"));
var area = (await Get<Comp>("comparison-areas?pageSize=1")).Single();
var units = await Get<Comp>($"property-units?belongsToComparisonAreaSedisId={area.SedisId}&pageSize=500");
var names = units.Append(area).ToDictionary(c => c.SedisId, c => c.Name);
var values = await Get<Value>(
$"comp-data?sedisIdIn={string.Join(',', names.Keys)}¶meterCode=VG0&fromDate=2020-12-31&pageSize=500");
foreach (var value in values.OrderBy(v => v.ValueDate).ThenBy(v => names[v.SedisId]))
Console.WriteLine($"{value.ValueDate:yyyy} {names[value.SedisId],-40} {value.Figure,8:N2} %");
async Task<List<T>> Get<T>(string address) => (await http.GetFromJsonAsync<Page<T>>(address))!.Data;
record Page<T>(List<T> Data);
record Comp(string SedisId, string Name);
record Value(string SedisId, DateOnly ValueDate, decimal? Figure);
Make a client from the specification
The API is described in OpenAPI at /openapi/v2.json. Tools such as Kiota, NSwag and openapi-generator can make a client from it in most languages.