Read analyst recommendation trends by requesting the recommendation-trend module and printing the keys that come back.
The docs call recommendation-trend recommendation trend. Analyst ratings are a separate endpoint, GET /v1/markets/stock/analyst-ratings, and this request stays on modules.
To access this endpoint, you must obtain an API key: Get your API key
Stay with recommendation-trend
Send ticker AAPL and module recommendation-trend to GET /v1/markets/stock/modules. Leave timeframe unset.
Print the keys that return
The script prints a sorted key list when the body is a dict, and a type name otherwise. That line is the recommendation-trend artifact.
import requests
url = "https://api.mboum.com/v1/markets/stock/modules"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {"ticker": "AAPL", "module": "recommendation-trend"}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
payload = response.json()
body = payload["body"]
if isinstance(body, dict):
print(sorted(body.keys()))
else:
print(type(body).__name__)
One limitation: the published modules sample does not include this module's child keys.
Learn more or explore other endpoints: stock modules