An unofficial JavaScript/TypeScript client for fetching contest and user data from AtCoder.
- Fetch upcoming and recent contests
- Get detailed user profiles and statistics
- Retrieve user contest participation history
- Built-in rate limiting to avoid server overload
- Caching for better performance
- Full TypeScript support
npm install @qatadaazzeh/atcoder-api
import { fetchUpcomingContests, fetchRecentContests } from '@qatadaazzeh/atcoder-api';
// Get upcoming contests
const upcoming = await fetchUpcomingContests();
console.log(`Found ${upcoming.length} upcoming contests`);
// Get recent contests
const recent = await fetchRecentContests();
console.log(`Found ${recent.length} recent contests`);
import { fetchUserInfo } from '@qatadaazzeh/atcoder-api';
// Get user profile
const user = await fetchUserInfo('tourist');
console.log(`${user.userName} has a rating of ${user.userRating}`);
// Access contest history
console.log(`Participated in ${user.userContests.length} contests`);
import { fetchUserContestList } from '@qatadaazzeh/atcoder-api';
// Get contest participation history for a user
const contestHistory = await fetchUserContestList('tourist');
// Find contests where the user's performance was above 3000
const highPerformance = contestHistory.filter(c => c.userPerformance > 3000);
console.log(`${highPerformance.length} contests with performance > 3000`);
-
fetchContestList(type?: 'upcoming' | 'recent')
: Fetch a list of contests -
fetchUpcomingContests()
: Fetch upcoming contests -
fetchRecentContests()
: Fetch recent contests
-
fetchUserInfo(userId: string)
: Get detailed user information -
fetchUserContestList(userId: string)
: Get user's contest participation history
The library exports the following TypeScript types:
-
Contest
: Contest information -
User
: User profile information -
UserContest
: User's contest participation details
Contributions are welcome! Please feel free to submit a Pull Request.
MIT