Skip to main content

Amber Electric Public API

Project description

amberelectric

Amber is an Australian-based electricity retailer that pass through the real-time wholesale price of energy.

Because of Amber's wholesale power prices, you can save hundreds of dollars a year by automating high power devices like air-conditioners, heat pumps and pool pumps.

This Python library provides an interface to the API, allowing you to react to current and forecast prices, as well as download your historic usage.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Package version: 2.0.7
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen For more information, please visit https://www.amber.com.au

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import amberelectric

Building

Build via Poetry

poetry build

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import amberelectric
from amberelectric.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.amber.com.au/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = amberelectric.Configuration(
    host = "https://api.amber.com.au/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: apiKey
configuration = amberelectric.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with amberelectric.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = amberelectric.AmberApi(api_client)
    site_id = '01J23BAP2SFA218BMV8A73Y9Z9' # str | ID of the site you are fetching prices for. Can be found using the `/sites` enpoint
    next = 48 # int | Return the _next_ number of forecast intervals (optional)
    previous = 48 # int | Return the _previous_ number of actual intervals. (optional)
    resolution = 56 # int | Specify the required interval duration resolution. Valid options: 5, 30. Default: Your billing interval length. (optional)

    try:
        api_response = api_instance.get_current_prices(site_id, next=next, previous=previous, resolution=resolution)
        print("The response of AmberApi->get_current_prices:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AmberApi->get_current_prices: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.amber.com.au/v1

Class Method HTTP request Description
AmberApi get_current_prices GET /sites/{siteId}/prices/current
AmberApi get_current_renewables GET /state/{state}/renewables/current
AmberApi get_prices GET /sites/{siteId}/prices
AmberApi get_sites GET /sites
AmberApi get_usage GET /sites/{siteId}/usage

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

apiKey

  • Type: Bearer authentication

Author

dev@amber.com.au

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amberelectric-2.0.7.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

amberelectric-2.0.7-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

Details for the file amberelectric-2.0.7.tar.gz.

File metadata

  • Download URL: amberelectric-2.0.7.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for amberelectric-2.0.7.tar.gz
Algorithm Hash digest
SHA256 0fd4038dabed9461414ebeae471d35f1bf298e526b7456d4afabf2a4287669b6
MD5 611fee8ce2143c926d8d990737ddd1d7
BLAKE2b-256 1ee01c263cbc66eaa44e88f4f966f96ad5e185922b53bf05534e8de241d6ff70

See more details on using hashes here.

File details

Details for the file amberelectric-2.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for amberelectric-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e49cf9e2d44e56cbbb5f4a55245847e2c0cd3a73283b7a14076974be33789abe
MD5 d3b1b09e4d4ee6cf9d3bee2f4efb1388
BLAKE2b-256 7d2cdc1de9fb715b18f5fc833bd5709d164563402b3af5a80ca8dcd3a84e6006

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page