import json
landscape = {
"generated_at": "2026-04-17",
"value_chain": [],
"market_forces": [],
}
for theme in value_chain["data"]:
detail = client.themes.get("value_chain", theme["label"])
top_entities = client.entities.list(theme=theme["label"], sort="signal_count", limit=5)
landscape["value_chain"].append({
"theme": theme["label"],
"direction": theme["direction"],
"notability": theme["notability"],
"share_of_voice": theme["trend"]["share_of_voice"],
"slope": theme["trend"]["theil_sen_slope"],
"top_entities": [e["display_name"] for e in top_entities["data"]],
"driven_by": [r["label"] for r in detail.get("related_themes", [])[:3]],
})
for theme in market_force["data"]:
detail = client.themes.get("market_force", theme["label"])
top_entities = client.entities.list(theme=theme["label"], sort="signal_count", limit=5)
landscape["market_forces"].append({
"theme": theme["label"],
"direction": theme["direction"],
"notability": theme["notability"],
"share_of_voice": theme["trend"]["share_of_voice"],
"slope": theme["trend"]["theil_sen_slope"],
"top_entities": [e["display_name"] for e in top_entities["data"]],
"driven_by": [r["label"] for r in detail.get("related_themes", [])[:3]],
})
# Output as JSON for downstream use (slides, dashboards, agent context)
print(json.dumps(landscape, indent=2))