# Quickstart - First API Call in 5 Minutes
URL: https://sockodds.com/docs/basics/quickstart/

# Quickstart - First API Call in 5 Minutes [#quickstart---first-api-call-in-5-minutes]

A complete, copy-paste tutorial to fetch Australian odds.

## Step 1: Get your API key [#step-1-get-your-api-key]

1. Sign up at [sockodds.com/signup](https://sockodds.com/signup/)
2. Copy the key it shows you — it is shown once
3. Keep it handy for the next step

## Step 2: Make a request [#step-2-make-a-request]

1. Copy one of the examples below into a file
2. Replace `YOUR_API_KEY` with your actual API key
3. Run it!

**Browser URL** · **cURL** · **JavaScript** · **Python** · **Ruby** · **PHP** · **Java** · **Go**

```text
https://api.sockodds.com/v2/events?apiKey=YOUR_API_KEY&leagueID=AFL,NRL&oddsAvailable=true
```

```bash
curl -X GET "https://api.sockodds.com/v2/events?leagueID=AFL,NRL&oddsAvailable=true" -H "x-api-key: YOUR_API_KEY"
```

```javascript
const response = await fetch("https://api.sockodds.com/v2/events?leagueID=AFL,NRL&oddsAvailable=true", { headers: { "x-api-key": "YOUR_API_KEY" } });
const { data, nextCursor, notice } = await response.json();
console.log(JSON.stringify(data, null, 2));
```

```python
import requests

response = requests.get("https://api.sockodds.com/v2/events", params=dict(leagueID="AFL,NRL", oddsAvailable="true"), headers={"x-api-key": "YOUR_API_KEY"})
output = response.json()
print(output["data"])
```

```ruby
require 'net/http'
require 'json'

uri = URI("https://api.sockodds.com/v2/events?leagueID=AFL,NRL&oddsAvailable=true")
req = Net::HTTP::Get.new(uri)
req['x-api-key'] = 'YOUR_API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.pretty_generate(JSON.parse(res.body)['data'])
```

```php
<?php
$ch = curl_init("https://api.sockodds.com/v2/events?leagueID=AFL,NRL&oddsAvailable=true");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$output = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($output['data']);
```

```java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.sockodds.com/v2/events?leagueID=AFL,NRL&oddsAvailable=true"))
    .header("x-api-key", "YOUR_API_KEY").GET().build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```go
req, _ := http.NewRequest("GET", "https://api.sockodds.com/v2/events?leagueID=AFL,NRL&oddsAvailable=true", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil { log.Fatal(err) }
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
```

> If you don't want to write code, paste the "Browser URL" example into your browser.

## Step 3: See live odds [#step-3-see-live-odds]

You'll get a response like this (trimmed to one market):

```json
{
  "success": true,
  "nextCursor": "afl_2026-09-03_fremantle_vs_hawthorn",
  "data": [
    {
      "eventID": "afl_2026-09-03_fremantle_vs_hawthorn",
      "sportID": "AUSSIE_RULES",
      "leagueID": "AFL",
      "type": "match",
      "teams": {
        "home": { "teamID": "FREMANTLE_AFL", "names": { "long": "Fremantle", "medium": "Fremantle", "short": "FRE" }, "statEntityID": "home" },
        "away": { "teamID": "HAWTHORN_AFL", "names": { "long": "Hawthorn", "medium": "Hawthorn", "short": "HAW" }, "statEntityID": "away" }
      },
      "status": { "started": false, "ended": false, "cancelled": false, "live": false, "finalized": false, "oddsPresent": true, "oddsAvailable": true, "startsAt": "2026-09-03T09:40:00Z", "displayLong": "Upcoming" },
      "info": { "displayName": "Hawthorn @ Fremantle", "commenceTime": "2026-09-03T09:40:00Z", "lastUpdatedAt": "2026-09-03T08:27:48.000Z", "stale": false },
      "odds": {
        "points-all-game-eo-odd": {
          "oddID": "points-all-game-eo-odd",
          "opposingOddID": "points-all-game-eo-even",
          "marketName": "Odd/Even Total Points",
          "statID": "points",
          "statEntityID": "all",
          "periodID": "game",
          "betTypeID": "eo",
          "sideID": "odd",
          "bookOdds": "-116",
          "fairOdds": null,
          "bookOverUnder": null,
          "bookSpread": null,
          "byBookmaker": {
            "unibet": {
              "bookmakerID": "unibet",
              "odds": "-115",
              "decimal": 1.87,
              "available": true,
              "lastUpdatedAt": "2026-09-03T10:22:09.000Z"
            },
            "tabtouch": {
              "bookmakerID": "tabtouch",
              "odds": "-118",
              "decimal": 1.85,
              "available": true,
              "lastUpdatedAt": "2026-09-03T10:21:03.000Z"
            }
          }
        }
      },
      "links": { "bookmakers": { "sportsbet": "https://www.sportsbet.com.au/betting/australian-rules/afl/…", "tab": "https://www.tab.com.au/sports/betting/Australian%20Rules/competitions/AFL/matches/…" } },
      "players": {}
    }
  ]
}
```

### Understand the response [#understand-the-response]

**Event details:**

- `eventID` — unique identifier for this game
- `teams.home.names.long` — home team
- `status.startsAt` — when the game starts (UTC)
- `info.stale` — whether the source has stopped writing this event

**Odds data:** each odd is keyed by `oddID`, which follows this pattern:

```
{statID}-{statEntityID}-{periodID}-{betTypeID}-{sideID}
```

Note: the oddID does NOT include bookmakerID. Each oddID contains odds from ALL available bookmakers nested under `byBookmaker`.

**Example:** `points-home-game-ml-home` means:

- `points` — stat being bet on (the score)
- `home` — entity (home team)
- `game` — the full game
- `ml` — head to head / moneyline (betTypeID)
- `home` — side of the bet

**The odds show:**

- Each oddID contains odds from multiple bookmakers under `byBookmaker`
- Every book carries `odds` (American string) and `decimal`
- All odds values are **strings**, not numbers — `decimal` is a number

## Done! [#done]

**Congratulations!** You just fetched Australian odds from the SockOdds API.

## Next steps [#next-steps]

### Build something real [#build-something-real]

- **[Live Odds Tracker](https://sockodds.com/docs/examples/live-odds-tracker/)** — track line movement
- **[Arbitrage Calculator](https://sockodds.com/docs/examples/arbitrage-calculator/)** — find cross-book margins
- **[Odds Comparison Dashboard](https://sockodds.com/docs/examples/odds-comparison-dashboard/)**
- **[Player Props Analyzer](https://sockodds.com/docs/examples/player-props-analyzer/)**
- **[Parlay Builder](https://sockodds.com/docs/examples/parlay-builder/)**

### Learn the basics [#learn-the-basics]

- **[Understanding odds data](https://sockodds.com/docs/data-types/odds/)**
- **[Glossary](https://sockodds.com/docs/info/glossary/)**
- **[Setup](https://sockodds.com/docs/basics/setup/)**
- **[Rate limiting](https://sockodds.com/docs/info/rate-limiting/)**

### Use the SDK [#use-the-sdk]

```bash
npm install sports-odds-api
pip install sports-odds-api
gem install sports-odds-api
go get github.com/SportsGameOdds/sports-odds-api-go
```

[Full SDK guide →](https://sockodds.com/docs/sdk/)

### Explore all endpoints [#explore-all-endpoints]

- **[API Reference](https://sockodds.com/docs/reference/)**
- **[Data Explorer](https://sockodds.com/docs/explorer/)**

## Common next questions [#common-next-questions]

### How do I get odds from multiple bookmakers? [#how-do-i-get-odds-from-multiple-bookmakers]

By default every bookmaker your plan allows is returned under `byBookmaker`. Filter with `bookmakerID=sportsbet,tab`, or in code: `Object.entries(odd.byBookmaker)`. [All bookmakers →](https://sockodds.com/docs/data-types/bookmakers/)

### How do I get event status? [#how-do-i-get-event-status]

It is on every event: `status.started`, `status.live`, `status.ended`, `status.finalized`; filter with `live=true`.

### How do I get historical data? [#how-do-i-get-historical-data]

Use `startsAfter` and `startsBefore` with `finalized=true`. Finished events are retained from 2026-09.

### How often should I poll? [#how-often-should-i-poll]

Every 2–5 minutes. The source refreshes every ~2 minutes, so faster polling wastes quota. [Best practices →](https://sockodds.com/docs/info/best-practices/)

### What counts as an "object"? [#what-counts-as-an-object]

One event (game) with ALL its markets and ALL its bookmakers. 10 events = 10 objects; the same 10 polled twice = 20.

> Need help?[FAQ](https://sockodds.com/docs/faq/) · [Email](mailto:api@sockodds.com) · [Contact](https://sockodds.com/contact-us/)
