{"id":10345,"library":"wapi-python","title":"Volue Insight API Python Library","description":"The `wapi-python` library provides programmatic access to the Volue Insight API (formerly Wattsight API). It allows users to retrieve energy market data, forecasts, and reports. The current version is 0.7.15. It is actively maintained with regular releases, typically multiple times per year, introducing new features and bug fixes.","status":"active","version":"0.7.15","language":"en","source_language":"en","source_url":"https://github.com/VolueInsight/wapi-python","tags":["api-client","energy","data-retrieval","market-data","time-series","volue"],"install":[{"cmd":"pip install wapi-python","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"HTTP client for API communication.","package":"requests"},{"reason":"Used for data manipulation and output formatting (optional but common).","package":"pandas"},{"reason":"Date and time parsing and manipulation.","package":"python-dateutil"},{"reason":"Timezone handling.","package":"pytz"},{"reason":"Caching mechanisms for API responses.","package":"cachetools"}],"imports":[{"symbol":"Session","correct":"from wapi import Session"},{"note":"Output formatters are in the `wapi.output` submodule.","wrong":"from wapi import PandasDataFrameOutput","symbol":"PandasDataFrameOutput","correct":"from wapi.output import PandasDataFrameOutput"},{"note":"Deprecated in v0.5.0; use `session.get_series` instead.","wrong":"session.get_series_data(...)","symbol":"get_series_data","correct":"session.get_series(...)"}],"quickstart":{"code":"import os\nfrom wapi import Session\n\n# Set up session using client ID and secret (from environment variables or direct arguments)\n# Ensure WAPI_CLIENT_ID and WAPI_CLIENT_SECRET environment variables are set.\n# Alternatively, pass client_id='your_id' and client_secret='your_secret' directly.\nsession = Session(\n    client_id=os.environ.get('WAPI_CLIENT_ID', 'YOUR_CLIENT_ID'),\n    client_secret=os.environ.get('WAPI_CLIENT_SECRET', 'YOUR_CLIENT_SECRET')\n)\n\n# Example: Get a single time series by ID\n# (Replace 10000001 with a valid series_id from your Volue Insight subscription)\nseries_id = 10000001\nstart_date = \"2023-01-01\"\nend_date = \"2023-01-07\"\n\ntry:\n    ts = session.get_series(\n        series_id=series_id,\n        start_date=start_date,\n        end_date=end_date\n    )\n\n    print(f\"Retrieved series {series_id} (type: {type(ts)}):\")\n    if ts:\n        # Convert to Pandas DataFrame for easier manipulation and printing\n        print(ts.as_pandas())\n    else:\n        print(\"No data retrieved for the specified series and date range.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a session with the Volue Insight API and retrieve a time series by its ID. It highlights the use of environment variables for credentials and shows how to convert the native `WapiSeries` object to a Pandas DataFrame."},"warnings":[{"fix":"Call `.as_pandas()` on the returned `WapiSeries` object to convert it to a DataFrame. Alternatively, you can explicitly configure output using `Session(output_type=PandasDataFrameOutput)`. Example: `my_series.as_pandas()`","message":"Default output format for `session.get_series` and similar methods changed from Pandas DataFrame to native `WapiSeries` and `WapiTimeSeries` objects.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Use the unified `session.get_series(...)` method for all time series data retrieval.","message":"Old data retrieval methods like `session.get_series_data`, `session.get_region_data`, and `session.get_market_data` are deprecated.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"Upgrade your Python environment to Python 3.8 or higher. The library is tested against Python 3.8, 3.9, 3.10, and 3.11.","message":"Python 3.7 is no longer supported.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Ensure `WAPI_CLIENT_ID` and `WAPI_CLIENT_SECRET` environment variables are correctly set, or pass `client_id` and `client_secret` directly to the `Session` constructor. Double-check for typos or leading/trailing spaces.","message":"Incorrect API credentials result in authentication errors.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Set the environment variables `WAPI_CLIENT_ID` and `WAPI_CLIENT_SECRET` to your actual credentials, or pass them as arguments to `Session(client_id='your_id', client_secret='your_secret')`.","cause":"The API client ID and/or client secret were not provided or were incorrect during session initialization.","error":"wapi.errors.WapiError: Missing credentials. Client ID and Client Secret are required."},{"fix":"Use the correct method `my_series.as_pandas()` to convert the `WapiSeries` object to a Pandas DataFrame.","cause":"Since version 0.7.0, `session.get_series` returns a `WapiSeries` object, not a Pandas DataFrame. The `to_pandas` method (common in some other libraries) does not exist on `WapiSeries`.","error":"AttributeError: 'WapiSeries' object has no attribute 'to_pandas'"},{"fix":"Verify the `series_id` in the Volue Insight portal or documentation. Ensure your API client has access rights to the specific series.","cause":"The `series_id` provided to `session.get_series` does not exist, is incorrect, or is not accessible with your current API subscription.","error":"wapi.errors.WapiError: No series found for series_id=..."},{"fix":"If you need to pass custom headers (e.g., for proxies or specific API versions), use the `proxies` argument for proxy configurations or consult the `wapi-python` documentation for advanced HTTP client configuration, or create a custom `requests.Session` and pass it to `wapi.Session(requests_session=my_requests_session)`.","cause":"Attempting to pass custom HTTP headers directly to the `Session` constructor using a `headers` argument, which is not supported.","error":"TypeError: __init__ got an unexpected keyword argument 'headers'"}]}