This page is for whoever sets up the sending side: a scoreboard OCR app, a scoring program or a script you wrote. It lists exactly what ScoreCastr Server expects and what it sends back. To turn the webhook on and get your URL, see Send live data by webhook first.
The request
| Part | Value |
|---|---|
| Method | POST |
| URL | https://<your ScoreCastr address>/api/scorecastr/match/<match id>/<token> |
| Header | Content-Type: application/json |
| Body | A JSON object |
| Sign-in | None. The token in the URL is the key. |
Copy the URL from the Webhook URL box rather than building it by hand. The token is 32 characters and changes when you click Regenerate Token or turn ScoreCastr Server off and on again.
Send requests from an app, a server or a script. A web page on another website can't call the webhook from the visitor's browser, because ScoreCastr doesn't allow browser requests from other websites.
The body
A flat JSON object with one key per value. Send only what you have; a field you leave out keeps its current value on the match.
{
"away_score": 14,
"home_score": 21,
"period": 3,
"clock": "8:42"
}
- Home and away:
away_is the match's first team (the visitors),home_the second. - Numbers: send numbers (
21) or numbers as text ("21"). Text that isn't a number is ignored for most number fields. - Clocks:
"MM:SS"(like"8:42") or a number of seconds. - Yes or no fields: send
trueorfalse. - Nesting: don't nest objects. Every field sits at the top level of the body.
Field names and aliases
Each sport has its own list, in the field guides: football, basketball, soccer, baseball and softball, volleyball, tennis and pickleball and ice hockey.
The general rules:
- snake_case or camelCase. Most fields take both:
home_scoreorhomeScore,time_remainingortimeRemaining. - Common aliases. Scores also take
home_points/away_pointsin football,home_runs/away_runsin baseball and softball, andhome_goals/away_goalsin ice hockey and field hockey. The clock also takestime_remainingandgame_clockin several sports. - Volleyball scores are sets won.
home_scoreandaway_scoreset sets won. The current set's points usehome_current_set_pointsandaway_current_set_points. - Use the listed names. Names aren't checked against a fixed list, so an unexpected name can fail the update or save something you didn't intend. Stick to the names in the field guides.
A successful reply
A good update returns HTTP 200 with:
{
"success": true,
"fieldsUpdated": 2,
"updateCount": 37,
"changed": true
}
fieldsUpdated: how many values or stat groups ScoreCastr wrote from this update.updateCount: how many updates this match has received since ScoreCastr Server was turned on.changed:trueif the score, period or a stat actually changed.falsemeans the values matched what the match already had, or nothing was recognized.
The update reaches the dashboard and the overlay straight away. The match's update count and last update time are saved with it.
Errors
| Status | Message | What it means |
|---|---|---|
| 400 | A message about the JSON | The body isn't valid JSON. |
| 400 | "This match is not configured for XML updates" | XML was sent to a match that uses the webhook. |
| 400 | "Invalid XML: ..." | JSON was sent to a match that uses the XML File Monitor. |
| 401 | "Invalid authentication token" | The token in the URL is wrong or was regenerated. |
| 403 | "ScoreCastr is not enabled for this match" | ScoreCastr Server is off for the match. |
| 404 | "Match not found" | The match id is wrong or the match was deleted. |
| 500 | "Failed to process update: ..." | ScoreCastr couldn't save the update. Send it again. |
Error replies are JSON with an error field (or message for invalid JSON).
Wrong content type
If the Content-Type header isn't application/json, ScoreCastr doesn't read the body. The request can still return 200, but nothing changes and changed is false. In basketball, it also sets both scores to 0.
Limits
- No rate limit is enforced. Each update is saved and sent to every open dashboard and overlay, so send when a value changes rather than on a fast timer.
- One match per URL. Each match has its own URL and token.
- Automatic shut-off. A feed that goes 12 hours without an update is turned off on its own, and its URL stops working.
- One connection type. A match uses the webhook or the XML File Monitor, not both. Setting up XML replaces the webhook and its URL.
Checklist
- POST to the full Webhook URL, copied from the Data Hub
- Content-Type: application/json on every request
- Flat JSON body with names from the sport's field guide
- Both scores in every basketball update
- Replies checked for "success": true while testing
- New URL used after Regenerate Token or a re-enable