Net share purchase activity for one company is a single object, and you store the keys that object prints once the module label matches.
Request module=net-share-purchase-activity from GET https://api.mboum.com/v1/markets/stock/modules. A Bearer token from Get your API key goes on the Authorization header. Parameter details are in the stock modules docs.
Request the activity summary
Send ticker=AAPL. symbol works in place of ticker. Leave timeframe off. The modules that read it are income-statement-v2, balance-sheet-v2, cashflow-statement-v2, and ratios.
Fill the object from a live body
The printed summary is the artifact: symbol, module label, and keys. The sample body is empty, so the key list stays empty until a live object supplies names.
import requests
url = "https://api.mboum.com/v1/markets/stock/modules"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {"ticker": "AAPL", "module": "net-share-purchase-activity"}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
payload = response.json()
if payload.get("success") is False:
raise SystemExit(payload.get("message"))
meta = payload["meta"]
if meta.get("modules") != "net-share-purchase-activity":
raise SystemExit(meta.get("modules"))
body = payload["body"]
if isinstance(body, dict):
keys = sorted(body.keys())
elif isinstance(body, list) and body and isinstance(body[0], dict):
keys = sorted(body[0].keys())
else:
keys = []
summary = {"symbol": meta["symbol"], "module": meta["modules"], "keys": keys}
print(summary)
{
"meta": {
"symbol": "AAPL",
"modules": "net-share-purchase-activity"
},
"body": {}
}