3.3 KiB
3.3 KiB
๐ ESPN Integration Complete!
What Was Added
โ Full ESPN Sports API Integration - No API key required!
Supported Sports (16+ leagues!)
-
American Football
- NFL (all teams)
- College Football (all conferences)
-
Basketball
- NBA
- WNBA
- Men's College Basketball
- Women's College Basketball
-
Baseball
- MLB
- College Baseball
-
Hockey
- NHL
-
Soccer (8 major leagues)
- English Premier League
- La Liga
- Bundesliga
- Serie A
- Ligue 1
- MLS
- Champions League
- World Cup
New Files Created
- โ
lib/oracle/espn.ts- ESPN API integration - โ
SPORTS_POLLS_GUIDE.md- Complete documentation - โ
Updated
lib/oracle/index.ts- Added ESPN to verification system - โ
Updated
types/index.ts- Added ESPN verification type - โ
Updated
database/schema.sql- Added ESPN to verification types
How It Works
1. Create Sports Poll
const poll = await createPoll({
question: 'Chiefs vs Bills - Who wins?',
verificationType: 'espn',
verificationConfig: {
sport: 'football/nfl',
homeTeam: 'Kansas City Chiefs',
awayTeam: 'Buffalo Bills',
},
// ... rest of poll config
})
2. Automatic Verification
- Cron runs hourly
- Fetches game result from ESPN
- Determines winner automatically
- No manual intervention needed!
3. Automatic Distribution
- Winners get paid automatically
- Proportional payouts
- All tracked in database
Example Polls
NFL Game
{
question: 'Super Bowl - Who wins?',
sport: 'football/nfl',
homeTeam: 'Kansas City Chiefs',
awayTeam: 'San Francisco 49ers',
}
NBA Over/Under
{
question: 'Lakers vs Warriors - Over/Under 220?',
sport: 'basketball/nba',
homeTeam: 'Los Angeles Lakers',
awayTeam: 'Golden State Warriors',
comparisonType: 'over_under',
targetScore: 220,
}
Soccer Match
{
question: 'Man City vs Liverpool - Winner?',
sport: 'soccer',
league: 'eng.1',
homeTeam: 'Manchester City',
awayTeam: 'Liverpool',
}
Features
โ Automatic Score Fetching - ESPN updates in real-time โ No API Key Required - Free to use โ 16+ Leagues Supported - Football, basketball, baseball, hockey, soccer โ Multiple Bet Types:
- Winner prediction
- Over/Under
- Draw/No draw
- Exact scores โ Team Name Matching - Flexible team name recognition โ Game ID Support - Use specific ESPN game IDs โ Error Handling - Retries if game not completed
Complete Oracle System
Your PollCelo now has 5 verification methods:
- โ Chainlink - Crypto prices (BTC, ETH, CELO)
- โ Curve Finance - DeFi token prices
- โ DexScreener - DEX pair prices
- โ External API - Any REST API (weather, forex, etc.)
- โ ESPN - Sports scores (16+ leagues) ๐
Ready to Use
Everything is integrated and ready:
- Database schema updated
- Types updated
- Cron jobs will handle ESPN polls
- Full documentation included
Next Steps
- Deploy to production
- Create your first sports poll
- Watch it verify and distribute automatically!
See SPORTS_POLLS_GUIDE.md for detailed examples and best practices.
PollCelo now supports the most popular sports betting markets! ๐๐โพ๐โฝ