<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/triage-a-watchlist-in-async-python-on-a-free-api-key-sgylvyjwp" -->

---
title: Triage a watchlist in async Python on a free API key
description: A compact async Python script fans out three concurrent API calls per stock ticker (news sentiment lean, insider buy/sell activity, and confirmed earnings...
canonical: https://daily.dev/posts/triage-a-watchlist-in-async-python-on-a-free-api-key-sgylvyjwp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Triage a watchlist in async Python on a free API key | daily.dev
og:description: A compact async Python script fans out three concurrent API calls per stock ticker (news sentiment lean, insider buy/sell activity, and confirmed earnings...
og:url: https://daily.dev/posts/triage-a-watchlist-in-async-python-on-a-free-api-key-sgylvyjwp
og:image: https://api.daily.dev/og/posts/sgylVYJwP.png
og:image:alt: Triage a watchlist in async Python on a free API key
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Triage a watchlist in async Python on a free API key

**[AlphAI](https://daily.dev/sources/alphai)** · [@mikhailmakeev](https://daily.dev/mikhailmakeev) · 2 min read · 0 upvotes · 0 comments

## Summary

A compact async Python script fans out three concurrent API calls per stock ticker (news sentiment lean, insider buy/sell activity, and confirmed earnings date) using an SDK's free-tier news API. The code uses asyncio.gather for concurrency, Pydantic models for typed responses, and the client itself handles rate-limit backoff and exposes remaining daily quota. A sample run across five semiconductor tickers is shown, along with a sync client snippet for paging recent headlines. Ends by inviting readers to suggest a fourth triage question.

## Content

Here's a small script: give it a watchlist and it answers three questions per name. How did the last week of news coverage lean, did insiders buy or sell this month, and is an earnings date confirmed. It runs on the free tier of our news API (20 calls a minute, 100 a day, no card) and costs three calls per ticker.

```bash
pip install alphai-sdk
export ALPHAI_API_KEY=ak_live_...
```

The core is one async fan-out: every question for every ticker goes out at once.

```python
import asyncio
from alphai import AsyncClient

async def triage(client, ticker):
    return ticker, *await asyncio.gather(
        client.symbols.sentiment_summary(ticker),
        client.symbols.insider_summary(ticker),
        client.symbols.earnings(ticker),
    )

async def run(tickers):
    async with AsyncClient() as client:
        return await asyncio.gather(*(triage(client, t) for t in tickers))

rows = asyncio.run(run(["NVDA", "AMD", "TSM", "AVGO", "MU"]))
```

Each answer is a typed Pydantic model, so fields like `insider.sell_count` autocomplete and money arrives as Decimal. An unconfirmed report date comes back as None instead of an estimate. The full script sorts by how far coverage leans, and a real run printed this:

```text
ticker  7d calls   lean  30d buy/sell  next report
MU           104  -0.32      0/28      2026-09-30
NVDA         354  +0.20      0/17      2026-11-17
AVGO          92  +0.18      0/0       2026-12-09
TSM           76  +0.11     34/0       -
AMD          114  +0.02      0/66      -
```

Want the latest headlines next to each row? The sync client pages the feed for you:

```python
from alphai import Client

client = Client()
for article in client.news.iter(symbol="MU", max_items=3):
    print(article.relevance_score, article.title)
```

Two things the client handles so the script doesn't have to. If you trip the per-minute limit it waits out the server's Retry-After and carries on, and `print(client.last_rate_limit)` shows how much of the day's budget is left.

What would you add as a fourth question per ticker?

The full script, typed and commented: https://github.com/makeev/alphai-sdk/blob/main/examples/watchlist_triage.py

## Similar posts on daily.dev

- [Fetch and Process Live Market Quotes Using Financial APIs in Python](https://daily.dev/posts/fetch-and-process-live-market-quotes-using-financial-apis-in-python-jqcfznbeo) · Medium · 0 upvotes · 0 comments
- [How to Choose the Best Stock Market API for FinTech Projects and AI Agents](https://daily.dev/posts/how-to-choose-the-best-stock-market-api-for-fintech-projects-and-ai-agents-leqiusjir) · freeCodeCamp · 3 upvotes · 0 comments
- [PyCoder’s Weekly](https://daily.dev/posts/pycoder-s-weekly-j75gyjcw2) · Planet Python · 1 upvotes · 0 comments
- [How to Combine Fundamentals, Sentiment, and Price Into One Backtest \(Python\)](https://daily.dev/posts/how-to-combine-fundamentals-sentiment-and-price-into-one-backtest-python--2a0ntcwwg) · Medium · 0 upvotes · 0 comments
- [How to Find Stock-Specific Moves in the S&P 500 with Python](https://daily.dev/posts/how-to-find-stock-specific-moves-in-the-s-p-500-with-python-mw3ndcxuj) · freeCodeCamp · 7 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#fintech](https://daily.dev/tags/fintech), [#pydantic](https://daily.dev/tags/pydantic)

[View this post on daily.dev](https://daily.dev/posts/triage-a-watchlist-in-async-python-on-a-free-api-key-sgylvyjwp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/triage-a-watchlist-in-async-python-on-a-free-api-key-sgylvyjwp","headline":"Triage a watchlist in async Python on a free API key","text":"A compact async Python script fans out three concurrent API calls per stock ticker (news sentiment lean, insider buy/sell activity, and confirmed earnings date) using an SDK's free-tier news API. The code uses asyncio.gather for concurrency, Pydantic models for typed responses, and the client itself handles rate-limit backoff and exposes remaining daily quota. A sample run across five semiconductor tickers is shown, along with a sync client snippet for paging recent headlines. Ends by inviting readers to suggest a fourth triage question.","url":"https://daily.dev/posts/triage-a-watchlist-in-async-python-on-a-free-api-key-sgylvyjwp","datePublished":"2026-09-17T04:24:29.521Z","dateModified":"2026-09-17T04:32:22.944Z","author":{"@type":"Person","name":"Mikhail Makeev","url":"https://daily.dev/mikhailmakeev","image":"https://lh3.googleusercontent.com/a/ACg8ocIjcvDU1gmJ9-KJDeTYqY2rMdl5QxcWYtLTGSXrj8ubF4nwar_w=s96-c","description":"Owner of alphai.io","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":5400}},"image":"https://media.daily.dev/image/upload/s--zSdtGn3w--/f_auto/v1789619069/posts/sgylVYJwP?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/alphai","name":"AlphAI"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AlphAI","item":"https://daily.dev/squads/alphai"},{"@type":"ListItem","position":3,"name":"Triage a watchlist in async Python on a free API key"}]}
```

