Widget Data APIs
Endpoints that feed Tier 2 hybrid components with live data.
Tier 2 smart components render on the client but fetch their data from the agent. Each component maps to one endpoint. The agent owns the API keys and upstream calls, so widgets stay simple.
Live data
GET /api/widget/weatherendpointPowers live_weather. Query a city; returns current conditions + hourly forecast.
curl "http://127.0.0.1:8000/api/widget/weather?city=Tokyo"GET /api/widget/stockendpointPowers live_stock. Query a symbol; returns price series for the sparkline.
curl "http://127.0.0.1:8000/api/widget/stock?symbol=AAPL"GET /api/widget/exchange_ratesendpointPowers currency_converter. Returns live rates against a base currency.
GET /api/widget/newsendpointPowers news_ticker. Returns headlines (optionally by topic). Requires NEWS_API_KEY.
On-demand lookups
GET /api/widget/wikiendpointPowers wiki_summary. Returns a Wikipedia article summary card.
GET /api/widget/wordendpointPowers dictionary. Returns definitions + phonetics for a word.
POST /api/widget/translateendpointPowers translator. Translates text between languages.
GET /api/widget/rssendpointPowers rss_reader. Fetches and parses an RSS feed into headline cards.
GET /api/widget/astronomyendpointPowers astronomy. Returns NASA's Astronomy Picture of the Day + live ISS position.
GET /api/sportsendpointPowers live_sports. Returns live/recent scores for a sport
(soccer | basketball | american_football | cricket).
GET /api/recipeendpointPowers recipe_viewer. Returns a step-by-step recipe (search or random).
Because the agent fronts these APIs, the LLM should emit the Tier 2 component (e.g.
live_weather) rather than JIT code for weather/stock/news/translate/define queries — the
widget calls the endpoint itself and renders beautifully with zero generated code.