Data source: hvakosterstrommen.no
Overview
Hvakosterstrommen (Electricity Prices) wraps hvakosterstrommen.no, handling authentication, pagination, and rate limits for you. This tutorial covers all 7 tools with working code examples you can copy and run.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-hvakosterstrommen": {
"url": "https://context.gnist.ai/mcp/hvakosterstrommen/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (7)
get_current_electricity_price
Get the current hour's spot electricity price for a Nordpool price zone. Args: zone: Nordpool price zone (e.g. 'NO1' for Oslo/East Norway). Valid zones: NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4, DK1, DK2, FI. Returns: Dictionary with time_start, time_end, nok_per_kwh, eur_per_kwh, and exchange_rate.
| Parameter | Type | Required | Description |
|---|---|---|---|
zone | string | required | Nordpool price zone (e.g. 'NO1' for Oslo/East Norway). Valid zones: NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4, DK1, DK2, FI. |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_current_electricity_price", "arguments": {"zone": "'NO1'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'zone': "'NO1'"},
'name': 'get_current_electricity_price'}},
)
print(resp.json())
get_electricity_prices_today
Get all 24 hourly electricity spot prices for today in a Nordpool price zone. Includes summary statistics: cheapest hour, most expensive hour, min/max/avg prices. Args: zone: Nordpool price zone (e.g. 'NO1' for Oslo/East Norway). Valid zones: NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4, DK1, DK2, FI. Returns: Dictionary with date, count, cheapest_hour, most_expensive_hour, min/max/avg prices, and hourly prices list.
| Parameter | Type | Required | Description |
|---|---|---|---|
zone | string | required | Nordpool price zone (e.g. 'NO1' for Oslo/East Norway). Valid zones: NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4, DK1, DK2, FI. |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_electricity_prices_today", "arguments": {"zone": "'NO1'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'zone': "'NO1'"},
'name': 'get_electricity_prices_today'}},
)
print(resp.json())
get_electricity_prices_tomorrow
Get day-ahead electricity spot prices for tomorrow in a Nordpool price zone. Day-ahead prices are published around 13:00 CET. Returns an error if not yet available. Args: zone: Nordpool price zone (e.g. 'NO1' for Oslo/East Norway). Valid zones: NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4, DK1, DK2, FI. Returns: Dictionary with date, count, cheapest_hour, most_expensive_hour, min/max/avg prices, and hourly prices list.
| Parameter | Type | Required | Description |
|---|---|---|---|
zone | string | required | Nordpool price zone (e.g. 'NO1' for Oslo/East Norway). Valid zones: NO1, NO2, NO3, NO4, NO5, SE1, SE2, SE3, SE4, DK1, DK2, FI. |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_electricity_prices_tomorrow", "arguments": {"zone": "'NO1'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'zone': "'NO1'"},
'name': 'get_electricity_prices_tomorrow'}},
)
print(resp.json())
get_cheapest_electricity_window
Find the cheapest consecutive block of hours for electricity across today and tomorrow. Ideal for scheduling EV charging, appliances, or heat pumps to minimize cost. Tomorrow's prices are included if available (published ~13:00 CET). Args: zone: Nordpool price zone (e.g. 'NO1'). Valid zones: NO1–NO5, SE1–SE4, DK1–DK2, FI. duration_hours: Number of consecutive hours needed (1–24). not_before: ISO 8601 datetime — only consider hours at or after this time (e.g. '2026-03-13T22:00:00+01:00'). not_after: ISO 8601 datetime — only consider hours ending at or before this time (e.g. '2026-03-14T07:00:00+01:00'). Returns: Dictionary with window_start, window_end, avg_nok_per_kwh, total_nok_per_kwh, and individual hour prices.
| Parameter | Type | Required | Description |
|---|---|---|---|
zone | string | required | Nordpool price zone (e.g. 'NO1'). Valid zones: NO1–NO5, SE1–SE4, DK1–DK2, FI. |
duration_hours | integer | required | Number of consecutive hours needed (1–24). |
not_before | any | optional | ISO 8601 datetime — only consider hours at or after this time (e.g. '2026-03-13T22:00:00+01:00'). |
not_after | any | optional | ISO 8601 datetime — only consider hours ending at or before this time (e.g. '2026-03-14T07:00:00+01:00'). |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_cheapest_electricity_window", "arguments": {"zone": "'NO1'", "duration_hours": 5}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'duration_hours': 5, 'zone': "'NO1'"},
'name': 'get_cheapest_electricity_window'}},
)
print(resp.json())
get_electricity_price_history
Get historical hourly electricity spot prices for the past N days. Args: zone: Nordpool price zone (e.g. 'NO1'). Valid zones: NO1–NO5, SE1–SE4, DK1–DK2, FI. days: Number of past days to include (1–30, default 7). Returns: Dictionary with zone, days, count, and a flat list of all hourly prices in chronological order.
| Parameter | Type | Required | Description |
|---|---|---|---|
zone | string | required | Nordpool price zone (e.g. 'NO1'). Valid zones: NO1–NO5, SE1–SE4, DK1–DK2, FI. |
days | integer | optional | Number of past days to include (1–30, default 7). (default: 7) |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_electricity_price_history", "arguments": {"zone": "'NO1'"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'zone': "'NO1'"},
'name': 'get_electricity_price_history'}},
)
print(resp.json())
get_electricity_zone_for_location
Resolve geographic coordinates to the nearest Nordpool electricity price zone. Uses straight-line distance to approximate zone centers. Works for Norway, Sweden, Denmark, and Finland. Args: lat: Latitude (decimal degrees). lon: Longitude (decimal degrees). Returns: Dictionary with zone (e.g. 'NO1') and distance_km to the zone center.
| Parameter | Type | Required | Description |
|---|---|---|---|
lat | number | required | Latitude (decimal degrees). |
lon | number | required | Longitude (decimal degrees). |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_electricity_zone_for_location", "arguments": {"lat": 59.91, "lon": 10.75}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'lat': 59.91, 'lon': 10.75},
'name': 'get_electricity_zone_for_location'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/hvakosterstrommen/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/hvakosterstrommen/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
FAQ
What data does Hvakosterstrommen (Electricity Prices) provide?
Norwegian electricity spot prices and day-ahead market data. It exposes 7 tools: get_current_electricity_price, get_electricity_prices_today, get_electricity_prices_tomorrow, get_cheapest_electricity_window, get_electricity_price_history, get_electricity_zone_for_location, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the Hvakosterstrommen (Electricity Prices) API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.