Morning Topic Brief is a small Python script that builds a daily news digest. Every morning it runs one search per topic over the last 24 hours across the web, X, Reddit and Hacker News, and turns the answers into one Markdown digest with cited links. It can also send the digest to a Telegram chat.
The problem
Following a few topics means checking news sites, X, Reddit and Hacker News every morning. Feeds are noisy and summaries without sources are hard to trust. A short digest with a link behind every line saves that time.
What the app does
- Reads your topics from
topics.yaml. - Runs one AI Search per topic over the last 24 hours.
- Turns numbered citations into real links and removes duplicates.
- Checks each result's own date and tags older or undated sources.
- Writes the digest to a file, prints it and can post it to Telegram.
How it works
- Search.
POST /desearch/ai/searchwithtools: ["web", "twitter", "reddit", "hackernews"]and a short system message for a cited bullet digest. - Link citations to the result lists.
- Check dates on each result.
- Write and send the digest, with the total cost from the response headers.
The code
def call_http(payload: dict, api_key: str, timeout: int) -> dict:
"""Plain HTTP call. Returns status, headers, body, latency."""
t0 = time.perf_counter()
r = requests.post(API_URL, json=payload, timeout=timeout,
headers={"Authorization": api_key, "Content-Type": "application/json"})
latency = time.perf_counter() - t0
try:
body = r.json()
except ValueError:
body = r.text
return {"status": r.status_code, "headers": dict(r.headers), "body": body, "latency_s": round(latency, 2)}
The folder has one script, brief.py, an example topics.yaml and a sample digest in sample-output.md.
Endpoints
POST /desearch/ai/search
Example output
A 3-topic brief made 3 calls. Each call returned 10 billed units and cost $0.004, so the digest cost $0.012. Each topic gets a few bullets, each bullet with its source links, and older or undated sources are tagged.
Run it yourself
The public examples folder linked above includes the script and a README. Install its requirements, set DESEARCH_API_KEY from console.desearch.ai, and use the run command in that README.
Optional: set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID to post the digest to a chat. Edit topics.yaml to change topics.
What it costs
Every call returned X-Desearch-Cost-Usd: 0.004, so a 3-topic brief cost $0.012 per run. See pricing.
Ideas to extend it
- Run it with cron every morning.
- Send it to Slack or email instead of Telegram.
- Add a weekly roll-up of the daily digests.
