{"openapi":"3.1.0","info":{"title":"Rätt Lätt public API","version":"1.0.0","summary":"Read-only facts about Swedish electricity price areas, suppliers and the content on rattlatt.se.","description":"Read-only API for Rätt Lätt (Lätt rätt AB, org. no. 559404-7135), a Swedish comparison service for household electricity contracts.\n\nNo prices and no personal data: the price comparison itself requires a mobile number and is only available on the website.\n\nRate limit: 120 requests per 600 seconds per client IP, announced with IETF RateLimit and RateLimit-Policy headers; 429 responses carry Retry-After.\n\nVersioning: semantic versioning. Backwards-compatible additions raise the minor version; breaking changes get a new path (/api/v2) and the old version is kept for at least 6 months with Deprecation and Sunset headers. Current version 1.0.0, released 2026-09-26.\n\nErrors: RFC 9457 problem details (application/problem+json) with code, detail and resolution.\n\nAgent instructions: https://rattlatt.se/agents.md. MCP server (Streamable HTTP, same tools): https://rattlatt.se/mcp.","contact":{"name":"Rätt Lätt kundservice","url":"https://rattlatt.se/kontakt","email":"kundservice@rattlatt.se"},"termsOfService":"https://rattlatt.se/villkor","x-api-lifecycle":{"status":"stable","released":"2026-09-26","deprecationPolicy":"Breaking changes only in a new major path, announced 6 months ahead with Deprecation and Sunset headers."}},"externalDocs":{"description":"Agent instructions","url":"https://rattlatt.se/agents.md"},"servers":[{"url":"https://rattlatt.se/api/v1","description":"Production"}],"tags":[{"name":"price-areas","description":"Swedish electricity price areas SE1–SE4"},{"name":"suppliers","description":"Electricity suppliers in the comparison"},{"name":"content","description":"Pages and guides on rattlatt.se"}],"x-rate-limit":{"limit":120,"windowSeconds":600,"status":429,"headers":["RateLimit","RateLimit-Policy","Retry-After"]},"x-agent-instructions":"https://rattlatt.se/agents.md","paths":{"/elomraden":{"get":{"operationId":"listPriceAreas","summary":"List the four Swedish electricity price areas","description":"Returns SE1–SE4 with name, description and the page with all contracts in the area.","tags":["price-areas"],"responses":{"200":{"description":"Price areas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceAreaList"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}},"/elomraden/{omrade}":{"get":{"operationId":"getPriceArea","summary":"Get one price area","description":"Returns one price area (SE1, SE2, SE3 or SE4).","tags":["price-areas"],"parameters":[{"name":"omrade","in":"path","required":true,"description":"Price area id, SE1–SE4 (case-insensitive).","schema":{"type":"string","enum":["SE1","SE2","SE3","SE4","se1","se2","se3","se4"],"description":"Price area id."}}],"responses":{"200":{"description":"Price area","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceArea"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}},"/elomrade-uppslag":{"post":{"operationId":"lookupPriceArea","summary":"Find the price area for a Swedish postal code","description":"Looks up which price area (SE1–SE4) a five-digit Swedish postal code belongs to. The postal code is sent in the JSON body, never in the URL. Some postal codes span two areas (status \"ambiguous\").","tags":["price-areas"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostalLookupRequest"}}}},"responses":{"200":{"description":"Lookup result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostalLookupResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}},"/elbolag":{"get":{"operationId":"listSuppliers","summary":"List the electricity suppliers","description":"Suppliers with pages on rattlatt.se: company facts from Elify’s open API, contract types and the supplier page.","tags":["suppliers"],"responses":{"200":{"description":"Suppliers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierList"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}},"/elbolag/{slug}":{"get":{"operationId":"getSupplier","summary":"Get one supplier","description":"Company facts for one supplier, e.g. \"stockholms-elbolag\".","tags":["suppliers"],"parameters":[{"name":"slug","in":"path","required":true,"description":"Supplier slug as listed by listSuppliers.","schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Supplier slug."}}],"responses":{"200":{"description":"Supplier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}},"/sidor":{"get":{"operationId":"listPages","summary":"List public pages with a Markdown version","description":"Every public page that answers `Accept: text/markdown`, with title and URL.","tags":["content"],"responses":{"200":{"description":"Pages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageList"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}},"/sok":{"get":{"operationId":"searchContent","summary":"Search the pages and guides","description":"Full-text search in the Swedish content (guides, FAQ, price areas, suppliers, terms). Returns title, URL and a snippet.","tags":["content"],"parameters":[{"name":"q","in":"query","required":true,"description":"Search words in Swedish, 2–100 characters.","schema":{"type":"string","minLength":2,"maxLength":100,"description":"Search words."}},{"name":"limit","in":"query","required":false,"description":"Max number of hits (1–25, default 10).","schema":{"type":"integer","minimum":1,"maximum":25,"default":10,"description":"Max hits."}}],"responses":{"200":{"description":"Search hits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Problem"},"default":{"$ref":"#/components/responses/Problem"}}}}},"components":{"schemas":{"ApiIndex":{"type":"object","required":["name","version","openapi","endpoints"],"properties":{"name":{"type":"string","description":"API name"},"version":{"type":"string","description":"API version (semver)"},"openapi":{"type":"string","description":"URL of this OpenAPI document"},"mcp":{"type":"string","description":"URL of the MCP server (Streamable HTTP)"},"agents":{"type":"string","description":"URL of the agent instructions (Markdown)"},"llms":{"type":"string","description":"URL of llms.txt"},"docs":{"type":"string","description":"Human-readable developer page"},"endpoints":{"type":"array","description":"Operations","items":{"type":"object","required":["operationId","method","url"],"properties":{"operationId":{"type":"string","description":"Operation id"},"method":{"type":"string","description":"HTTP method"},"url":{"type":"string","description":"Absolute URL"},"description":{"type":"string","description":"What it does"}}}}}},"PriceArea":{"type":"object","required":["id","name","title","description","url","markdownUrl"],"properties":{"id":{"type":"string","enum":["SE1","SE2","SE3","SE4"],"description":"Price area id"},"name":{"type":"string","description":"Name, e.g. \"Elområde 3 (Stockholm)\""},"title":{"type":"string","description":"Page heading"},"description":{"type":"string","description":"Short description"},"url":{"type":"string","description":"Page with all contracts in the area"},"markdownUrl":{"type":"string","description":"Same URL; request it with Accept: text/markdown"}}},"PriceAreaList":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PriceArea"},"description":"Price areas"}}},"PostalLookupRequest":{"type":"object","required":["postnummer"],"additionalProperties":false,"properties":{"postnummer":{"type":"string","pattern":"^\\d{3} ?\\d{2}$","description":"Swedish postal code, five digits, e.g. \"114 35\"."}}},"PostalLookupResult":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ok","ambiguous","unknown","unavailable"],"description":"ok = one area; ambiguous = the postal code spans areas"},"priceArea":{"type":"string","enum":["SE1","SE2","SE3","SE4"],"description":"The price area (status ok)"},"alternatives":{"type":"array","items":{"type":"string","enum":["SE1","SE2","SE3","SE4"]},"description":"Possible areas (status ambiguous)"},"area":{"$ref":"#/components/schemas/PriceArea"}}},"Supplier":{"type":"object","required":["slug","name","legalName","orgNumber","inComparison","url","markdownUrl"],"properties":{"slug":{"type":"string","description":"Slug"},"name":{"type":"string","description":"Display name"},"legalName":{"type":"string","description":"Registered company name"},"orgNumber":{"type":"string","description":"Swedish organisation number"},"group":{"type":["string","null"],"description":"Corporate group, if known"},"website":{"type":["string","null"],"description":"Supplier website"},"contractTypes":{"type":"string","description":"Contract types offered"},"origins":{"type":"string","description":"Electricity origins offered"},"inComparison":{"type":"boolean","description":"false = mirrors another supplier and is not listed separately"},"factsFetched":{"type":"string","description":"Date the facts were fetched (YYYY-MM-DD)"},"url":{"type":"string","description":"Supplier page"},"markdownUrl":{"type":"string","description":"Same URL; request it with Accept: text/markdown"}}},"SupplierList":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"},"description":"Suppliers"}}},"Page":{"type":"object","required":["path","title","url","markdownUrl"],"properties":{"path":{"type":"string","description":"Path"},"title":{"type":"string","description":"Title"},"url":{"type":"string","description":"Absolute URL"},"markdownUrl":{"type":"string","description":"Same URL; request it with Accept: text/markdown"}}},"PageList":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Page"},"description":"Pages"}}},"SearchHit":{"allOf":[{"$ref":"#/components/schemas/Page"},{"type":"object","required":["snippet","score"],"properties":{"snippet":{"type":"string","description":"Matching text"},"score":{"type":"number","description":"Relevance"}}}]},"SearchResult":{"type":"object","required":["query","items"],"properties":{"query":{"type":"string","description":"The query"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SearchHit"},"description":"Hits, best first"}}},"Problem":{"type":"object","description":"RFC 9457 problem details","required":["type","title","status","detail","code"],"properties":{"type":{"type":"string","description":"Problem type URI"},"title":{"type":"string","description":"Short summary"},"status":{"type":"integer","description":"HTTP status"},"detail":{"type":"string","description":"What went wrong"},"instance":{"type":["string","null"],"description":"Request path"},"code":{"type":"string","description":"Machine-readable code"},"resolution":{"type":"string","description":"How to fix it"},"docs":{"type":"string","description":"Documentation URL"}}}},"responses":{"Problem":{"description":"Error (RFC 9457)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"RateLimited":{"description":"Too many requests","headers":{"Retry-After":{"description":"Seconds to wait","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"x-problems":{"not_found":{"status":404,"title":"Not Found"},"method_not_allowed":{"status":405,"title":"Method Not Allowed"},"invalid_request":{"status":400,"title":"Bad Request"},"payload_too_large":{"status":413,"title":"Payload Too Large"},"rate_limited":{"status":429,"title":"Too Many Requests"},"unavailable":{"status":503,"title":"Service Unavailable"},"internal_error":{"status":500,"title":"Internal Server Error"}}}}