/
Price forecast

Price forecast

You can choose to opt out of HYDROGRIDs price forecast and provide your own.

Example of sending your own price forecast

import requests # Configurations price_forecast_id = "YOUR_PRICE_FORECAST_ID_HERE" api_token = "your_api_token_here" endpoint = f"https://api.hydrogrid.ai/v1/price_forecast_source/{price_forecast_id}/price_forecast" data = { "market_observation_timestamp": 1688389171000, "timeseries": [ { "timestamp": 1688389171000, "value": 0.1 }, { "timestamp": 1688389171000, "value": 0.1 } ], "creation_timestamp": 1688389171000 } # Send the POST request response = requests.post( endpoint, headers={ "Authorization": f"Bearer {api_token}", "Content-Type": "application/json" }, json=data, ) # Handle the response if response.ok: print("Data sent successfully!", response.json()) else: print(f"Error: {response.status_code}, {response.text}")