socialcrawl/
← All recipes

Compare prediction markets with the conversation

Put Polymarket odds next to what people are actually saying about the same topic.

Python
import os, requests

H = {"x-api-key": os.environ["SOCIALCRAWL_API_KEY"]}

markets = requests.get("http://datatrend.nl/v1/polymarket/markets", headers=H).json()["data"]["items"]
top = markets[0]
print("Market:", top["question"])
for o in top["outcomes"]:
    print(f'  {o["outcome"]:10} {o["price"]:.0%}')

chatter = requests.get(
    "http://datatrend.nl/v1/bluesky/search",
    params={"query": top["question"][:40]}, headers=H,
).json()["data"]["items"]
print(f"\n{len(chatter)} posts discussing it right now")
You'll need a key. It takes ten seconds and starts with 100 credits. Get a key