{"source":"stromavtaler","operation":"get_power_deals","description":"Electricity deals in one local grid, cheapest first. Signature: get_power_deals(municipality: string, required; yearly_kwh: integer, kilowatt-hours, optional, default 16000; deal_type: string, optional, default None; limit: integer, items, optional, default 20; offset: integer, items, optional, default 0).","signature":"get_power_deals(municipality: string, required; yearly_kwh: integer, kilowatt-hours, optional, default 16000; deal_type: string, optional, default None; limit: integer, items, optional, default 20; offset: integer, items, optional, default 0)","parameters":[{"name":"municipality","type":"string","schema":{"type":"string"},"required":true,"default":null,"description":"Municipality name or 4-digit number, as in find_local_grid.","unit":null},{"name":"yearly_kwh","type":"integer","schema":{"type":"integer"},"required":false,"default":16000,"description":"Assumed yearly consumption in kWh, 1000-100000 (default 16000). Changes the monthly price of every deal. Unit: kilowatt-hours.","unit":"kilowatt-hours"},{"name":"deal_type","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"Restrict to one deal type: hourly_spot, spot, fixed, variable, plus, purchase or other (also accepts spotpris and fastpris). Omit for all types.","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer"},"required":false,"default":20,"description":"Max deals to return, 1-100 (default 20). Unit: items.","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer"},"required":false,"default":0,"description":"Results to skip before the first one returned (default 0); with limit, pages through every match. Unit: items.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler/get_power_deals?municipality={municipality}&yearly_kwh=16000&deal_type={deal_type}&limit=20&offset=0","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"grid":{"type":"object","properties":{"grid_id":{"type":["integer","string","null"]},"name":{"type":["string","null"]},"municipality_number":{"type":["string","null"]},"price_area":{"type":["string","null"]},"vat_exempt":{"type":["boolean","null"]},"el_certificate_exempt":{"type":["boolean","null"]}},"additionalProperties":false,"required":["grid_id","name","municipality_number","price_area"]},"yearly_kwh":{"type":"integer"},"count":{"type":"integer"},"returned":{"type":"integer"},"deals":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":["integer","string","null"]},"name":{"type":["string","null"]},"type":{"type":["string","null"]},"supplier":{"type":["string","null"]},"supplier_org_nr":{"type":["string","null"]},"monthly_price_nok":{"type":["number","null"]},"price_ore_per_kwh":{"type":["number","null"]},"addon_ore_per_kwh":{"type":["number","null"]},"monthly_fee_nok":{"type":["number","null"]},"agreement_months":{"type":["integer","null"]},"order_url":{"type":["string","null"],"format":"uri"},"updated":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false,"required":["product_id"]}}},"additionalProperties":false,"required":["grid","yearly_kwh","count","returned","deals"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"projected","entity_types":["organization"],"description":"Recognized records and stable operation identifiers are projected; an empty array means the successful payload contained no recognizable entity."},"error_contract":{"scope":"top-level HTTP error response; never part of a success payload","schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object"}},"additionalProperties":false,"required":["code","message","retryable"]},"suggestion":{"type":"string"},"_meta":{"type":"object","properties":{"retrieved_at":{"type":"string","format":"date-time"},"language":{"type":"string","const":"en"},"content_languages":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object"}}},"required":["retrieved_at","language","content_languages","sources"]},"_links":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"api_index":{"type":"string","format":"uri"},"feedback":{"type":"string","format":"uri"}},"required":["self","api_index","feedback"],"additionalProperties":false}},"additionalProperties":false,"required":["error","suggestion","_meta","_links"]},"statuses":{"400":{"codes":["MISSING_PARAMETER","INVALID_PARAMETER","INVALID_REQUEST"],"retryable":false},"404":{"codes":["SOURCE_NOT_FOUND","OPERATION_NOT_FOUND","ENTITY_NOT_FOUND"],"retryable":false},"429":{"codes":["RATE_LIMITED","GATEWAY_RATE_LIMITED"],"retryable":true},"503":{"codes":["SOURCE_UNAVAILABLE"],"retryable":true},"500":{"codes":["INTERNAL_ERROR"],"retryable":true}}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler/get_power_deals/schema","operation":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler/get_power_deals","source":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["grid","grid.grid_id","grid.name","grid.municipality_number","grid.price_area","grid.vat_exempt","grid.el_certificate_exempt","yearly_kwh","count","returned","deals","deals[].product_id","deals[].name","deals[].type","deals[].supplier","deals[].supplier_org_nr","deals[].monthly_price_nok","deals[].price_ore_per_kwh","deals[].addon_ore_per_kwh","deals[].monthly_fee_nok","deals[].agreement_months","deals[].order_url","deals[].updated"],"output_fields_truncated":false,"canonical_field_aliases":{"name":["grid.name","deals[].name"]},"response_example":{"source":"stromavtaler","operation":"get_power_deals","parameters":{"municipality":"example value","yearly_kwh":16000,"deal_type":"example value","limit":20,"offset":0},"data":{"grid":{"grid_id":1,"name":"Example","municipality_number":"example value","price_area":"example value","vat_exempt":true,"el_certificate_exempt":true},"yearly_kwh":1,"count":1,"returned":1,"deals":[{"product_id":1,"name":"Example","type":"example value","supplier":"example value","supplier_org_nr":"example value","monthly_price_nok":1.0,"price_ore_per_kwh":1.0,"addon_ore_per_kwh":1.0,"monthly_fee_nok":1.0,"agreement_months":1,"order_url":"https://example.invalid/resource","updated":"2026-01-15T12:00:00Z"}]},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"stromavtaler","name":"Electricity deals","description":"Electricity deals per local grid with monthly price for a given yearly consumption, from the undocumented endpoint behind Forbrukerr\u00e5det's strompris.no.","cache_ttl_seconds":3600,"documentation":"https://www.strompris.no/"}]},"_provenance":{"data":{"source":"stromavtaler","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler"},"entities":{"source":"stromavtaler","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler/get_power_deals","source":"https://allemannsdata.com/wiki/api/v1/kilder/stromavtaler","wiki":"https://allemannsdata.com/wiki/kilder/stromavtaler/get_power_deals/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
