{"openapi":"3.0.0","paths":{"/v1/misc/ence":{"get":{"operationId":"getEnce","summary":"ENCE's next Counter-Strike match, streams, results and news","description":"\n      The running or next match of ENCE (the Finnish CS2 team) with up to 5 Finnish and\n      English streams, the following matches, the latest results and news.\n\n      Matches come from PandaScore and news from Google News. Both are fetched at most\n      once an hour, so a match that just started may not be marked live yet, and scores\n      of running matches are not included.\n    ","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnceDto"}}}},"503":{"description":"The match source is unavailable and nothing is cached"}},"tags":["ence"]}},"/v1/misc/ence/logos/{id}":{"get":{"operationId":"getLogo","summary":"A team logo","description":"Copy of a team logo, by the id in the `logo` paths of GET /v1/misc/ence.","parameters":[{"name":"id","required":true,"in":"path","schema":{"example":"3f2a9c0d1b7e4a55","type":"string"}}],"responses":{"200":{"description":"The image"},"404":{"description":"No such logo"}},"tags":["ence"]}},"/v1/electricity/prices":{"get":{"operationId":"getPrices","summary":"Prices from a time to a time","description":"\nDay-ahead spot prices for Finland in c/kWh including VAT, with the price now and when the\npublished prices end. By default from midnight today (Finnish time) to the last published price:\ntoday's prices, and tomorrow's from about 14:00 Finnish time.\n\nFor a Home Assistant REST sensor, `current.price` is the state and `prices` the attribute.\n    ","parameters":[{"name":"vat","required":false,"in":"query","description":"true (default): prices include 25.5 % VAT, as consumers pay. false: without VAT, for VAT-registered businesses. Categories are judged on the price with VAT either way.","schema":{"default":true,"type":"boolean"}},{"name":"area","required":false,"in":"query","description":"Bidding zone. Only FI (Finland) for now.","schema":{"default":"FI","enum":["FI"],"type":"string"}},{"name":"from","required":false,"in":"query","description":"Prices ending after this time. Defaults to midnight today, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","schema":{"example":"2026-10-12T00:00:00+03:00","type":"string"}},{"name":"to","required":false,"in":"query","description":"Prices starting before this time. Defaults to the end of the last published price. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","schema":{"example":"2026-10-13T00:00:00+03:00","type":"string"}},{"name":"resolution","required":false,"in":"query","description":"15min for the market prices as they are, hour for clock-hour averages.","schema":{"default":"15min","enum":["15min","hour"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricesDto"}}}},"400":{"description":"A query parameter is not valid"},"503":{"description":"Prices are unavailable: both ENTSO-E and the fallback provider (spot-hinta.fi) failed."}},"tags":["prices"]}},"/v1/electricity/prices/current":{"get":{"operationId":"getCurrentPrice","summary":"The price now","description":"This quarter hour's price and category, a few hundred bytes for frequent polling.","parameters":[{"name":"vat","required":false,"in":"query","description":"true (default): prices include 25.5 % VAT, as consumers pay. false: without VAT, for VAT-registered businesses. Categories are judged on the price with VAT either way.","schema":{"default":true,"type":"boolean"}},{"name":"area","required":false,"in":"query","description":"Bidding zone. Only FI (Finland) for now.","schema":{"default":"FI","enum":["FI"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceNowDto"}}}},"400":{"description":"A query parameter is not valid"},"503":{"description":"Prices are unavailable: both ENTSO-E and the fallback provider (spot-hinta.fi) failed."}},"tags":["prices"]}},"/v1/electricity/plans":{"get":{"operationId":"getPlans","summary":"When to run a load","description":"\nThe cheapest time to run a load before a deadline, and whether to run it now.\n\n- **Continuous** (default): the load runs without a break once started, like a washing machine or a sauna.\n  Give `durationHours` (and `energyKwh` for costs). Returns up to `limit` runs that do not overlap, cheapest first.\n- **Pausable** (`pausable=true`): the load may stop and start, like an EV charger, water heater or battery.\n  Give `durationHours` (time on), or `energyKwh` with `maxPowerKw`. Returns the single cheapest plan,\n  in blocks of at least `minBlockHours`.\n\n`activeNow` and `nextChangeAt` tell a device whether to be on and when to switch next. A plan searched from a\nfixed `earliestStart` (for example `today`) stays the same between requests, so a device following\n`activeNow` runs exactly the planned time.\n\nExample: charge 50 kWh at 11 kW before 08:00 tomorrow, at least an hour at a time:\n`/v1/electricity/plans?pausable=true&energyKwh=50&maxPowerKw=11&minBlockHours=1&latestEnd=2026-10-13T08:00:00%2B03:00`\n    ","parameters":[{"name":"vat","required":false,"in":"query","description":"true (default): prices include 25.5 % VAT, as consumers pay. false: without VAT, for VAT-registered businesses. Categories are judged on the price with VAT either way.","schema":{"default":true,"type":"boolean"}},{"name":"area","required":false,"in":"query","description":"Bidding zone. Only FI (Finland) for now.","schema":{"default":"FI","enum":["FI"],"type":"string"}},{"name":"durationHours","required":false,"in":"query","description":"How long the load runs, in hours in steps of 0.25 (15 minutes). For a pausable load, the total time on. Give this, or energyKwh with maxPowerKw.","multipleOf":0.25,"schema":{"minimum":0.25,"maximum":24,"example":2,"type":"number"}},{"name":"energyKwh","required":false,"in":"query","description":"Energy the load uses in kWh. With durationHours it is spread evenly over the run, and gives each plan its cost. With maxPowerKw (and no durationHours) the load runs at full power until the energy is in.","schema":{"minimum":0.01,"maximum":1000,"example":1.5,"type":"number"}},{"name":"maxPowerKw","required":false,"in":"query","description":"Highest power the load draws in kW, for example a charger’s 11 kW. Used with energyKwh instead of durationHours.","schema":{"minimum":0.1,"maximum":1000,"example":11,"type":"number"}},{"name":"pausable","required":false,"in":"query","description":"false (default): the load runs without a break once started, like a washing machine, and plans are ranked alternatives. true: it may pause, like an EV charger or water heater, and the answer is the single cheapest plan of one or more blocks.","schema":{"default":false,"type":"boolean"}},{"name":"minBlockHours","required":false,"in":"query","description":"Pausable loads only: the shortest time the load runs once switched on, in hours in steps of 0.25, up to 12. Defaults to 0.25.","multipleOf":0.25,"schema":{"minimum":0.25,"maximum":12,"default":0.25,"example":1,"type":"number"}},{"name":"earliestStart","required":false,"in":"query","description":"Earliest start. Defaults to the current quarter hour. May be in the past, back to midnight today (Finnish time): a plan searched from a fixed start stays the same as time passes, so a device can follow it. \"today\" and \"tomorrow\" mean midnight at the start of that day, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","schema":{"example":"today","type":"string"}},{"name":"latestEnd","required":false,"in":"query","description":"Latest end, for example when the car leaves. Defaults to the end of the last published price, and later times are searched only that far (see meta.pricesUntil). \"tomorrow\" is midnight tonight, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","schema":{"example":"2026-10-13T08:00:00+03:00","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Continuous loads only: how many plans to return, cheapest first and not overlapping, from 1 to 10.","schema":{"minimum":1,"maximum":10,"default":3,"type":"number"}},{"name":"resolution","required":false,"in":"query","description":"15min (default) plans on the market prices as they are. hour plans on clock-hour averages, for contracts priced by the hour: runs then start on full hours, and durationHours and minBlockHours must be whole hours.","schema":{"default":"15min","enum":["15min","hour"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlansDto"}}}},"400":{"description":"A parameter is not valid, or the parameters do not fit together","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}},"503":{"description":"Prices are unavailable: both ENTSO-E and the fallback provider (spot-hinta.fi) failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}}},"tags":["plans"]}},"/v1/electricity/plans/search":{"post":{"operationId":"searchPlans","summary":"When to run a load, with inputs too long for a URL","description":"\nThe same as GET /v1/electricity/plans with the fields in a JSON body, plus `profileKwh` for a load whose power changes and\n`startTimes` to compare given starts. Responses to POST are not cached by the CDN; prefer GET when it is enough.\n    ","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanSearchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlansDto"}}}},"400":{"description":"A parameter is not valid, or the parameters do not fit together","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}},"503":{"description":"Prices are unavailable: both ENTSO-E and the fallback provider (spot-hinta.fi) failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}}},"tags":["plans"]}},"/v1/electricity/plans/presets":{"get":{"operationId":"listPlanPresets","summary":"The ready-made loads","description":"Each preset is a set of GET /v1/electricity/plans parameters.","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlanPresetDto"}}}}}},"tags":["plans"]}},"/v1/electricity/plans/presets/{name}":{"get":{"operationId":"getPresetPlans","summary":"When to run a ready-made load","description":"GET /v1/electricity/plans with the preset's parameters. Any GET /v1/electricity/plans parameter overrides the preset's, for example `/v1/electricity/plans/presets/ev-charging?energyKwh=30&latestEnd=tomorrow`.","parameters":[{"name":"name","required":true,"in":"path","schema":{"enum":["laundry","sauna","ev-charging"],"type":"string"}},{"name":"vat","required":false,"in":"query","description":"true (default): prices include 25.5 % VAT, as consumers pay. false: without VAT, for VAT-registered businesses. Categories are judged on the price with VAT either way.","schema":{"default":true,"type":"boolean"}},{"name":"area","required":false,"in":"query","description":"Bidding zone. Only FI (Finland) for now.","schema":{"default":"FI","enum":["FI"],"type":"string"}},{"name":"durationHours","required":false,"in":"query","description":"How long the load runs, in hours in steps of 0.25 (15 minutes). For a pausable load, the total time on. Give this, or energyKwh with maxPowerKw.","multipleOf":0.25,"schema":{"minimum":0.25,"maximum":24,"example":2,"type":"number"}},{"name":"energyKwh","required":false,"in":"query","description":"Energy the load uses in kWh. With durationHours it is spread evenly over the run, and gives each plan its cost. With maxPowerKw (and no durationHours) the load runs at full power until the energy is in.","schema":{"minimum":0.01,"maximum":1000,"example":1.5,"type":"number"}},{"name":"maxPowerKw","required":false,"in":"query","description":"Highest power the load draws in kW, for example a charger’s 11 kW. Used with energyKwh instead of durationHours.","schema":{"minimum":0.1,"maximum":1000,"example":11,"type":"number"}},{"name":"pausable","required":false,"in":"query","description":"false (default): the load runs without a break once started, like a washing machine, and plans are ranked alternatives. true: it may pause, like an EV charger or water heater, and the answer is the single cheapest plan of one or more blocks.","schema":{"default":false,"type":"boolean"}},{"name":"minBlockHours","required":false,"in":"query","description":"Pausable loads only: the shortest time the load runs once switched on, in hours in steps of 0.25, up to 12. Defaults to 0.25.","multipleOf":0.25,"schema":{"minimum":0.25,"maximum":12,"default":0.25,"example":1,"type":"number"}},{"name":"earliestStart","required":false,"in":"query","description":"Earliest start. Defaults to the current quarter hour. May be in the past, back to midnight today (Finnish time): a plan searched from a fixed start stays the same as time passes, so a device can follow it. \"today\" and \"tomorrow\" mean midnight at the start of that day, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","schema":{"example":"today","type":"string"}},{"name":"latestEnd","required":false,"in":"query","description":"Latest end, for example when the car leaves. Defaults to the end of the last published price, and later times are searched only that far (see meta.pricesUntil). \"tomorrow\" is midnight tonight, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","schema":{"example":"2026-10-13T08:00:00+03:00","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Continuous loads only: how many plans to return, cheapest first and not overlapping, from 1 to 10.","schema":{"minimum":1,"maximum":10,"default":3,"type":"number"}},{"name":"resolution","required":false,"in":"query","description":"15min (default) plans on the market prices as they are. hour plans on clock-hour averages, for contracts priced by the hour: runs then start on full hours, and durationHours and minBlockHours must be whole hours.","schema":{"default":"15min","enum":["15min","hour"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlansDto"}}}},"400":{"description":"A parameter is not valid, or the parameters do not fit together","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}},"404":{"description":"No such preset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}},"503":{"description":"Prices are unavailable: both ENTSO-E and the fallback provider (spot-hinta.fi) failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}}},"tags":["plans"]}},"/v1/electricity/health":{"get":{"operationId":"getHealth","summary":"Whether the prices are fresh","description":"For monitoring, and for clients that want to ask for tomorrow's prices only once they can exist. Answers 503 when there is no current price.","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthDto"}}}},"503":{"description":"Prices are unavailable: both ENTSO-E and the fallback provider (spot-hinta.fi) failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDto"}}}}},"tags":["health"]}}},"info":{"title":"Milloin API","description":"\nThe data that powers [milloin.xyz](https://milloin.xyz), by category: Finnish electricity spot prices and\nthe cheapest times to run a load, and other things that happen.\n\nElectricity, `/v1/electricity`:\n- `GET /v1/electricity/prices`: prices from a time to a time, with the price now. `/v1/electricity/prices/current`\n  for just the price now.\n- `GET /v1/electricity/plans`: when to run a load, continuous (a washing machine) or pausable (an EV charger),\n  with `activeNow` for switching a device. Ready-made loads at `/v1/electricity/plans/presets`.\n- `GET /v1/electricity/health`: whether the prices are fresh and when tomorrow's arrive.\n\nMiscellaneous, `/v1/misc`:\n- `GET /v1/misc/ence`: the next Counter-Strike match of ENCE, the Finnish CS2 team, with streams, results and news.\n\nPrices come from the day-ahead market (ENTSO-E Transparency Platform, spot-hinta.fi as fallback) in\n15-minute resolution, in c/kWh including 25.5 % VAT. Money is in cents, energy in kWh, power in kW. Times\nare UTC (ISO 8601); requests may also give a UTC offset. Errors are `application/problem+json`.\nThe OpenAPI document is at [milloin.xyz/api/openapi.json](https://milloin.xyz/api/openapi.json).\nGuides, Home Assistant examples included, are at [milloin.xyz/docs](https://milloin.xyz/docs).\n\n**Free to use.** No API key or sign-up is needed. GET responses carry `Cache-Control` up to the next\nquarter hour, when the current price changes, and repeated requests are answered from the CDN. Requests\nthat reach the server count against a limit of 60 per minute for each IP address; over\nthat the API answers 429 Too Many Requests with `Retry-After`. Day-ahead prices are published once a\nday, around 14:00 Finnish time, so polling every few minutes is plenty. A link back to\n[milloin.xyz](https://milloin.xyz) is appreciated.\n\n**Business use.** For higher volumes, guaranteed availability or custom endpoints,\ncontact [jarkko.peltola@hurlumhei.xyz](mailto:jarkko.peltola@hurlumhei.xyz).\n","version":"1.0","contact":{"name":"Milloin","url":"https://milloin.xyz","email":"jarkko.peltola@hurlumhei.xyz"}},"tags":[{"name":"prices","description":"Electricity spot prices: the price now and from a time to a time"},{"name":"plans","description":"When to run an electric load: continuous or pausable, presets or your own parameters"},{"name":"health","description":"Whether the electricity prices are fresh"},{"name":"ence","description":"ENCE's next Counter-Strike match, streams, results and news"}],"servers":[{"url":"https://milloin.xyz/api","description":"Production"}],"components":{"schemas":{"EnceTeamDto":{"type":"object","properties":{"name":{"type":"string","example":"ENCE"},"logo":{"type":"string","description":"Path of the team's logo, relative to the API root (e.g. https://milloin.xyz/api/). Missing when the source has no logo.","example":"v1/misc/ence/logos/3f2a9c0d1b7e4a55"}},"required":["name"]},"EnceStreamDto":{"type":"object","properties":{"name":{"type":"string","description":"Channel name","example":"cct_cs"},"platform":{"type":"string","example":"Twitch"},"language":{"type":"string","description":"Language of the broadcast: fi or en","example":"en"},"url":{"type":"string","example":"https://www.twitch.tv/cct_cs"},"official":{"type":"boolean","description":"The tournament's own broadcast"},"viewers":{"type":"number","description":"Viewers when the data was fetched, when the source tells","example":18400}},"required":["name","platform","language","url","official"]},"EnceNextMatchDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start time (UTC)","example":"2026-10-10T15:30:00.000Z"},"live":{"type":"boolean","description":"The source reported the match as running when fetched"},"opponent":{"$ref":"#/components/schemas/EnceTeamDto"},"event":{"type":"string","example":"CCT Europe Series 9 2026"},"format":{"type":"string","example":"Bo3"},"streams":{"description":"Up to 5 Finnish and English streams: most viewers first when known, otherwise official ones first, then Finnish","type":"array","items":{"$ref":"#/components/schemas/EnceStreamDto"}}},"required":["startTime","live","opponent","event","streams"]},"EnceMatchDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start time (UTC)","example":"2026-10-10T15:30:00.000Z"},"live":{"type":"boolean","description":"The source reported the match as running when fetched"},"opponent":{"$ref":"#/components/schemas/EnceTeamDto"},"event":{"type":"string","example":"CCT Europe Series 9 2026"},"format":{"type":"string","example":"Bo3"}},"required":["startTime","live","opponent","event"]},"EnceResultDto":{"type":"object","properties":{"startTime":{"type":"string","example":"2026-10-07T16:00:00.000Z"},"opponent":{"$ref":"#/components/schemas/EnceTeamDto"},"event":{"type":"string","example":"CCT Europe Series 9 2026"},"teamScore":{"type":"number","description":"ENCE's maps won","example":2},"opponentScore":{"type":"number","description":"The opponent's maps won","example":1}},"required":["startTime","opponent","event","teamScore","opponentScore"]},"EnceNewsDto":{"type":"object","properties":{"title":{"type":"string","example":"ENCE qualify for the playoffs"},"source":{"type":"string","example":"Dust2.us"},"url":{"type":"string"},"publishedAt":{"type":"string","example":"2026-10-08T09:12:00.000Z"}},"required":["title","url","publishedAt"]},"EnceDto":{"type":"object","properties":{"updatedAt":{"type":"string","description":"When the matches were fetched (UTC); refreshed hourly","example":"2026-10-09T10:12:00.000Z"},"source":{"type":"string","description":"Source of the matches","example":"PandaScore"},"team":{"$ref":"#/components/schemas/EnceTeamDto"},"nextMatch":{"description":"The running or next match; missing when none is scheduled","allOf":[{"$ref":"#/components/schemas/EnceNextMatchDto"}]},"upcoming":{"description":"Up to 3 matches after the next one","type":"array","items":{"$ref":"#/components/schemas/EnceMatchDto"}},"results":{"description":"Up to 3 latest results, latest first","type":"array","items":{"$ref":"#/components/schemas/EnceResultDto"}},"news":{"description":"Up to 3 latest news items about ENCE, latest first","type":"array","items":{"$ref":"#/components/schemas/EnceNewsDto"}}},"required":["updatedAt","source","team","upcoming","results","news"]},"PriceDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start (ISO 8601, UTC)","example":"2026-10-12T07:00:00.000Z"},"endTime":{"type":"string","description":"End (ISO 8601, UTC)","example":"2026-10-12T07:15:00.000Z"},"price":{"type":"number","description":"Price in c/kWh including 25.5 % VAT (without it with vat=false), no transfer or margin; with resolution=hour the hour's average","example":5.23},"category":{"type":"string","description":"VERY_CHEAP under 2.5, CHEAP under 5, NORMAL under 10, EXPENSIVE under 20, VERY_EXPENSIVE from 20 c/kWh, judged on the price with VAT","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"NORMAL"},"dayCategory":{"type":"string","description":"The price among its own Finnish day's prices: the cheapest fifth of the day is VERY_CHEAP, the dearest fifth VERY_EXPENSIVE. Always marks some hours cheap, for automations that run in the day's cheapest hours.","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"CHEAP"}},"required":["startTime","endTime","price","category","dayCategory"]},"PricesMetaDto":{"type":"object","properties":{"unit":{"type":"string","description":"Unit of every price","example":"c/kWh"},"vatIncluded":{"type":"boolean","description":"Whether prices include VAT (vat=false leaves it out)","example":true},"vatPercent":{"type":"number","description":"VAT included, in percent: 0 with vat=false","example":25.5},"area":{"type":"string","description":"Bidding zone","example":"FI"},"resolution":{"type":"string","description":"Length of each price","enum":["15min","hour"],"example":"15min"},"pricesUntil":{"type":"string","description":"End of the last published price (ISO 8601, UTC)","example":"2026-10-13T21:00:00.000Z"},"tomorrowPublished":{"type":"boolean","description":"Whether tomorrow's prices (Finnish day) are published. They usually are from about 14:00 Finnish time.","example":true},"nextPricesExpectedAt":{"type":"string","description":"When the next day's prices are expected, at about 14:00 Finnish time (ISO 8601, UTC): today until tomorrow's are in, then tomorrow. In the past while they are late.","example":"2026-10-13T11:00:00.000Z"},"source":{"type":"string","description":"Where the prices came from: ENTSO-E, or spot-hinta.fi as the fallback","example":"ENTSO-E"},"fetchedAt":{"type":"string","description":"When the prices were fetched from the source (ISO 8601, UTC)","example":"2026-10-12T11:02:13.000Z"}},"required":["unit","vatIncluded","vatPercent","area","resolution","pricesUntil","tomorrowPublished","nextPricesExpectedAt"]},"PricesDto":{"type":"object","properties":{"current":{"description":"The price now: this quarter, or this hour with resolution=hour","allOf":[{"$ref":"#/components/schemas/PriceDto"}]},"prices":{"description":"Prices from `from` to `to`, in time order","type":"array","items":{"$ref":"#/components/schemas/PriceDto"}},"meta":{"$ref":"#/components/schemas/PricesMetaDto"}},"required":["current","prices","meta"]},"PriceNowDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start (ISO 8601, UTC)","example":"2026-10-12T07:00:00.000Z"},"endTime":{"type":"string","description":"End (ISO 8601, UTC)","example":"2026-10-12T07:15:00.000Z"},"price":{"type":"number","description":"Price in c/kWh including 25.5 % VAT (without it with vat=false), no transfer or margin; with resolution=hour the hour's average","example":5.23},"category":{"type":"string","description":"VERY_CHEAP under 2.5, CHEAP under 5, NORMAL under 10, EXPENSIVE under 20, VERY_EXPENSIVE from 20 c/kWh, judged on the price with VAT","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"NORMAL"},"dayCategory":{"type":"string","description":"The price among its own Finnish day's prices: the cheapest fifth of the day is VERY_CHEAP, the dearest fifth VERY_EXPENSIVE. Always marks some hours cheap, for automations that run in the day's cheapest hours.","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"CHEAP"},"meta":{"$ref":"#/components/schemas/PricesMetaDto"}},"required":["startTime","endTime","price","category","dayCategory","meta"]},"ResolvedPlanRequestDto":{"type":"object","properties":{"pausable":{"type":"boolean","example":false},"durationHours":{"type":"number","description":"Time on in hours","example":2},"energyKwh":{"type":"number","example":1.5},"maxPowerKw":{"type":"number","example":11},"minBlockHours":{"type":"number","description":"Pausable loads only","example":0.25},"earliestStart":{"type":"string","description":"Start of the search (ISO 8601, UTC)","example":"2026-10-12T07:45:00.000Z"},"latestEnd":{"type":"string","description":"End of the search (ISO 8601, UTC): the requested latestEnd or meta.pricesUntil, whichever is earlier","example":"2026-10-13T21:00:00.000Z"},"limit":{"type":"number","example":3},"resolution":{"type":"string","enum":["15min","hour"],"example":"15min"},"preset":{"type":"string","description":"The preset used, if any","example":"laundry"}},"required":["pausable","durationHours","earliestStart","latestEnd","limit","resolution"]},"PlansMetaDto":{"type":"object","properties":{"priceUnit":{"type":"string","description":"Unit of priceAvg","example":"c/kWh"},"currency":{"type":"string","description":"Currency of the *Cents fields","example":"EUR"},"vatIncluded":{"type":"boolean","example":true},"vatPercent":{"type":"number","description":"VAT included, in percent: 0 with vat=false","example":25.5},"area":{"type":"string","example":"FI"},"pricesUntil":{"type":"string","description":"End of the last published price (ISO 8601, UTC). Tomorrow's prices come at about 14:00 Finnish time, after which a later latestEnd may give a cheaper plan.","example":"2026-10-13T21:00:00.000Z"},"tomorrowPublished":{"type":"boolean","description":"Whether tomorrow's prices (Finnish day) are published","example":true},"nextPricesExpectedAt":{"type":"string","description":"When the next day's prices are expected (ISO 8601, UTC), at about 14:00 Finnish time. Ask again after it for a plan that can use them.","example":"2026-10-13T11:00:00.000Z"}},"required":["priceUnit","currency","vatIncluded","vatPercent","area","pricesUntil","tomorrowPublished","nextPricesExpectedAt"]},"PlanCostDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start (ISO 8601, UTC)","example":"2026-10-13T00:00:00.000Z"},"endTime":{"type":"string","description":"End of the last block (ISO 8601, UTC)","example":"2026-10-13T02:00:00.000Z"},"priceAvg":{"type":"number","description":"Average price of the energy in c/kWh; with no energy given, the average of the prices","example":2.15},"category":{"type":"string","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"VERY_CHEAP"},"costCents":{"type":"number","description":"Cost of the energy in cents (VAT included, no transfer or margin). Only when energy is known.","example":47.3}},"required":["startTime","endTime","priceAvg","category"]},"PlanBlockDto":{"type":"object","properties":{"startTime":{"type":"string","description":"When to switch on (ISO 8601, UTC)","example":"2026-10-13T00:00:00.000Z"},"endTime":{"type":"string","description":"When to switch off (ISO 8601, UTC). At full power the energy may be in up to 15 minutes earlier.","example":"2026-10-13T02:00:00.000Z"},"energyKwh":{"type":"number","description":"Energy drawn in the block (kWh). Only when energy is known.","example":22}},"required":["startTime","endTime"]},"PlanDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start (ISO 8601, UTC)","example":"2026-10-13T00:00:00.000Z"},"endTime":{"type":"string","description":"End of the last block (ISO 8601, UTC)","example":"2026-10-13T02:00:00.000Z"},"priceAvg":{"type":"number","description":"Average price of the energy in c/kWh; with no energy given, the average of the prices","example":2.15},"category":{"type":"string","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"VERY_CHEAP"},"costCents":{"type":"number","description":"Cost of the energy in cents (VAT included, no transfer or margin). Only when energy is known.","example":47.3},"savingsCents":{"type":"number","description":"Cents saved compared with startNow; negative when this plan costs more. Only when energy is known and startNow is given.","example":120.4},"activeNow":{"type":"boolean","description":"Whether one of the blocks is running now","example":false},"nextChangeAt":{"type":"string","description":"When to switch next (ISO 8601, UTC): the end of the running block, or the start of the next one. Left out once the plan is over.","example":"2026-10-13T00:00:00.000Z"},"blocks":{"description":"When to run, in time order: one block for a continuous load, one or more for a pausable one","type":"array","items":{"$ref":"#/components/schemas/PlanBlockDto"}}},"required":["startTime","endTime","priceAvg","category","activeNow","blocks"]},"StartTimePlanDto":{"type":"object","properties":{"startTime":{"type":"string","description":"Start (ISO 8601, UTC)","example":"2026-10-13T00:00:00.000Z"},"endTime":{"type":"string","description":"End of the last block (ISO 8601, UTC)","example":"2026-10-13T02:00:00.000Z"},"priceAvg":{"type":"number","description":"Average price of the energy in c/kWh; with no energy given, the average of the prices","example":2.15},"category":{"type":"string","enum":["VERY_CHEAP","CHEAP","NORMAL","EXPENSIVE","VERY_EXPENSIVE"],"example":"VERY_CHEAP"},"costCents":{"type":"number","description":"Cost of the energy in cents (VAT included, no transfer or margin). Only when energy is known.","example":47.3},"requestedStart":{"type":"string","description":"The start time as requested","example":"2026-10-12T16:00:00Z"}},"required":["startTime","endTime","priceAvg","category","requestedStart"]},"PlansDto":{"type":"object","properties":{"request":{"description":"The request with defaults filled in","allOf":[{"$ref":"#/components/schemas/ResolvedPlanRequestDto"}]},"meta":{"$ref":"#/components/schemas/PlansMetaDto"},"activeNow":{"type":"boolean","description":"Whether the cheapest plan is running now: the same as plans[0].activeNow, false without plans","example":false},"nextChangeAt":{"type":"string","description":"The cheapest plan's next switch (plans[0].nextChangeAt)","example":"2026-10-13T00:00:00.000Z"},"startNow":{"description":"Running continuously from the start of the search, or from now if that is later, for comparison. Left out when the prices do not reach far enough.","allOf":[{"$ref":"#/components/schemas/PlanCostDto"}]},"plans":{"description":"Cheapest first. Continuous loads: up to limit runs that do not overlap. Pausable loads: the single cheapest plan. Empty when nothing fits between earliestStart and latestEnd.","type":"array","items":{"$ref":"#/components/schemas/PlanDto"}},"startTimes":{"description":"POST /v1/electricity/plans/search only: the run from each requested start time, in the order given. Starts whose run passes the published prices are left out.","type":"array","items":{"$ref":"#/components/schemas/StartTimePlanDto"}}},"required":["request","meta","activeNow","plans"]},"ProblemFieldDto":{"type":"object","properties":{"field":{"type":"string","description":"The parameter or field","example":"latestEnd"},"message":{"type":"string","description":"What is wrong with it","example":"latestEnd must be a valid ISO 8601 date string"}},"required":["field","message"]},"ProblemDto":{"type":"object","properties":{"type":{"type":"string","example":"about:blank"},"title":{"type":"string","description":"The HTTP status text","example":"Bad Request"},"status":{"type":"number","example":400},"detail":{"type":"string","description":"What went wrong, for people","example":"latestEnd must be a valid ISO 8601 date string"},"errors":{"description":"Each invalid parameter, on 400 responses to a request that failed validation","type":"array","items":{"$ref":"#/components/schemas/ProblemFieldDto"}}},"required":["type","title","status"]},"PlanSearchDto":{"type":"object","properties":{"vat":{"type":"boolean","description":"true (default): prices include 25.5 % VAT, as consumers pay. false: without VAT, for VAT-registered businesses. Categories are judged on the price with VAT either way.","default":true},"area":{"type":"string","description":"Bidding zone. Only FI (Finland) for now.","enum":["FI"],"default":"FI"},"durationHours":{"type":"number","description":"How long the load runs, in hours in steps of 0.25 (15 minutes). For a pausable load, the total time on. Give this, or energyKwh with maxPowerKw.","example":2,"minimum":0.25,"maximum":24,"multipleOf":0.25},"energyKwh":{"type":"number","description":"Energy the load uses in kWh. With durationHours it is spread evenly over the run, and gives each plan its cost. With maxPowerKw (and no durationHours) the load runs at full power until the energy is in.","example":1.5,"minimum":0.01,"maximum":1000},"maxPowerKw":{"type":"number","description":"Highest power the load draws in kW, for example a charger’s 11 kW. Used with energyKwh instead of durationHours.","example":11,"minimum":0.1,"maximum":1000},"pausable":{"type":"boolean","description":"false (default): the load runs without a break once started, like a washing machine, and plans are ranked alternatives. true: it may pause, like an EV charger or water heater, and the answer is the single cheapest plan of one or more blocks.","default":false},"minBlockHours":{"type":"number","description":"Pausable loads only: the shortest time the load runs once switched on, in hours in steps of 0.25, up to 12. Defaults to 0.25.","example":1,"default":0.25,"minimum":0.25,"maximum":12,"multipleOf":0.25},"earliestStart":{"type":"string","description":"Earliest start. Defaults to the current quarter hour. May be in the past, back to midnight today (Finnish time): a plan searched from a fixed start stays the same as time passes, so a device can follow it. \"today\" and \"tomorrow\" mean midnight at the start of that day, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","example":"today"},"latestEnd":{"type":"string","description":"Latest end, for example when the car leaves. Defaults to the end of the last published price, and later times are searched only that far (see meta.pricesUntil). \"tomorrow\" is midnight tonight, Finnish time. ISO 8601 with Z or a UTC offset, for example 2026-10-13T08:00:00+03:00 (write + as %2B in a URL; a plain + is also understood). Responses are always in UTC (Z).","example":"2026-10-13T08:00:00+03:00"},"limit":{"type":"number","description":"Continuous loads only: how many plans to return, cheapest first and not overlapping, from 1 to 10.","default":3,"minimum":1,"maximum":10},"resolution":{"type":"string","description":"15min (default) plans on the market prices as they are. hour plans on clock-hour averages, for contracts priced by the hour: runs then start on full hours, and durationHours and minBlockHours must be whole hours.","enum":["15min","hour"],"default":"15min"},"profileKwh":{"description":"Energy in kWh for each 15-minute slot of the run (each hour with resolution=hour), for a load whose power changes, for example a sauna heater drawing more in its first hour. Replaces durationHours, energyKwh and maxPowerKw. At most 96 slots; continuous loads only.","example":[1,1,1,1,0.5,0.5,0.5,0.5],"type":"array","items":{"type":"number"}},"startTimes":{"description":"Start times to compare, for example the delays a washing machine's timer offers. Each is rounded down to its quarter hour and answered in startTimes, also outside earliestStart and latestEnd. At most 100; continuous loads only.","example":["2026-10-12T16:00:00Z","2026-10-12T17:00:00Z"],"type":"array","items":{"type":"string"}}}},"PlanPresetDto":{"type":"object","properties":{"name":{"type":"string","example":"ev-charging"},"description":{"type":"string","example":"Charging an electric vehicle at 11 kW"},"pausable":{"type":"boolean","example":true},"durationHours":{"type":"number","example":4},"energyKwh":{"type":"number","example":44},"maxPowerKw":{"type":"number","example":11},"minBlockHours":{"type":"number","example":1}},"required":["name","description","pausable","energyKwh"]},"HealthDto":{"type":"object","properties":{"status":{"type":"string","description":"ok: the current price is in memory and tomorrow's prices are not late. late: tomorrow's prices are over an hour later than expected; today's still work.","enum":["ok","late"],"example":"ok"},"pricesUntil":{"type":"string","example":"2026-10-13T21:00:00.000Z"},"tomorrowPublished":{"type":"boolean","example":true},"nextPricesExpectedAt":{"type":"string","example":"2026-10-13T11:00:00.000Z"},"source":{"type":"string","example":"ENTSO-E"},"fetchedAt":{"type":"string","example":"2026-10-12T11:02:13.000Z"}},"required":["status","pricesUntil","tomorrowPublished","nextPricesExpectedAt"]}}}}