### Register New User - Python Example Source: https://docs.watttime.org/index Example code demonstrating how to register a new user for the WattTime API. This involves sending user details in the request body as a JSON object. ```Python import requests url = "https://api.watttime.org/v3/register" payload = { "email": "user@example.com", "password": "your_password", "country": "US", "state": "CA", "city": "Los Angeles" } response = requests.post(url, json=payload) if response.status_code == 200: print("User registered successfully!") else: print(f"Error registering user: {response.text}") ``` -------------------------------- ### WattTime API v3 Metadata Example Source: https://docs.watttime.org/openapi Example of metadata associated with a v3 API response. This includes details about the data points, the region, the signal type, units, and any warnings or model information. ```json { "data_point_period_seconds": 300, "model": { "date": "2023-03-01", "type": "binned_regression" }, "region": "CAISO_NORTH", "signal_type": "co2_moer", "units": "lbs_co2_per_mwh", "warnings": [ { "message": "This is just an example", "type": "EXAMPLE_WARNING" } ] } ``` -------------------------------- ### WattTime API v3 Response Example Source: https://docs.watttime.org/openapi Example of a v3 API response containing historical data for a specific region and signal. It includes data points with their values and timestamps, along with metadata such as data point period, region, signal type, units, and any warnings. ```json { "data": [ { "imputed_data_used": true, "last_updated": "2023-10-01T00:00:00Z", "point_time": "2022-07-15T00:00:00Z", "value": 870 }, { "imputed_data_used": true, "last_updated": "2023-10-01T00:05:00Z", "point_time": "2022-07-15T00:05:00Z", "value": 860 } ], "meta": { "data_point_period_seconds": 300, "model": { "date": "2023-03-01", "type": "binned_regression" }, "region": "CAISO_NORTH", "signal_type": "co2_moer", "units": "lbs_co2_per_mwh", "warnings": [ { "message": "This is just an example", "type": "EXAMPLE_WARNING" } ] } } ``` -------------------------------- ### Python Client for WattTime API Source: https://docs.watttime.org/openapi This snippet demonstrates how to use the WattTime Python client/SDK to interact with the API endpoints. It serves as a starting point for developers to integrate WattTime data into their applications. ```Python from watttime import WattTime # Initialize the WattTime client # You might need to provide API keys or credentials depending on the setup # For example: wt = WattTime(api_key='YOUR_API_KEY') wt = WattTime() # Example: Get region data for a specific location (latitude, longitude) # lat, lon = 34.0522, -118.2437 # Example: Los Angeles, CA # region = wt.region_from_loc(lat, lon) # print(f"The region for ({lat}, {lon}) is: {region}") # Example: Get forecast data for a region # region_name = 'CAISO_NORTH' # signal_type = 'LMP' # forecast_data = wt.get_forecast(region_name, signal_type) # print(f"Forecast data for {region_name} ({signal_type}): {forecast_data}") # Example: Get historical data for a region # historical_data = wt.get_historical(region_name, signal_type) # print(f"Historical data for {region_name} ({signal_type}): {historical_data}") # Note: The actual usage might vary based on the specific methods available in the client library. # Refer to the official WattTime Python client documentation for detailed usage. ``` -------------------------------- ### Authenticate with WattTime API Source: https://docs.watttime.org/openapi This Python code demonstrates how to authenticate with the WattTime API using a bearer token. It sends a GET request to the `/v3/my-access` endpoint with the provided token in the Authorization header. ```Python import requests url = "https://api.watttime.org/v3/my-access" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = {} response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Historical Forecast Data Source: https://docs.watttime.org/openapi Retrieves historical forecasted data for a specified region, signal type, and time period. It requires authentication and allows filtering by start and end dates, region, signal type, and optionally by model and horizon hours. The response includes generated data points and their corresponding forecast values. ```Python import requests url = "https://api.watttime.org/v3/forecast/historical" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "start": "2023-07-15T00:00Z", "end": "2023-07-15T01:00Z", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Forecast (Python) Source: https://docs.watttime.org/openapi Fetches the most recent forecast for a given region and signal type. Users can specify the forecast horizon in hours. Authentication is required. ```Python import requests url = "https://api.watttime.org/v3/forecast" # Provide your TOKEN here, see http ``` -------------------------------- ### Get Current CO2 MOER Index (Python) Source: https://docs.watttime.org/index Fetches the current CO2 MOER index for a specified region using the WattTime API. Requires authentication with a Bearer token and specifies the region and signal type as query parameters. ```Python import requests url = "https://api.watttime.org/v3/signal-index" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Python: Get Historical WattTime Forecast Data Source: https://docs.watttime.org/index This Python snippet shows how to retrieve historical forecast data for a specific region and time range from the WattTime API. It requires an API token for authentication and specifies the signal type (e.g., 'co2_moer'). The code handles making the GET request and printing the JSON response. ```Python import requests url = "https://api.watttime.org/v3/forecast/historical" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "start": "2023-07-15T00:00Z", "end": "2023-07-15T01:00Z", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Historical Signal Data - Python Source: https://docs.watttime.org/index Fetches historical signal data (e.g., CO2 MOER) for a specified region and time range using the WattTime API. Requires authentication with a provided token. ```Python import requests url = "https://api.watttime.org/v3/historical" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "start": "2022-07-15T00:00+00:00", "end": "2022-07-15T00:05+00:00", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Reset Password - Python Source: https://docs.watttime.org/openapi This Python code snippet demonstrates how to reset a user's password using the WattTime API. It sends a GET request to the password reset endpoint with a username. ```Python # To reset your password, use this code: import requests password_url = 'https://api.watttime.org/password/?username=freddo' rsp = requests.get(password_url) print(rsp.json()) ``` -------------------------------- ### Get Recent Forecast Data (Python) Source: https://docs.watttime.org/index This Python code snippet demonstrates how to fetch the most recent forecast data from the WattTime API. It requires authentication with a Bearer token and specifies the region and signal type as parameters. The response is printed as JSON. ```Python import requests url = "https://api.watttime.org/v3/forecast" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Account Access Information Source: https://docs.watttime.org/index This code retrieves information about the data your WattTime account can access, including signal types, regions, endpoints, and models. It requires an authorization bearer token obtained from the login endpoint. The response is a nested JSON object. ```Python import requests url = "https://api.watttime.org/v3/my-access" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = {} response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Historical Datapoint Data (Python) Source: https://docs.watttime.org/openapi Retrieves historical grid data for a specified region and time range. Requires authentication with a Bearer token. The query is limited to 32 days of data and supports filtering by signal type, region, and optional model parameters. ```Python import requests url = "https://api.watttime.org/v3/historical" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "start": "2022-07-15T00:00+00:00", "end": "2022-07-15T00:05+00:00", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Grid Region Map Geometry (Python) Source: https://docs.watttime.org/index Fetches the GeoJSON data representing the boundaries of grid regions globally. This endpoint is restricted to users with ANALYST or PRO subscriptions and provides information on when the GeoJSON was last updated. Requires authentication. ```Python import requests url = "https://api.watttime.org/v3/maps" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Grid Region from Location (Python) Source: https://docs.watttime.org/index Retrieves the grid region details for a given latitude and longitude. This is useful for understanding the specific grid an energy-consuming device is connected to, as emissions intensity varies by location. Requires authentication. ```Python import requests url = "https://api.watttime.org/v3/region-from-loc" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = {"latitude": "42.372", "longitude": "-72.519", "signal_type": "co2_moer"} response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Signal Index (Python) Source: https://docs.watttime.org/openapi Retrieves the signal index for a specified region and signal type. Requires authentication with a Bearer token. The signal type 'co2_moer' is currently the only available option. ```Python import requests url = "https://api.watttime.org/v3/signal-index" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "region": "CAISO_NORTH", "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Get Grid Region Map Geometry - Python Source: https://docs.watttime.org/openapi This Python code snippet demonstrates how to retrieve the geojson boundary for grid regions using the WattTime API. It requires authentication and a specified signal type. ```Python import requests url = "https://api.watttime.org/v3/maps" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = { "signal_type": "co2_moer", } response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Register User with WattTime API Source: https://docs.watttime.org/index This snippet demonstrates how to register a new user with the WattTime API. It requires username, password, and email, with an optional organization field. The API returns a success message and the username upon successful registration. ```Python import requests register_url = 'https://api.watttime.org/register' params = {'username': 'freddo', 'password': 'the_frog', 'email': 'freddo@frog.org', 'org': 'freds world'} rsp = requests.post(register_url, json=params) print(rsp.text) ``` -------------------------------- ### Register New User - Python Source: https://docs.watttime.org/openapi Register a new user for the WattTime API. This endpoint requires basic user information such as username, password, and email. The provided username and password will be used for subsequent API calls. ```Python import requests register_url = 'https://api.watttime.org/register' params = {'username': 'freddo', 'password': 'the_frog', 'email': 'freddo@frog.org', 'org': 'freds world'} rsp = requests.post(register_url, json=params) print(rsp.text) ``` -------------------------------- ### Login and Obtain Access Token Source: https://docs.watttime.org/index This code sample shows how to authenticate with the WattTime API using HTTP basic authentication to obtain an access token. The token is required for subsequent authenticated requests and expires after 30 minutes. A 401 error indicates the token has expired. ```Python import requests from requests.auth import HTTPBasicAuth login_url = 'https://api.watttime.org/login' rsp = requests.get(login_url, auth=HTTPBasicAuth('freddo', 'the_frog')) TOKEN = rsp.json()['token'] print(rsp.json()) ``` -------------------------------- ### Fetch Historical Forecast Data (Python) Source: https://docs.watttime.org/index This Python code snippet demonstrates how to retrieve historical forecasted data from the WattTime API. It specifies the region, signal type, and time range for the query. The response is then processed to extract relevant information. ```Python import requests import json def get_historical_forecast(start_time, end_time, region, signal_type, model=None, horizon_hours=24): """Fetches historical forecast data from the WattTime API. Args: start_time (str): The start of the time period (ISO8601 format). end_time (str): The end of the time period (ISO8601 format). region (str): The region for the forecast (e.g., 'CAISO_NORTH'). signal_type (str): The type of signal (e.g., 'co2_moer'). model (str, optional): The model version. Defaults to None. horizon_hours (int, optional): The forecast horizon in hours. Defaults to 24. Returns: dict: The JSON response from the API, or None if an error occurred. """ base_url = "https://api.watttime.org/v3/forecast/historical" params = { "start": start_time, "end": end_time, "region": region, "signal_type": signal_type, "horizon_hours": horizon_hours } if model: params["model"] = model try: response = requests.get(base_url, params=params) response.raise_for_status() # Raise an exception for bad status codes return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching data: {e}") return None # Example usage: if __name__ == "__main__": start = "2022-07-15T21:00:00Z" end = "2022-07-15T23:55:00Z" region = "CAISO_NORTH" signal = "co2_moer" forecast_data = get_historical_forecast(start, end, region, signal) if forecast_data: print(json.dumps(forecast_data, indent=2)) # Process the data as needed for item in forecast_data.get('data', []): generated_at = item.get('generated_at') forecast_values = item.get('forecast') if generated_at and forecast_values: print(f"Generated At: {generated_at}") for point in forecast_values: print(f" - Point Time: {point.get('point_time')}, Value: {point.get('value')}") else: print("Failed to retrieve forecast data.") ``` -------------------------------- ### Login & Obtain Token - Python Source: https://docs.watttime.org/openapi Log in to the WattTime API using your username and password to obtain an access token. This token is required for all subsequent authenticated API requests and expires after 30 minutes. ```Python import requests from requests.auth import HTTPBasicAuth login_url = 'https://api.watttime.org/login' rsp = requests.get(login_url, auth=HTTPBasicAuth('freddo', 'the_frog')) TOKEN = rsp.json()['token'] print(rsp.json()) ``` -------------------------------- ### WattTime API Success Response (200) Source: https://docs.watttime.org/index This is a sample of a successful response (HTTP 200) from the WattTime API. It includes the 'data' field, which contains an array of forecast objects, each with a 'point_time' and a 'value'. ```json { "data": [ { "forecast": [ { "point_time": "2022-07-15T00:00:00Z", "value": 870 }, { "point_time": "2022-07-15T00:05:00Z", "value": 870 } ] } ] } ``` -------------------------------- ### V3ForecastMetadata Structure Source: https://docs.watttime.org/openapi Defines the metadata associated with a WattTime forecast, including data point period, region, signal type, units, and warnings. It also includes information about the forecasting model. ```json { "data_point_period_seconds": 300, "region": "CAISO_NORTH", "signal_type": "co2_moer", "units": "lbs_co2_per_mwh", "warnings": [ { "message": "This is just an example", "type": "EXAMPLE_WARNING" } ], "model": { "date": "2023-03-01" }, "generated_at_period_seconds": 300 } ``` -------------------------------- ### WattTime API Successful JSON Response (200) Source: https://docs.watttime.org/index This is a sample of a successful JSON response from the WattTime API. It contains a 'data' array with time-series data points, each including a 'point_time' and a 'value'. This format is typically returned for valid data requests. ```json { "data": [ { "point_time": "2022-07-15T00:00:00Z", "value": 870 }, { "point_time": "2022-07-15T00:05:00Z", "value": 870 } ] } ``` -------------------------------- ### V3SingleForecastMetadata Structure Source: https://docs.watttime.org/openapi Defines the structure for metadata related to a single forecast in WattTime API V3. It includes parameters like data point period, region, signal type, units, and any associated warnings. ```json { "required": [ "data_point_period_seconds", "region", "signal_type", "units", "warnings", "generated_at_period_seconds", "generated_at" ], "title": "V3SingleForecastMetadata", "example": { "data_point_period_seconds": 300, "generated_at": "2022-07-15T00:00:00Z", "generated_at_period_seconds": 300, "model": { "date": "2023-03-01" }, "region": "CAISO_NORTH", "signal_type": "co2_moer", "units": "lbs_co2_per_mwh", "warnings": [ { "message": "This is just an example", "type": "EXAMPLE_WARNING" } ] } } ``` -------------------------------- ### Define BaseAPIV3ResponseFormat Schema Source: https://docs.watttime.org/openapi Defines the schema for the base API V3 response format. Includes 'point_time' (date-time string) and 'value' (number). ```JSON {"properties":{"point_time":{"type":"string","format":"date-time","title":"Point Time"},"value":{"type":"number","title":"Value"}},"type":"object","required":["point_time","value"],"title":"BaseAPIV3ResponseFormat","example":{"point_time":"2022-07-15T00:00:00Z","value":870}} ``` -------------------------------- ### Request Password Reset Source: https://docs.watttime.org/index This Python snippet demonstrates how to request a password reset via the WattTime API. It requires the username, and the API will send password reset instructions to the user's registered email address. ```Python import requests password_url = 'https://api.watttime.org/password/?username=freddo' rsp = requests.get(password_url) print(rsp.json()) ``` -------------------------------- ### Determine Grid Region by Location - Python Source: https://docs.watttime.org/openapi This Python code snippet shows how to determine the grid region for a given latitude and longitude using the WattTime API. It requires authentication and specifies the signal type. ```Python import requests url = "https://api.watttime.org/v3/region-from-loc" # Provide your TOKEN here, see https://docs.watttime.org/#tag/Authentication/operation/get_token_login_get for more information TOKEN = "" headers = {"Authorization": f"Bearer {TOKEN}"} params = {"latitude": "42.372", "longitude": "-72.519", "signal_type": "co2_moer"} response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json()) ``` -------------------------------- ### Password Reset Request - Python Source: https://docs.watttime.org/openapi Request a password reset by providing your username. An email with instructions will be sent to the registered email address associated with the username. ```Python # To request a password reset, provide your username. # Example: Replace 'freddo' with your actual username. # import requests # password_reset_url = 'https://api.watttime.org/password' # params = {'username': 'freddo'} # rsp = requests.get(password_reset_url, params=params) # print(rsp.text) ``` -------------------------------- ### Define Meta Schema for API V3 Source: https://docs.watttime.org/openapi Defines the schema for metadata associated with API V3 responses. It includes properties for 'last_updated' (date-time string) and 'signal_type' (string). ```JSON {"type":"object","required":["last_updated","signal_type"],"title":"Meta"} ``` -------------------------------- ### Define V3ExtendedForecastResponse Schema Source: https://docs.watttime.org/openapi Defines the schema for the extended forecast response in API V3. Includes 'data' (array of APIV3ExtendedForecastType objects) and 'meta' (V3ForecastMetadata object). ```JSON {"properties":{"data":{"items":{"$ref":"#/components/schemas/APIV3ExtendedForecastType"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/V3ForecastMetadata"}},"type":"object","required":["data","meta"],"title":"V3ExtendedForecastResponse","example":{"data":[{"forecast":[{"point_time":"2022-07-15T00:00:00Z","value":870},{"point_time":"2022-07-15T00:05:00Z","value":870},{"point_time":"2022-07-15T00:10:00Z","value":870},{"point_time":"2022-07-15T00:15:00Z","value":870},{"point_time":"2022-07-15T00:20:00Z","value":870},{"point_time":"2022-07-15T00:25:00Z","value":870},{"point_time":"2022-07-15T00:30:00Z","value":870},{"point_time":"2022-07-15T00:35:00Z","value":870},{"point_time":"2022-07-15T00:40:00Z","value":870},{"point_time":"2022-07-15T00:45:00Z","value":870},{"point_time":"2022-07-15T00:50:00Z","value":870},{"point_time":"2022-07-15T00:55:00Z","value":870},{"point_time":"2022-07-15T01:00:00Z","value":870},{"point_time":"2022-07-15T01:05:00Z","value":870},{"point_time":"2022-07-15T01:10:00Z","value":870},{"point_time":"2022-07-15T01:15:00Z","value":870},{"point_time":"2022-07-15T01:20:00Z","value":870},{"point_time":"2022-07-15T01:25:00Z","value":870},{"point_time":"2022-07-15T01:30:00Z","value":870},{"point_time":"2022-07-15T01:35:00Z","value":870},{"point_time":"2022-07-15T01:40:00Z","value":870},{"point_time":"2022-07-15T01:45:00Z","value":870},{"point_time":"2022-07-15T01:50:00Z","value":870},{"point_time":"2022-07-15T01:55:00Z","value":870},{"point_time":"2022-07-15T02:00:00Z","value":870},{"point_time":"2022-07-15T02:05:00Z","value":870},{"point_time":"2022-07-15T02:10:00Z","value":870},{"point_time":"2022-07-15T02:15:00Z","value":870},{"point_time":"2022-07-15T02:20:00Z","value":870},{"point_time":"2022-07-15T02:25:00Z","value":870},{"point_time":"2022-07-15T02:30:00Z","value":870},{"point_time":"2022-07-15T02:35:00Z","value":870},{"point_time":"2022-07-15T02:40:00Z","value":870},{"point_time":"2022-07-15T02:45:00Z","value":870},{"point_time":"2022-07-15T02:50:00Z","value":870},{"point_time":"2022-07-15T02:55:00Z","value":870},{"point_time":"2022-07-15T03:00:00Z","value":870},{"point_time":"2022-07-15T03:05:00Z","value":870},{"point_time":"2022-07-15T03:10:00Z","value":870},{"point_time":"2022-07-15T03:15:00Z","value":870},{"point_time":"2022-07-15T03:20:00Z","value":870},{"point_time":"2022-07-15T03:25:00Z","value":870},{"point_time":"2022-07-15T03:30:00Z","value":870},{"point_time":"2022-07-15T03:35:00Z","value":870},{"point_time":"2022-07-15T03:40:00Z","value":870},{"point_time":"2022-07-15T03:45:00Z","value":870},{"point_time":"2022-07-15T03:50:00Z","value":870},{"point_time":"2022-07-15T03:55:00Z","value":870},{"point_time":"2022-07-15T04:00:00Z","value":870},{"point_time":"2022-07-15T04:05:00Z","value":870},{"point_time":"2022-07-15T04:10:00Z","value":870},{"point_time":"2022-07-15T04:15:00Z","value":870},{"point_time":"2022-07-15T04:20:00Z","value":870},{"point_time":"2022-07-15T04:25:00Z","value":870},{"point_time":"2022-07-15T04:30:00Z","value":870},{"point_time":"2022-07-15T04:35:00Z","value":870},{"point_time":"2022-07-15T04:40:00Z","value":870},{"point_time":"2022-07-15T04:45:00Z","value":870},{"point_time":"2022-07-15T04:50:00Z","value":870},{"point_time":"2022-07-15T04:55:00Z","value":870},{"point_time":"2022-07-15T05:00 ``` -------------------------------- ### Define APIV3DataResponseFormat Schema Source: https://docs.watttime.org/openapi Defines the schema for the standard data response format in API V3. Includes 'point_time' (date-time string), 'value' (number), 'last_updated' (nullable date-time string), and 'imputed_data_used' (nullable boolean). ```JSON {"properties":{"point_time":{"type":"string","format":"date-time","title":"Point Time"},"value":{"type":"number","title":"Value"},"last_updated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Updated"},"imputed_data_used":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Imputed Data Used"}},"type":"object","required":["point_time","value"],"title":"APIV3DataResponseFormat","example":{"imputed_data_used":true,"last_updated":"2023-10-01T00:00:00Z","point_time":"2022-07-15T00:00:00Z","value":870}} ``` -------------------------------- ### Define APIV3ExtendedForecastType Schema Source: https://docs.watttime.org/openapi Defines the schema for extended forecast data in API V3. Includes 'generated_at' (date-time string) and 'forecast' (array of APIV3DataResponseFormat objects). The forecast array has a minItems of 1 and maxItems of 864. ```JSON {"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"forecast":{"items":{"$ref":"#/components/schemas/APIV3DataResponseFormat"},"type":"array","maxItems":864,"minItems":1,"title":"Forecast"}},"type":"object","required":["generated_at","forecast"],"title":"APIV3ExtendedForecastType"} ``` -------------------------------- ### Define Properties Schema for API V3 Source: https://docs.watttime.org/openapi Defines the schema for properties associated with API V3 responses, including 'region' and 'region_full_name', both of which are strings. ```JSON {"properties":{"region":{"type":"string","title":"Region"},"region_full_name":{"type":"string","title":"Region Full Name"}},"type":"object","required":["region","region_full_name"],"title":"Properties"} ``` -------------------------------- ### Define ModelTypes Enum Schema Source: https://docs.watttime.org/openapi Defines the schema for the ModelTypes enumeration, which specifies the allowed model types as strings. ```JSON {"type":"string","enum":["interchange","average","binned_regression","heatrate","proxy","synthetic_proxy"],"title":"ModelTypes"} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.