Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.fieldfunded.com/llms.txt

Use this file to discover all available pages before exploring further.

1. Get Your API Key

ModeBase URL
RapidAPIhttps://fieldfunded-sports-api.p.rapidapi.com/v1
Directhttps://api.fieldfunded.com/v1
Header names are case-insensitive (x-rapidapi-key works), but we recommend the canonical casing above.

2. Your First Request

curl -s "https://api.fieldfunded.com/v1/sports" \
  -H "X-API-Key: YOUR_API_KEY" | jq

Response Format

All responses are JSON. Successful responses return the data directly:
{
    "events": [...],
    "total": 142,
    "limit": 50,
    "offset": 0
}
Error responses use a consistent schema:
{
    "error": "error_code",
    "message": "Human-readable explanation"
}

3. Official TypeScript SDK

The fastest way to integrate. Handles authentication, retries, and provides full type safety for all 1,000+ markets.
npm install @fieldfunded/sdk
import { FieldFundedSDK } from '@fieldfunded/sdk';

// RapidAPI mode (default)
const client = new FieldFundedSDK({
  apiKey: 'YOUR_RAPIDAPI_KEY',
});

// Direct API mode
const client = new FieldFundedSDK({
  apiKey: 'YOUR_API_KEY',
  baseUrl: 'https://api.fieldfunded.com/v1',
});

// Get all live games
const live = await client.getLive();
console.log(`${live.total} live games`);

// Get full event details (1,000+ markets)
const event = await client.getEvent(live.events[0].id);
console.log(`${event.home_team} vs ${event.away_team}`);
console.log(`Markets: ${event.markets.length}`);

Full SDK Documentation →

25 typed methods, error classes, configuration options, and all usage examples.

4. Common Patterns

Poll Live Scores (lightweight)

# Small payload — poll every 5-10 seconds
curl -s "https://api.fieldfunded.com/v1/scores?sport=soccer" \
  -H "X-API-Key: YOUR_API_KEY"

Search by Team Name

curl -s "https://api.fieldfunded.com/v1/search?q=Arsenal" \
  -H "X-API-Key: YOUR_API_KEY"

Batch Fetch Multiple Events

curl -s -X POST "https://api.fieldfunded.com/v1/events/batch" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["EVENT_ID_1", "EVENT_ID_2", "EVENT_ID_3"]}'

Auto-Settle Bets

# Poll every 60 seconds via setInterval or a scheduled task
curl -s "https://api.fieldfunded.com/v1/settlements" \
  -H "X-API-Key: YOUR_API_KEY"

5. Integration Flow

Simple Integration

1. GET /v1/sports          → Discover available sports
2. GET /v1/events          → List events (filter by sport, status, league)
3. GET /v1/events/{id}     → Get full market depth for a specific event
4. GET /v1/scores          → Poll live scores (lightweight, every 5-10s)
5. GET /v1/settlements     → Auto-settle bets (poll every 60s)

White-Label Sportsbook

1. GET /v1/events?status=prematch   → Populate your event listing
2. GET /v1/live                     → Discover live events
3. GET /v1/events/{id}              → Full odds for user's selected event
4. POST /v1/bets/check              → Resolve individual bets
5. POST /v1/bets/check-parlay       → Resolve multi-leg parlays
6. GET /v1/settlements              → Batch-settle all ended events (every 60s)

6. How to Integrate Bets — Complete Flow

This is the most important section for sportsbook integrators.

Step 1 — Show odds to your user

Your frontend calls GET /v1/events/{id} and displays markets + odds.

Step 2 — User places a bet

When your user clicks “Place Bet”, save to your database:
FieldSourcePriority
event_idFrom the eventRequired
market_idFrom markets arrayPrimary — 100% accuracy
selection_idFrom outcomes arrayPrimary — 100% accuracy
markete.g. "Match Winner"Secondary — display only
outcomee.g. "Home"Secondary — display only
oddsDecimal odds at placement timeRequired
stakeUser’s wager amountYour business logic
Always store the odds at placement time. Odds change constantly — the API does not track what odds a user saw.
market_id is the primary identification method. It is consistent across all fixtures within the same sport — e.g. market_id: 36 always means “1X2 (Match Winner)” in every soccer match. You can hard-code market ID mappings per sport for reliable settlement logic.

Step 3 — Check the result

After the game ends, call POST /v1/bets/check with the data you stored:
curl -X POST "https://api.fieldfunded.com/v1/bets/check" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "selections": [{
      "event_id": "12345",
      "market": "Match Winner",
      "outcome": "Home",
      "odds": 1.85,
      "stake": 10,
      "market_id": 340168,
      "selection_id": 1824650
    }]
  }'
Response
{
  "results": [{
    "event_id": "12345",
    "result": "won",
    "payout_multiplier": 1.85,
    "stake": 10,
    "payout": 18.50
  }]
}

Step 4 — Credit the user

ResultActionPayout
wonCredit payout to user’s balancestake × odds
lostNo action (stake already deducted)0
refundReturn original stake to userstake × 1.0
pendingGame not finished yet — check again later
For parlays, use POST /v1/bets/check-parlay with stake and legs[]. The API calculates combined_odds and payout automatically.
Currency-agnostic: The stake and payout fields work with any currency. Send a numeric amount in whatever unit your platform uses (USD, EUR, BTC, points, etc.). No currency conversion is applied.
For production, use GET /v1/settlements (polled every 60s) as your primary settlement engine and /bets/check for on-demand verification.

Cross-Sport Market ID Consistency

market_id values are consistent across all fixtures within the same sport:
Marketmarket_idSelectionsConsistency
1X2 (Match Winner)36Home / Draw / AwayFixed across all soccer
Total (Over/Under)24Over 0.5, 1.5, 2.5…Fixed; specifier varies
Asian Handicap128Home (-0.5), Away (+0.5)…Fixed; specifier varies
Both Teams to Score121Yes / NoFixed across all soccer
Correct Score1470:0, 1:0, 2:1…Fixed across all soccer
Example: market_id: 36 maps to 1X2 in every soccer match — whether it’s Hamburger SV vs. FC Union Berlin (2. Bundesliga) or Corinthians vs. CA Peñarol (Copa Sudamericana).

7. Settlement Feed Notes

Poll regularly after the game ends to capture all market resolutions as they arrive gradually. Always process settlements promptly.
  • An event appears in /v1/settlements as soon as the first market resolves, not only when all markets are done
  • resolved_markets_count grows over time; pending_markets_count reaches 0 when all markets are finalized
  • Core markets settle within seconds; niche markets resolve gradually over minutes
  • Coverage includes standard markets, player-prop markets, and dynamic live markets

Payload Modes

/v1/bets/check supports:
  • Batch: { "selections": [...] }
  • Single: { "selection": {...} }
  • Shortcut: { "event_id": "...", "market": "...", "outcome": "...", "odds": 1.85 }
/v1/bets/check-parlay supports:
  • Single: { "legs": [...], "stake": 10 }
  • Batch: { "parlays": [{ "parlay_id": "p1", "legs": [...], "stake": 10 }] }
Poll /v1/settlements every 60s
For each game:
  if settlement_status == "settled" → process resolved_markets
  Check pending_markets_count — when it reaches 0, all markets are settled (or compare resolved_markets_count == total_markets_count)

For individual events:
  GET /v1/events/{id}/result
  if status == "ended" → event finalised (fetch outcomes from /settlements)

8. Error Handling

StatusError CodeMeaningAction
400bad_requestInvalid parametersFix your request
401unauthorizedMissing/invalid API keyCheck your key
404not_foundEvent doesn’t existUse /v1/events to find valid IDs
429rate_limitedToo many requestsWait Retry-After seconds
503service_unavailableBackend temporarily downWait Retry-After seconds
When a backend service is temporarily unavailable, the response includes which component is affected:
{
    "error": "service_unavailable",
    "message": "Data store temporarily unavailable",
    "component": "redis"
}
ComponentAffectsTypical Recovery
redisLive odds, scores, event data10-60 seconds
supabaseSettlements, historical data30-120 seconds

9. Odds Formats

All endpoints that return odds support ?odds_format=:
# European format — 2.50
curl "https://api.fieldfunded.com/v1/events?odds_format=decimal" \
  -H "X-API-Key: YOUR_API_KEY"
Supported on: /events, /live, /featured, /search, /events/{id}, /events/{id}/odds, /events/batch, /outrights/{id}.

10. Rate Limit Headers

Every response includes:
HeaderDescription
X-RateLimit-LimitYour monthly quota
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when quota resets
X-RateLimit-Warning⚠️ Appears at 50%, 80%, 95% usage
Monitoring endpoints (/ping, /health, /status) do not count against your monthly quota. They have their own fixed rate limits: 2 req/s and 120 req/h, equal for all plans.

Next Steps

Browse Sports

See all 30+ available sports

Live Events

Get real-time live data

Settlement

Automatic bet settlement

SDK Reference

Full TypeScript SDK docs