Skip to main content

Hedging

To get an array of all available Hedging in our API with relation to Forecasts you can use the Get Forecast Hedging endpoint.

import datetime
import typing

import requests
import pydantic

class Hedging(pydantic.BaseModel):
name: str
description: typing.Optional[str]

url = "https://api.clearmacro.com/api/v3/forecast/hedging/"
headers = {"accept": "application/json", "X-API-KEY": "YOUR_API_KEY"}
response = requests.get(url=url, headers=headers)
hedgings = [Hedging(**hedging) for hedging in response.json()]

Which will return data in the format:

[
{
"name": "Local",
"description": null
},
{
"name": "Hedged",
"description": null
},
{
"name": "Unhedged",
"description": null
}
]