Official TypeScript SDK and multi-language integration patterns for FieldFunded API
FieldFunded is built on standard REST/JSON architecture, making it compatible with every modern programming language.
No SDK account required. You only need your API Key (X-API-Key or X-RapidAPI-Key) to start building. The SDKs and code examples below are tools to help you use your key more efficiently.
// All live soccer in Englandconst events = await client.getEvents({ sport: 'soccer', country: 'england', status: 'live',});// Games starting in the next 2 hoursconst upcoming = await client.getEvents({ starts_within: '2h', sport: 'basketball',});// Events on a specific dateconst tomorrow = await client.getEvents({ date: '2026-04-16', league: 'premier-league',});// American odds formatconst american = await client.getEvents({ sport: 'soccer', odds_format: 'american',});
Event Detail
const detail = await client.getEvent('12345678');console.log(detail.markets); // Full markets array (1,000+ on major events)console.log(detail.scoreboard); // Period/set/map scoresconsole.log(detail.sport_data); // Serving indicators, power play, etc.
Live Scores (lightweight polling)
// Optimized endpoint — use for frequent polling (every 5-10s)const scores = await client.getScores({ sport: 'soccer' });for (const game of scores.scores) { console.log(`${game.home_team} ${game.score.home}-${game.score.away} ${game.away_team}`);}
Search by Team Name
const results = await client.search('Barcelona', { limit: 5 });console.log(results.events); // All upcoming/live Barcelona games
Batch Events (max 20 IDs)
const batch = await client.getEventsBatch(['123', '456', '789']);console.log(batch.events); // Record<id, EventDetail>console.log(batch.found); // Number of events found (e.g. 2)console.log(batch.requested); // Number of IDs you sent (e.g. 3)
Settlement is fully automatic. Markets resolve without developer intervention as soon as a game ends. Poll getSettlements() regularly after the game ends to capture all market resolutions as they arrive gradually.
// Check settlements every 60 secondsconst settlements = await client.getSettlements({ limit: 10 });for (const s of settlements.settlements) { console.log(`${s.event_id}: ${s.settlement_status} — ${s.resolved_markets_count}/${s.total_markets_count ?? '?'} markets (${s.pending_markets_count ?? '?'} pending)`);}// Get official result for a specific event (score-only)const result = await client.getEventResult('12345678');console.log(`Status: ${result.status}`); // 'ended', 'walkover', 'retired', etc.if (result.score) { console.log(`Final Score: ${result.score.home}-${result.score.away}`);}// For market-level resolutions, use getSettlements()const eventSettlements = await client.getSettlements({ event_id: '12345678' });// Outright/futures settlements (also automatic)const outrightSettlements = await client.getOutrightSettlements({ sport: 'soccer' });
Outrights / Futures
// List tournaments with outright marketsconst outrights = await client.getOutrights({ sport_id: '124' });// Get selections and odds (supports odds_format)const detail = await client.getOutright('12345', { odds_format: 'american' });console.log(detail.events[0].markets[0].selections[0].odds);
These endpoints do not count against your monthly quota.
const ping = await client.ping(); // { pong: true, timestamp: 1234567890 }const health = await client.health(); // System health, data freshnessconst status = await client.status(); // Live/prematch counts
Error Handling
The SDK provides typed error classes for clean error handling:
import { FieldFundedSDK, RateLimitError, AuthenticationError, NotFoundError, BadRequestError, ServiceUnavailableError,} from '@fieldfunded/sdk';try { const events = await client.getEvents();} catch (err) { if (err instanceof RateLimitError) { console.log(`Rate limited. Retry in ${err.retryAfter}s`); } else if (err instanceof ServiceUnavailableError) { console.log(`Service degraded (${err.component}). Retry in ${err.retryAfter}s`); } else if (err instanceof AuthenticationError) { console.log('Invalid API key'); } else if (err instanceof NotFoundError) { console.log('Event not found'); } else if (err instanceof BadRequestError) { console.log(`Invalid request: ${err.message}`); }}
All Methods
Method
Endpoint
Description
ping()
GET /v1/ping
Latency check (quota-free)
health()
GET /v1/health
System health (quota-free)
status()
GET /v1/status
API status (quota-free)
getUsage()
GET /v1/usage
Quota & consumption stats
getUsageEndpoints()
GET /v1/usage/endpoints
Per-endpoint breakdown
getUsageWarnings()
GET /v1/usage/warnings
Active quota warnings
getSports()
GET /v1/sports
List sports
getLeagues(opts?)
GET /v1/leagues
List leagues with slugs
getMarkets(opts?)
GET /v1/markets
List market types
getEvents(opts?)
GET /v1/events
List events (all filters)
getLive(opts?)
GET /v1/live
Live events
getFeatured(opts?)
GET /v1/featured
Featured games
getScores(opts?)
GET /v1/scores
Live scores
search(q, opts?)
GET /v1/search
Search by team/league
getEvent(id, opts?)
GET /v1/events/{id}
Event detail
getEventOdds(id, opts?)
GET /v1/events/{id}/odds
Event odds
getEventResult(id)
GET /v1/events/{id}/result
Score result
getEventsBatch(ids, opts?)
POST /v1/events/batch
Multiple events (max 20)
checkBet(req)
POST /v1/bets/check
Single bet check
checkParlay(req)
POST /v1/bets/check-parlay
Parlay check
getSettlements(opts?)
GET /v1/settlements
Settlement feed
getOutrightSettlements(opts?)
GET /v1/settlements/outrights
Outright settlements
getOutrights(opts?)
GET /v1/outrights
Outright markets
getOutrightSports()
GET /v1/outrights/sports
Outright sports
getOutright(id, opts?)
GET /v1/outrights/{id}
Specific outright with odds
Manual Integration (Universal)
If you are using a language without an official SDK yet, use standard HTTP libraries. Our API is standard REST/JSON — any language with HTTP support works.