--- name: citoapi-builder description: Use when building apps, bots, dashboards, automations, or backend integrations with CitoAPI esports/data endpoints. Fetches live endpoint docs before coding so integrations use current endpoints instead of stale installed instructions. --- # CitoAPI Builder Skill Use this skill when a developer asks an AI agent to build with CitoAPI. ## Always Fetch Current Docs First Before choosing endpoints or writing code, fetch one of these raw references: - https://citoapi.com/ai/endpoints - https://citoapi.com/ai/endpoints.json - https://citoapi.com/llms-full.txt The endpoint catalog is generated from CitoAPI's frontend endpoint registry during deploy. Do not rely only on this installed skill for endpoint names. ## Product Psychology Developers convert when they feel speed, certainty, and control. - Speed: get them to one successful request as fast as possible. - Certainty: use exact endpoint paths, auth headers, IDs, and fallback search routes. - Control: keep keys server-side, show clear errors, and avoid hidden magic. - Momentum: give a minimal working implementation first, then add optional enhancements. Do not write vague API advice. Give the request, code, expected response shape, and next endpoint. ## Integration Rules 1. Ask what they are building only if it is unclear. Otherwise infer the use case and start. 2. Fetch the current endpoint manifest. 3. Choose the smallest endpoint chain that solves the job. 4. Use https://api.citoapi.com/api/v1 as the API base URL. 5. Authenticate with `X-API-Key: process.env.CITO_API_KEY` or `Authorization: Bearer process.env.CITO_API_KEY`. 6. Never put a CitoAPI key in browser-visible code. 7. If a user provides a team/player name, call search/autocomplete endpoints before detail endpoints. 8. If an endpoint returns no live data, show an empty state and fallback to upcoming/recent/history endpoints. 9. If using webhooks, confirm the user has paid-plan webhook access and still include REST fallback logic. 10. Do not invent endpoints. If not in the fetched manifest, say which closest endpoint should be used. ## Coverage Current endpoint families include: League of Legends, Call of Duty, Apex Legends, Dota 2, UFC, Fortnite, QR Code, TikTok, Search. ## Common Build Flows League of Legends live match center: 1. `GET /api/v1/lol/live` 2. `GET /api/v1/lol/live/{matchId}/series` 3. `GET /api/v1/lol/games/{gameId}/stats` 4. Paid production apps can inspect `GET /api/v1/lol/webhooks/events` Call of Duty League player stats: 1. `GET /api/v1/cod/matches/upcoming` or `GET /api/v1/cod/matches/recent` 2. `GET /api/v1/cod/matches/{id}/player-stats?includeMaps=true` 3. Use `GET /api/v1/cod/search?q={query}` when IDs are unknown Fortnite esports/creative: 1. Use leaderboard, tournament, org, player, or creative map endpoints from the fetched manifest. 2. For org/player pages, prefer search/list endpoints first, then detail/earnings/history endpoints. Dota 2 analytics: 1. `GET /api/v1/dota2/matches/live`, `/upcoming`, or `/recent` 2. `GET /api/v1/dota2/matches/{matchId}/games` 3. `GET /api/v1/dota2/matches/{matchId}/player-stats` 4. Use player/team radar endpoints for premium dashboards. UFC fighter/event data: 1. `GET /api/v1/ufc/search?q={query}` 2. `GET /api/v1/ufc/fighters/{slug}/stats` 3. `GET /api/v1/ufc/events/{eventIdOrSlug}/stats` 4. `GET /api/v1/ufc/bouts/{boutId}/stats?round=1` ## Output Style For Agents When answering a developer: - Start with "Use these endpoints" and list the exact chain. - Provide copy-paste code in their framework. - Include env var setup: `CITO_API_KEY=...`. - Include safe server-side placement. - Include one failure-proofing note: empty live state, unknown ID search, rate limit, or webhook fallback. - End with the fastest next action: create a free key or run the first request.