MLB Daily Scoreboard Scraper: how to get the data as JSON/CSV (API, Python, no code)
Fetch MLB game scores from the official Stats API: game ID, teams, final score, R-H-E totals, inning-by-inning linescore, venue, day/night flag, and status for any date or short date range. This guide shows the output fields, a working input, and
Python, JavaScript and cURL code for the Actor v0iddo/mlb-daily-scoreboard-scraper on Apify.
Open MLB Daily Scoreboard Scraper on Apify
More on voiddo.com
- Step by step: https://voiddo.com/export/mlb-daily-scoreboard-scraper/
What data you get
One row per result. Every row can be downloaded as JSON, CSV, Excel or HTML, or read through the API.
| Field | Label | Type | Example |
|---|---|---|---|
gamePk | Game ID | number | 746419 |
date | Date | date | 2024-09-15 |
status | Status | text | Final |
awayTeam | Away Team | text | Baltimore Orioles |
homeTeam | Home Team | text | Detroit Tigers |
awayScore | Away Score | number | 2 |
homeScore | Home Score | number | 4 |
venue | Venue | text | Comerica Park |
dayNight | Day/Night | text | day |
inningScores | Inning Scores | list | [{"inning": 1, "awayRuns": 0, "awayHits": 1, "homeRuns": 0, "homeHi... |
url | Game URL | URL | https://www.mlb.com/gameday/746419 |
gameType | text | R | |
awayTeamId | number | 110 | |
awayHits | number | 7 | |
awayErrors | number | 0 | |
homeTeamId | number | 116 | |
homeHits | number | 5 | |
homeErrors | number | 0 | |
gameTime | text | 2024-09-15T16:10:00Z | |
seriesDescription | text | Regular Season |
Input example
This is the input that is pre-filled on the Actor page. Change the values for your own run.
{
"date": "2024-09-15",
"gameType": "R",
"maxItems": 20
}
| Input field | Type | What it does |
|---|---|---|
date | string | Single date to fetch games for, in YYYY-MM-DD format. |
startDate | string | First date of a range in YYYY-MM-DD format. |
endDate | string | Last date of a range in YYYY-MM-DD format. |
gameType | string | Filter by game type code: R = Regular Season, P = Postseason, S = Spring Training, W = World Series. |
maxItems | integer | The run stops after this many result rows. |
Output sample
Real rows from a run of the Actor. Fields that name people are left out of the sample.
[
{
"gamePk": 746419,
"date": "2024-09-15",
"gameType": "R",
"status": "Final",
"awayTeam": "Baltimore Orioles",
"awayTeamId": 110,
"awayScore": 2,
"awayHits": 7,
"awayErrors": 0,
"homeTeam": "Detroit Tigers",
"homeTeamId": 116,
"homeScore": 4,
"homeHits": 5,
"homeErrors": 0,
"venue": "Comerica Park",
"dayNight": "day",
"gameTime": "2024-09-15T16:10:00Z",
"seriesDescription": "Regular Season",
"inningScores": [
{
"inning": 1,
"awayRuns": 0,
"awayHits": 1,
"homeRuns": 0,
"homeHits": 0
},
{
"inning": 2,
"awayRuns": 0,
"awayHits": 1,
"homeRuns": 0,
"homeHits": 1
},
{
"inning": 3,
"awayRuns": 0,
"awayHits": 1,
"homeRuns": 2,
"homeHits": 1
}
],
"url": "https://www.mlb.com/gameday/746419"
},
{
"gamePk": 745852,
"date": "2024-09-15",
"gameType": "R",
"status": "Final",
"awayTeam": "Cincinnati Reds",
"awayTeamId": 113,
"awayScore": 2,
"awayHits": 7,
"awayErrors": 0,
"homeTeam": "Minnesota Twins",
"homeTeamId": 142,
"homeScore": 9,
"homeHits": 12,
"homeErrors": 0,
"venue": "Target Field",
"dayNight": "day",
"gameTime": "2024-09-15T17:05:00Z",
"seriesDescription": "Regular Season",
"inningScores": [
{
"inning": 1,
"awayRuns": 0,
"awayHits": 0,
"homeRuns": 0,
"homeHits": 1
},
{
"inning": 2,
"awayRuns": 0,
"awayHits": 0,
"homeRuns": 0,
"homeHits": 0
},
{
"inning": 3,
"awayRuns": 0,
"awayHits": 0,
"homeRuns": 0,
"homeHits": 0
}
],
"url": "https://www.mlb.com/gameday/745852"
}
]
Code: Python, JavaScript and cURL
Get your API token in Apify Console under Settings, then Integrations. The Actor id is v0iddo/mlb-daily-scoreboard-scraper.
Python (apify-client)
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run_input = {'date': '2024-09-15', 'gameType': 'R', 'maxItems': 20}
run = client.actor("v0iddo/mlb-daily-scoreboard-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)
JavaScript (apify-client)
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const input = {
"date": "2024-09-15",
"gameType": "R",
"maxItems": 20
};
const run = await client.actor('v0iddo/mlb-daily-scoreboard-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
cURL
curl -X POST "https://api.apify.com/v2/acts/v0iddo~mlb-daily-scoreboard-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"date": "2024-09-15", "gameType": "R", "maxItems": 20}'
Price
$2.00 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $1.40 per 1,000. See the pricing tab for your plan. A new Apify account gets $5 of platform credit every month.
Good to know
- Data is read from the official MLB Stats API (statsapi.mlb.com). Coverage includes Regular Season, Postseason, Spring Training, and All-Star games. Historical data is available back to 1876.
- Date ranges are capped at 7 days per run. Split longer ranges across multiple actor runs.
- Scores and inning-by-inning linescores are only populated for completed or in-progress games; scheduled future games show null scores.
- Not affiliated with Major League Baseball or MLB Advanced Media.
FAQ
What data does the MLB Daily Scoreboard Scraper return?
Each result is one row in an Apify dataset. Fields include gamePk, date, status, awayTeam, homeTeam, awayScore, homeScore, venue, and more. The table above shows every field with an example value.
How do I use the MLB Daily Scoreboard Scraper from Python?
Install the apify-client package, create a client with your Apify API token, call the Actor v0iddo/mlb-daily-scoreboard-scraper with an input like the one above, and read the rows from the run's dataset. The Python snippet above does exactly that.
Can I use it without writing code?
Yes. Open the Actor page on Apify, fill in the input form (an example is already filled in), press Start, and download the results as JSON, CSV, Excel or HTML. You can also schedule runs there.
How much does it cost?
$2.00 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $1.40 per 1,000. A new Apify account gets $5 of platform credit every month.
How do I limit the number of results?
Set the maxItems input field to the number of results you need; the run stops there, so it also caps the cost of one run. You can also set a maximum cost for a run in the run options on Apify, and the run stops when it is reached.
Can I send the results to Google Sheets, Make, Zapier or n8n?
Yes. Apify datasets connect to Google Sheets, Slack, Make, Zapier and n8n, and a webhook can call your own service when a run finishes. You can also export the dataset as JSON, CSV or Excel.
Open MLB Daily Scoreboard Scraper on Apify
Related guides
- Sortlist Agency Scraper: Scrape agency listings from sortlist.com service-category pages.
- Talabat Scraper: Scrape Talabat restaurant listings by country: restaurant ID, name, cuisines, category, logo and direct URL.
- Royal Caribbean Ships Scraper: Scrape the Royal Caribbean fleet directory: every cruise ship with its class, name, description, image, and...