Horizons
To get an array of all available Horizons in our API with relation to Forecasts
you can use the Get Forecast Horizons
endpoint.
- Python
- Curl
import datetime
import requests
import pydantic
class Horizon(pydantic.BaseModel):
name: str
url = "https://api.clearmacro.com/api/v3/forecast/horizon/"
headers = {"accept": "application/json", "X-API-KEY": "YOUR_API_KEY"}
response = requests.get(url=url, headers=headers)
horizons = [Horizon(**horizon) for horizon in response.json()]
curl -X "GET" \
https://api.clearmacro.com/api/v3/forecast/horizon/
-H "X-API-KEY:$API_KEY" | jq
Which will return data in the format:
[
{
"name": "Week"
},
{
"name": "Month"
},
{
"name": "3 Months"
},
...
]