Building Custom APIs with Energy API: A Developer’s Toolkit for Energy Solutions
Introduction
In today's fast-paced energy market, developers and data engineers face the daunting challenge of accessing reliable and timely market data. The energy sector is characterized by a multitude of data sources, each with its own unique formats, schedules, and naming conventions. This fragmentation makes it difficult for developers to stitch together a coherent view of the market, often leading to wasted time and resources. The need for a unified solution that aggregates wholesale energy market data has never been more pressing.
This is where Energy API comes into play. By providing a single REST API that normalizes data from various trusted sources, Energy API empowers developers to access comprehensive energy market data without the hassle of scraping government portals or dealing with incompatible formats. In this blog post, we will explore how to build custom APIs with Energy API, highlighting its features, endpoints, and real-world use cases.
Why Energy API
Energy API stands out in the crowded landscape of energy data solutions for several reasons:
- Unified Data Access: Energy API aggregates data from multiple sources such as OMIE, ENTSO-E, EIA, and ESIOS into a single, normalized JSON interface. This eliminates the need for developers to manage different formats and schedules, allowing them to focus on building applications rather than data wrangling.
- Comprehensive Coverage: With over 39 symbols across six commodity categories—electricity, gas, oil, coal, carbon, and carbon intensity—developers can access a wide range of market data in one place. This comprehensive coverage enables more robust analysis and decision-making.
- Rapid Development: Energy API's consistent JSON schema across all commodities means that developers can ship features in hours, not weeks. This accelerates the development cycle and allows teams to respond quickly to market changes.
- Real-Time Data: With endpoints that provide intraday electricity curves and the latest prices for various commodities, developers can build applications that react to real-time market conditions, enhancing their competitiveness in the market.
Quick Start
Getting started with Energy API is straightforward. The base URL for the API is:
https://energy-api.com/api/v1
To make your first request, you will need to include your API key as a query parameter. Here’s an example of how to fetch the latest prices for Brent Crude and TTF Gas:
curl -G https://energy-api.com/api/v1/latest \
--data-urlencode "symbols=BRENT_CRUDE,TTF_GAS" \
--data-urlencode "api_key=YOUR_API_KEY"
The expected JSON response will look like this:
{
"success": true,
"date": "2026-06-11",
"base": "MIXED",
"rates": {
"BRENT_CRUDE": 74.82,
"TTF_GAS": 38.15
},
"dates": {
"BRENT_CRUDE": "2026-06-11",
"TTF_GAS": "2026-06-11"
},
"currencies": {
"BRENT_CRUDE": "USD",
"TTF_GAS": "EUR"
}
}
In this response, the key fields include:
- success: Indicates whether the request was successful.
- date: The date of the data returned.
- rates: An object containing the latest prices for the requested symbols.
- currencies: The currency in which the prices are quoted.
Core Endpoints
Energy API offers a variety of endpoints that cater to different data needs. Below are some of the core endpoints relevant to developers:
1. GET /latest
This endpoint retrieves the most recent price for one or more symbols.
Key Params: symbols (required), base (optional), category (optional)
curl -G https://energy-api.com/api/v1/latest \
--data-urlencode "symbols=BRENT_CRUDE,TTF_GAS,EUA_CO2" \
--data-urlencode "api_key=YOUR_API_KEY"
JSON Response:
{
"success": true,
"date": "2026-06-11",
"base": "MIXED",
"rates": {
"BRENT_CRUDE": 74.82,
"TTF_GAS": 38.15,
"EUA_CO2": 67.40
},
"dates": {
"BRENT_CRUDE": "2026-06-11",
"TTF_GAS": "2026-06-11",
"EUA_CO2": "2026-06-11"
},
"currencies": {
"BRENT_CRUDE": "USD",
"TTF_GAS": "EUR",
"EUA_CO2": "EUR"
}
}
Field Explanation:
- rates: Contains the latest prices for the requested symbols.
- dates: Provides the date for each symbol's price.
- currencies: Indicates the currency for each price.
2. GET /historical
This endpoint provides prices for all symbols on a specific past date. If the date falls on a non-publishing day, it returns the most recent value before it.
Key Params: date (YYYY-MM-DD, required), symbols (required), base (optional)
curl -G https://energy-api.com/api/v1/historical \
--data-urlencode "date=2025-09-15" \
--data-urlencode "symbols=BRENT_CRUDE,TTF_GAS" \
--data-urlencode "api_key=YOUR_API_KEY"
JSON Response:
{
"success": true,
"date": "2025-09-15",
"base": "MIXED",
"rates": {
"BRENT_CRUDE": 71.45,
"TTF_GAS": 36.20
},
"currencies": {
"BRENT_CRUDE": "USD",
"TTF_GAS": "EUR"
}
}
Field Explanation:
- date: The date for which the historical prices are requested.
- rates: Contains the historical prices for the requested symbols.
- currencies: Indicates the currency for each price.
3. GET /timeseries
This endpoint retrieves historical series between two dates, ideal for charting and trend analysis.
Key Params: start (required), end (required), symbols (required), base (optional)
curl -G https://energy-api.com/api/v1/timeseries \
--data-urlencode "start=2025-01-01" \
--data-urlencode "end=2025-03-31" \
--data-urlencode "symbols=BRENT_CRUDE,TTF_GAS" \
--data-urlencode "api_key=YOUR_API_KEY"
JSON Response:
{
"success": true,
"base": "MIXED",
"start_date": "2025-01-01",
"end_date": "2025-03-31",
"rates": {
"BRENT_CRUDE": {
"2025-01-02": 76.30,
"2025-01-03": 75.90
},
"TTF_GAS": {
"2025-01-02": 46.80,
"2025-01-03": 47.10
}
},
"frequencies": {
"BRENT_CRUDE": "daily",
"TTF_GAS": "daily"
},
"currencies": {
"BRENT_CRUDE": "USD",
"TTF_GAS": "EUR"
}
}
Field Explanation:
- start_date: The start date for the time series data.
- end_date: The end date for the time series data.
- rates: Contains the historical prices keyed by date for each symbol.
- frequencies: Indicates the frequency of the data (e.g., daily).
- currencies: Indicates the currency for each price.
4. GET /fluctuation
This endpoint provides start/end values, absolute change, and percentage change over a specified period.
Key Params: start (required), end (required), symbols (required), base (optional)
curl -G https://energy-api.com/api/v1/fluctuation \
--data-urlencode "start=2025-01-01" \
--data-urlencode "end=2025-01-31" \
--data-urlencode "symbols=BRENT_CRUDE" \
--data-urlencode "api_key=YOUR_API_KEY"
JSON Response:
{
"success": true,
"fluctuation": {
"BRENT_CRUDE": {
"start_value": 76.30,
"end_value": 75.90,
"change": -0.40,
"change_pct": -0.52
}
}
}
Field Explanation:
- start_value: The price at the start of the period.
- end_value: The price at the end of the period.
- change: The absolute change in price over the period.
- change_pct: The percentage change in price over the period.
Real-World Use Cases
Energy API can be leveraged in various real-world applications. Here are three concrete examples:
1. Price Alert System
Developers can build a price alert system that notifies users when the price of a specific commodity reaches a certain threshold. By using the /latest endpoint, the application can continuously monitor prices and send alerts via email or SMS when conditions are met.
2. ESG Dashboard
For teams focused on environmental, social, and governance (ESG) metrics, Energy API can provide real-time carbon intensity data. By utilizing the /carbon-intensity endpoint, developers can create dashboards that visualize carbon emissions and help organizations track their sustainability goals.
3. Cost Calculator
Energy traders can develop a cost calculator that estimates monthly wholesale electricity costs based on the latest prices. By using the /cost-estimate endpoint, the application can provide users with accurate estimates based on their expected usage.
FAQ
How often does the TTF gas price update?
The TTF gas price updates daily, reflecting the most recent market conditions. Developers can use the /latest endpoint to retrieve the most current price at any time.
Can I get historical energy prices going back 5 years?
Yes, Energy API allows you to access historical prices for various commodities. By using the /historical and /timeseries endpoints, developers can retrieve data for specific dates or ranges, enabling comprehensive analysis.
Does the API support multiple currencies?
Absolutely! Energy API supports multiple currencies for different commodities. When making requests, developers can specify the base currency, and the API will return prices in the requested format.
Conclusion
Building custom APIs with Energy API offers developers a powerful toolkit for accessing reliable energy market data. By unifying data from multiple sources into a single, normalized interface, Energy API eliminates the complexities of managing disparate data formats and schedules. This not only accelerates development cycles but also empowers teams to create innovative solutions that respond to real-time market conditions.
Whether you're building a price alert system, an ESG dashboard, or a cost calculator, Energy API provides the necessary endpoints and data to bring your ideas to life. Don't let fragmented data hold you back—leverage the capabilities of Energy API to streamline your development process and enhance your applications.
Ready to get started? Try Energy API for free and unlock the potential of energy market data today!
Ready to get started?
Get your API key and start querying energy commodity prices in minutes.
Get API KeyRelated posts
Unlock the potential of Energy API in decentralized energy resources. Discover essential tools for developers...
Read more →
Unlock the power of Energy API to create customizable energy dashboards. Discover how to streamline data acces...
Read more →
Discover how to build custom SaaS solutions with Energy API for efficient energy management. Streamline data a...
Read more →
Unlock the power of Energy API to create custom energy analytics dashboards. Discover how to streamline data a...
Read more →
Discover how to leverage Energy API to enhance smart building technologies and improve energy efficiency. Unlo...
Read more →