A Next.js web application that fetches and analyzes Dota 2 hero pool data for 5 players using the OpenDota API.
- Fetch hero statistics for up to 5 players simultaneously
- Display hero pools with detailed statistics (games played, wins, win rate)
- Filter heroes based on criteria:
- Minimum 5 games played
- Played within the last 6 months
- Modern, responsive UI with Tailwind CSS
- Real-time data from OpenDota API
- Framework: Next.js 14 with App Router
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS
- API: OpenDota API (no key required)
- HTTP Client: Axios with retry logic
- Validation: Zod
- Node.js 18.x or higher
- npm or yarn
- Clone the repository:
cd dota2HeroPick- Install dependencies:
npm install- Create environment file:
cp .env.example .env.localThe .env.local file should contain:
OPENDOTA_API_URL=https://api.opendota.com/api
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm start- Enter 5 SteamID64 values (17 digits starting with 7656119)
- Click "Analyze Hero Pools" to fetch data
- View each player's hero statistics and win rates
Try these professional player Steam IDs:
- 76561198047011640 (Miracle-)
- 76561198131932277 (Arteezy)
- 76561198091935823 (s4)
- 76561198033560957 (Dendi)
- 76561198053867390 (Puppey)
├── app/
│ ├── api/
│ │ └── hero-pools/ # API endpoints
│ ├── components/ # React components
│ ├── page.tsx # Main page
│ ├── layout.tsx # Root layout
│ └── globals.css # Global styles
├── lib/
│ ├── types/ # TypeScript types
│ ├── services/ # API services
│ ├── utils/ # Utility functions
│ └── core/ # Business logic
└── public/ # Static assets
Fetches hero pools for 5 players.
Request Body:
{
"steamIds": [
"76561198047011640",
"76561198131932277",
"76561198091935823",
"76561198033560957",
"76561198053867390"
]
}Response:
{
"success": true,
"data": [
{
"success": true,
"steamId": "76561198047011640",
"data": {
"playerId": 86745912,
"steamId64": "76561198047011640",
"heroes": [...],
"totalGames": 8234,
"lastUpdated": "2025-01-26T..."
}
}
]
}- OpenDota API rate limit: 60 requests per minute
- Private profiles return empty hero data
- Recent games filter is hardcoded to 6 months
- Only supports SteamID64 format input
- Phase 2: Hero selection algorithm
- Analyze 5 hero pools together
- Recommend best team composition
- Consider win rates, roles, synergies, and counters
- Support more Steam ID formats
- Configurable filters (time window, min games)
- Hero images/icons
- Dark mode toggle
- Export results
MIT
- Data provided by OpenDota API
- Built with Next.js