{"id":7206,"library":"entsoe-py","title":"ENTSO-E Python API Wrapper","description":"entsoe-py is a Python API wrapper for the ENTSO-E Transparency Platform. It simplifies querying electricity data such as day-ahead prices, generation, and capacity, primarily returning data as pandas DataFrames. The library is actively maintained, with version 0.8.0 being the latest, and sees regular updates to address API changes and add new functionality.","status":"active","version":"0.8.0","language":"en","source_language":"en","source_url":"https://github.com/EnergieID/entsoe-py","tags":["energy","electricity","entsoe","api","pandas"],"install":[{"cmd":"pip install entsoe-py","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"EntsoePandasClient is the main client for interacting with the ENTSO-E API and returning data as pandas DataFrames. EntsoeRawClient is available for raw XML output.","wrong":"from entsoe.entsoe import EntsoePandasClient","symbol":"EntsoePandasClient","correct":"from entsoe import EntsoePandasClient"}],"quickstart":{"code":"import os\nfrom entsoe import EntsoePandasClient\nimport pandas as pd\n\n# Ensure you have an ENTSO-E API key from https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/API%20Documentation.html\n# Set it as an environment variable or pass directly: api_key='YOUR_API_KEY'\napi_key = os.environ.get('ENTSOE_API_KEY', '')\n\nif not api_key:\n    print(\"Warning: ENTSOE_API_KEY environment variable not set. Using a placeholder.\")\n    print(\"Please obtain a key from ENTSO-E and set it before running.\")\n    # Use a dummy key if not set, for the example to at least initialize\n    # In a real scenario, this would likely cause an authentication error later.\n    api_key = \"dummy_api_key_for_example\"\n\nclient = EntsoePandasClient(api_key=api_key)\n\nstart = pd.Timestamp('20230101', tz='Europe/Brussels')\nend = pd.Timestamp('20230102', tz='Europe/Brussels')\ncountry_code = 'BE'\n\ntry:\n    # Query day-ahead prices for Belgium\n    day_ahead_prices = client.query_day_ahead_prices(country_code, start=start, end=end)\n    print(f\"Day-ahead prices for {country_code} (first 5 rows):\\n{day_ahead_prices.head()}\")\nexcept Exception as e:\n    print(f\"An error occurred during API query: {e}\")\n    print(\"Please ensure your API key is correct and valid, and the country code/date range are supported.\")","lang":"python","description":"This quickstart initializes the EntsoePandasClient with an API key, preferably from an environment variable, and demonstrates how to query day-ahead electricity prices for a specified country and date range. The result is a pandas Series."},"warnings":[{"fix":"Review the `entsoe-py` documentation and examples for `v0.8.0` regarding `query_intraday_offered_capacity` to adapt your function calls and parameters.","message":"The `query_intraday_offered_capacity` function's signature and behavior were redesigned in `v0.8.0` due to changes related to 'IDA go live'. Existing code calling this specific function may break.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Upgrade to `entsoe-py>=0.7.10` to ensure consistent and correct timezone parsing across all endpoints.","message":"Prior to `v0.7.10`, there were reported inconsistencies in how timezones (e.g., lower case 'z' vs 'Z' in timestamps) were handled, potentially leading to parsing errors or incorrect time alignments in retrieved data.","severity":"gotcha","affected_versions":"<0.7.10"},{"fix":"Upgrade to `entsoe-py>=0.7.9` to prevent the library from enabling all warnings on import, resulting in cleaner application logs.","message":"Versions of `entsoe-py` prior to `v0.7.9` were known to enable all warnings upon import, which could lead to excessively verbose logs in applications.","severity":"gotcha","affected_versions":"<0.7.9"},{"fix":"For intraday prices, use the `query_intraday_prices` function, which was introduced in `v0.7.5` specifically for this purpose. Check the documentation for its usage.","message":"In `v0.7.5`, the `query_day_ahead_prices` function was refined to strictly return day-ahead prices. If you were implicitly relying on it to retrieve intraday prices for some zones, its behavior might have changed.","severity":"gotcha","affected_versions":">=0.7.5"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure you have obtained an API key from the ENTSO-E Transparency Platform and set it as the `ENTSOE_API_KEY` environment variable, or pass it directly: `client = EntsoePandasClient(api_key='YOUR_API_KEY')`.","cause":"The ENTSO-E API key was not provided to the EntsoePandasClient constructor or found in the `ENTSOE_API_KEY` environment variable.","error":"Missing API key. Please set the 'ENTSOE_API_KEY' environment variable or pass 'api_key' to the constructor."},{"fix":"Consult the `entsoe-py` documentation or source code for `v0.8.0` to verify the correct function name and parameters for querying intraday offered capacity.","cause":"The `query_intraday_offered_capacity` function underwent a significant redesign in `v0.8.0`, potentially changing its name, signature, or parameters.","error":"AttributeError: 'EntsoePandasClient' object has no attribute 'query_intraday_offered_capacity' (or similar error after upgrading to v0.8.0)"},{"fix":"Upgrade to `entsoe-py>=0.7.3` to resolve known parsing stability issues and avoid errors related to DataFrame column operations.","cause":"Older versions (pre `v0.7.3`) had a bug related to internal DataFrame column renaming during parsing, which could lead to crashes, as reported in GitHub issue #428.","error":"KeyError: \"['some_column_name'] not found in axis\" or ValueError: cannot reindex on an axis with duplicate labels"},{"fix":"Upgrade to `entsoe-py>=0.7.6` to benefit from fixes that improve handling of various API responses, including unexpected content types and malformed XML.","cause":"The ENTSO-E API sometimes returned unexpected content types or malformed XML responses that older `entsoe-py` versions (pre `v0.7.6`) failed to parse correctly.","error":"xml.etree.ElementTree.ParseError: no element found: line 1, column 0"}]}