> ## 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.

# Build a Soccer Odds App with Live Scores

> Build a real-time soccer odds app with live scores, 100+ leagues, and automatic settlement. Full TypeScript tutorial with FieldFunded API.

# Build a Soccer Odds App with Live Scores and Settlement

Get live soccer odds for Premier League, La Liga, Serie A, Bundesliga, and 100+ leagues from a single API call. This guide builds a complete soccer odds dashboard with live scores, match tracking, and automatic bet resolution.

## Soccer Coverage

FieldFunded covers 100+ soccer leagues across 50+ countries:

| Region        | Example Leagues                                      | Coverage |
| ------------- | ---------------------------------------------------- | -------- |
| England       | Premier League, Championship, League One, League Two | Full     |
| Spain         | La Liga, Segunda Division                            | Full     |
| Italy         | Serie A, Serie B                                     | Full     |
| Germany       | Bundesliga, 2. Bundesliga                            | Full     |
| France        | Ligue 1, Ligue 2                                     | Full     |
| Europe        | Champions League, Europa League, Conference League   | Full     |
| South America | Brasileirao, Argentine Liga                          | Full     |
| International | World Cup, Euros, Copa America, Nations League       | Full     |

## What You'll Use

| SDK Method       | Endpoint                   | Purpose                                    |
| ---------------- | -------------------------- | ------------------------------------------ |
| `getEvents()`    | `GET /v1/events`           | List soccer matches by league              |
| `getEventOdds()` | `GET /v1/events/{id}/odds` | Get all markets (1x2, BTTS, O/U, Asian HC) |
| `getScores()`    | `GET /v1/scores`           | Live scores with minute tracking           |
| `getLive()`      | `GET /v1/live`             | Currently in-play matches                  |
| `checkBet()`     | `POST /v1/bets/check`      | Auto-settle soccer bets                    |

## Step 1: Fetch Today's Matches

```typescript theme={null}
import { FieldFundedSDK } from '@fieldfunded/sdk';

const ff = new FieldFundedSDK({
  apiKey: process.env.FIELDFUNDED_API_KEY!,
  baseUrl: 'https://api.fieldfunded.com/v1',
});

// Get today's Premier League matches
const premierLeague = await ff.getEvents({
  sport: 'soccer',
  league: 'england-premier-league',
});

for (const match of premierLeague.events || []) {
  console.log(`${match.home_team} vs ${match.away_team}`);
  console.log(`  Kickoff: ${new Date(match.commence_time).toLocaleString()}`);
}
```

## Step 2: Get Market Odds

Soccer events include deep market coverage — 1x2, Double Chance, Both Teams to Score, Over/Under, Asian Handicap, Correct Score, and more:

```typescript theme={null}
const odds = await ff.getEventOdds(eventId);

// Key soccer markets
const markets = {
  matchResult: odds.markets?.find((m: any) => m.name === 'Winner'),
  btts: odds.markets?.find((m: any) => m.name === 'Both Teams to Score'),
  overUnder: odds.markets?.find((m: any) => m.name === 'Over/Under 2.5'),
  doubleChance: odds.markets?.find((m: any) => m.name === 'Double Chance'),
};

if (markets.matchResult) {
  console.log('1x2:');
  for (const sel of markets.matchResult.selections) {
    console.log(`  ${sel.name}: ${sel.odds}`);
  }
}

if (markets.btts) {
  console.log('Both Teams to Score:');
  for (const sel of markets.btts.selections) {
    console.log(`  ${sel.name}: ${sel.odds}`);
  }
}

console.log(`Total markets available: ${odds.markets?.length}`);
```

## Step 3: Track Live Scores

Poll live scores during matches to update your UI in real time:

```typescript theme={null}
async function pollLiveScores() {
  const scores = await ff.getScores({ sport: 'soccer' });

  for (const match of scores.scores || []) {
    const minute = match.score?.clock || '';
    console.log(
      `${match.home_team} ${match.score.home} - ${match.score.away} ${match.away_team} (${minute})`
    );

    // Half-time and period scores
    if (match.score.period_scores) {
      for (const period of match.score.period_scores) {
        console.log(`  ${period.period}: ${period.home} - ${period.away}`);
      }
    }
  }
}

// Poll every 30 seconds during live matches
setInterval(pollLiveScores, 30_000);
```

## Step 4: Settle Bets Automatically

When a match ends, use the [settlement API](/api-reference/settlement/check-bets) to resolve bets instantly:

```typescript theme={null}
const result = await ff.checkBet({
  event_id: eventId,
  market: 'Both Teams to Score',
  selection: 'Yes',
  stake: 20,
  odds: 1.90,
});

console.log(`Result: ${result.status}`);   // "won" | "lost" | "refund"
console.log(`Payout: $${result.payout}`);  // 38.00 if won
```

## Rate Limit Math

| Scenario                                | Requests/day | Monthly total | Plan needed    |
| --------------------------------------- | ------------ | ------------- | -------------- |
| Check odds for 20 matches daily         | 20           | 600           | Free           |
| Poll 5 live matches every 60s (2hr avg) | 600          | 18,000        | Starter (\$29) |
| Full matchday: 10 live + odds + scores  | 2,000        | 60,000        | Starter (\$29) |
| Production: 50+ live + settlement       | 8,000        | 240,000       | Starter (\$29) |

The free tier handles casual use. For a production soccer odds app covering a full weekend of matches, the [Starter plan](/compare/pricing) at \$29/month is sufficient.

***

## Related Guides

* [Build a Betting Platform](/guides/build-betting-platform) — full-stack architecture with soccer as primary sport
* [Build a Settlement Engine](/guides/build-settlement-engine) — automate post-match resolution
* [Build a Line Tracker](/guides/build-line-tracker) — monitor odds movements pre-kickoff
* [FieldFunded vs The Odds API](/compare/vs-theoddsapi) — soccer coverage comparison

<CardGroup cols={2}>
  <Card title="Get Your Free API Key" icon="key" href="/quickstart">
    Start building in 5 minutes — 100+ soccer leagues included
  </Card>

  <Card title="See Pricing" icon="dollar-sign" href="/compare/pricing">
    All plans compared side by side
  </Card>
</CardGroup>
