Pull today's soccer props every morning in Python
A 50-line Python script that saves today's soccer player prop lines for the top leagues to a dated CSV every morning, with GitHub Actions and a cron line.
Every script run against the live API on December 5, 2026. One full run: 262 credits.
Anytime goalscorer, shots and card lines move through the day, and the morning price is gone by kickoff. A script that saves one dated file a day turns that into a record you can look back on. This guide builds it for soccer: a short Python script that loops over a list of leagues, finds the matches starting in the next 24 hours, pulls every player's prop lines for each one, and writes them to data/soccer_props_<date>.csv. Then it runs the script for you every morning, with a GitHub Actions schedule or a cron line.
Player props are held for the Premier League (soccer), La Liga, Serie A, the Bundesliga, Ligue 1, MLS and the Champions League, so those are the leagues the script can take. It starts with the five top European leagues and the Champions League. Edit the LEAGUES list to follow others, or to drop the ones you do not need, since each league adds a 2-credit schedule call.
One full run on a Saturday with 25 matches across those leagues costs 262 credits: 12 for six schedule calls and 250 for the matches' props, at 10 for each match, because get_player_props is priced per match, not per line. A match with no lines yet costs nothing. Add estimate_only=True to a get_player_props call to see its price without paying it. Weekday runs are cheaper, because there are fewer matches.
1. Install the client and set your key
The client has no required dependencies, and the script below uses only the standard library. It needs Python 3.9 or newer, and the client reads your key from STRIKERAPI_API_KEY. Put the key in the environment, never in the script.
pip install strikerapi
export STRIKERAPI_API_KEY=your_key_here2. Write the script that saves today's props
The script asks get_schedule for the next day, keeps the games that start in the next 24 hours, and calls get_player_props once per game. The window matters: each game's lines are captured from about 30 hours before the start, at 15:00 and 20:00 UTC, and once more in the last 75 minutes. A run at 16:30 UTC therefore sees the 15:00 capture for every game in the window, where a run at 9:00 UTC would find tonight's games with no lines. A call that returns nothing is not charged, and the script prints the note the API sends with it. Each day's window starts where the last one ended, so a game lands in one file, give or take the minutes a scheduled run can start late. snapshot_type is left at its default, which returns the latest line captured before the game starts.
import csv
import time
from datetime import datetime, timedelta, timezone
from pathlib import Path
from strikerapi import Client
client = Client() # reads STRIKERAPI_API_KEY
now = datetime.now(timezone.utc)
today = now.strftime("%Y-%m-%d")
LEAGUES = ["soccer", "laliga", "seriea", "bundesliga", "ligue1", "ucl"]
COLUMNS = ["pulled_on", "league", "game_id", "game_date", "home", "away", "player_name", "player_id", "market", "bookmaker", "line", "over_odds", "under_odds", "captured_at", "scheduled_start", "minutes_before_scheduled_start"]
def next_24_hours(rows, start_key):
"""Rows that start after now and no later than 24 hours from now."""
keep = []
for row in rows:
if row.get(start_key):
start = datetime.fromisoformat(row[start_key].replace("Z", "+00:00"))
if now < start <= now + timedelta(days=1):
keep.append(row)
return keep
rows = []
for league in LEAGUES:
games = next_24_hours(client.get_schedule(days=1, league=league)["games"], "starts_at")
print(league, len(games), "games start in the next 24 hours")
for game in games:
data = client.get_player_props(game_id=game["game_id"], league=league)
for prop in data["props"]:
rows.append({"pulled_on": today, "home": game["home"]["abbrev"], "away": game["away"]["abbrev"], "league": league, **prop})
if not data["props"]:
print(game["game_id"], data.get("note", "no lines yet"))
time.sleep(1.1) # stay under 60 requests a minute
if rows:
Path("data").mkdir(exist_ok=True)
out = Path("data") / f"soccer_props_{today}.csv"
with out.open("w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=COLUMNS, extrasaction="ignore")
writer.writeheader()
writer.writerows(rows)
print(len(rows), "lines saved to", out)
else:
print("nothing to save today")
print("credits left:", client.last_credits_remaining)Output
soccer 7 games start in the next 24 hours
laliga 4 games start in the next 24 hours
seriea 3 games start in the next 24 hours
bundesliga 6 games start in the next 24 hours
ligue1 5 games start in the next 24 hours
ucl 0 games start in the next 24 hours
11682 lines saved to data/soccer_props_2026-12-05.csv
credits left: 13496Save it as pull_soccer_props.py and run it once by hand. It writes data/soccer_props_<date>.csv, one file per day, and prints the credits left on the key that ran it. A day with nothing to save writes no file.
3. What each column means
Every row is one player, one market and one sportsbook. The columns, in file order:
- `pulled_on`: the UTC date the script ran. It is the same on every row of a file, which lets you stack the daily files.
- `home`, `away`: the club abbreviations from the schedule row, such as
ARS. - `league`: the league key you passed to the calls, such as
laliga. - `game_id`: our id for the game, the same one
get_schedulereturns. - `game_date`: the game's date.
- `player_name`: the player as the sportsbook lists him.
- `player_id`: our player id, where the sportsbook's name matched a player in that game. Empty where it did not, so do not join on it without checking for gaps.
- `market`: the stat the line is on, such as
player_points. The list for the sport is under the table. - `bookmaker`: the sportsbook's key, such as
draftkings. - `line`: the number the over/under is set at, such as 24.5. It is empty for yes or no markets such as an anytime scorer, where
over_oddsis the price of yes. - `over_odds`, `under_odds`: the sportsbook's price for each side, in American format (
-115,+105). The prices include the sportsbook's margin, so two sides priced-115are not a 50% chance each. Some books post only one side, and the other is empty. - `captured_at`: when we captured that line, in UTC.
- `scheduled_start`: the game's scheduled start, in UTC.
- `minutes_before_scheduled_start`: minutes from
captured_attoscheduled_start. Positive means captured before the scheduled start.
The markets are player_goal_scorer_anytime, player_first_goal_scorer, player_last_goal_scorer, player_shots_on_target, player_shots, player_assists and player_to_receive_card. The three goalscorer markets and the card market are yes or no, so line is empty and over_odds is the price of yes, with under_odds the price of no where a book posts it. Most books post only the over on shots and assists. The prices are what the market showed at captured_at. They are information about the market, not a forecast of the match.
4. Run it every morning with GitHub Actions
Put the script in a private repository, add your key under Settings, Secrets and variables, Actions, and add this workflow as .github/workflows/daily-soccer-props.yml. GitHub reads cron times as UTC and can start a scheduled run a few minutes late. The last step commits the new CSV, so the repository becomes your archive. Keep it private: the terms let you store this data but not redistribute it.
name: Daily soccer props
on:
schedule:
- cron: "30 16 * * *" # 16:30 UTC every day
workflow_dispatch: # lets you run it by hand once to test
permissions:
contents: write
jobs:
pull:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install strikerapi
- run: python pull_soccer_props.py
env:
STRIKERAPI_API_KEY: ${{ secrets.STRIKERAPI_API_KEY }}
- run: |
git config user.name "daily-pull"
git config user.email "daily-pull@users.noreply.github.com"
mkdir -p data
git add data/
git diff --cached --quiet || git commit -m "soccer props $(date -u +%F)"
git pushRun it once from the Actions tab with the manual trigger before you trust the schedule. A failed run, such as a bad key or no credits, shows as a failed workflow and GitHub emails you.
5. Or run it from cron on your own machine
If you would rather keep the files local, one crontab line does the same job. Cron uses the machine's clock, so set the hour to 16:30 UTC in your own zone (11:30 on US Eastern time in winter). The key goes in a file only you can read, so it is not written into the crontab. Open the crontab with crontab -e.
# one-time setup
echo 'export STRIKERAPI_API_KEY=your_key_here' > ~/.strikerapi_env && chmod 600 ~/.strikerapi_env
# crontab line: 16:30 every day, appends to a log
30 16 * * * cd ~/daily-pull && . ~/.strikerapi_env && python3 pull_soccer_props.py >> pull.log 2>&1A laptop that is asleep at 16:30 skips the run, and cron does not catch up. On a machine that is not always on, use the GitHub workflow above.
6. Check the first file
Run the script by hand once on a match day and read the file it wrote. This prints the line count, the number of players and sportsbooks, and the median line in each market.
import glob
import pandas as pd
latest = sorted(glob.glob("data/soccer_props_*.csv"))[-1]
df = pd.read_csv(latest)
print(latest, len(df), "lines,", df["player_name"].nunique(), "players,", df["bookmaker"].nunique(), "sportsbooks")
print(df.groupby("market").agg(lines=("line", "size"), players=("player_name", "nunique"), median_line=("line", "median")).round(1).to_string())Output
data/soccer_props_2026-12-05.csv 11682 lines, 1106 players, 5 sportsbooks
lines players median_line
market
player_assists 391 391 0.5
player_first_goal_scorer 3097 994 NaN
player_goal_scorer_anytime 3103 994 NaN
player_last_goal_scorer 1632 976 NaN
player_shots 1150 767 0.5
player_shots_on_target 1232 771 0.5
player_to_receive_card 1077 1077 NaN25 matches in five leagues on Dec 5 2026: 11,682 lines from 5 sportsbooks and 1,106 players.
After a few days, read the files together to see how a line moved from one morning to the next. Read them as a record of what the market showed, not as a forecast.
Tools and credits
- get_schedule: 6 calls, 12 credits.
- get_player_props: 25 calls, 250 credits (25 matches across the six leagues on a Saturday; 10 credits a match before kickoff).
One full run: 262 credits.
What you can do with the data
You may store these rows, train models and backtest on them, and build products that show your users what you derive. You may not redistribute the rows, or the prices as a raw feed, as a dataset or API of its own. Prices and lines are market information, not predictions or advice.
Details: data timing and rights.
What to do next
Start with 500 free credits every month
No card. pip install strikerapi, REST or MCP.