NPB APInpb.jp ↗
Access Nippon Professional Baseball stats via the NPB.jp API. Get team rosters, batting/pitching stats, career histories, and league standings for all 12 NPB teams.
What is the NPB API?
The NPB.jp API covers 7 endpoints that expose player statistics, team rosters, and league standings from Nippon Professional Baseball. Use get_team_batting_stats to pull per-player batting averages, home runs, OBP, and slugging for any team in the current season, or call get_player_career_stats with an 8-digit player_id to retrieve year-by-year batting and pitching history for a specific player across their entire NPB career.
curl -X GET 'https://api.parse.bot/scraper/91b61a4d-e14a-4af5-81b6-71f15bad9fee/get_team_batting_stats?team=hanshin&season=2026&auto_update=false' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace npb-jp-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: NPB Stats SDK — bounded, re-runnable; every call capped."""
from parse_apis.NPB_Stats_API import Npb, Team_, PlayerNotFound
client = Npb()
# List active players filtered to one team
for player in client.active_players.list(team=Team_.HANSHIN, limit=3):
print(player.name, player.team, player.player_id)
# Get both leagues' standings in one call
both = client.both_standingses.get()
print(both.season)
for standing in both.central[:3]:
print(standing.Team, standing.W, standing.L, standing.PCT)
# Get batting stats for a team (standard mode)
for batter in client.team("hanshin").batting_stats(limit=3):
print(batter.Player, batter.AVG, batter.HR)
# Get batting stats with auto_update (crawls game pages dynamically)
for batter in client.team("hanshin").batting_stats(auto_update=True, limit=3):
print(batter.Player, batter.G, batter.AB, batter.H, batter.AVG)
# Get roster and drill into a player's career stats
player = client.team("hanshin").roster(limit=1).first()
try:
career = player.career_stats()
print(career.bio.name, career.bio.team)
except PlayerNotFound as e:
print("player gone:", e.player_id)
# Get Central League standings
for standing in client.league("central").standings(limit=3):
print(standing.Team, standing.GB)
print("exercised: active_players.list / both_standingses.get / team.batting_stats / team.roster / player.career_stats / league.standings")
Retrieve current-season batting statistics for all players on a specified NPB team. Each player entry includes games played, at-bats, hits, home runs, RBI, batting average, slugging, OBP, and other standard batting metrics. Stats reflect the most recent game day. When auto_update is true, the endpoint dynamically crawls calendar game pages from April through the current month, follows each game link, extracts per-player batting stats from /bis/eng/ pages, and aggregates cumulative season totals.
| Param | Type | Description |
|---|---|---|
| teamrequired | string | NPB team identifier. |
| season | string | Season year in YYYY format. |
| auto_update | boolean | When true, dynamically crawls all available calendar months for the season (April through current month), follows each game link, extracts per-player batting stats from English /bis/eng/ game pages, and aggregates cumulative season totals. New game days are automatically included as they appear on the calendar. |
{
"type": "object",
"fields": {
"team": "team identifier used in the request",
"season": "season year",
"players": "array of player batting stat records",
"auto_update": "boolean indicating auto_update mode was used (present only when auto_update=true)",
"games_total": "total number of games found on calendar for the team (present only when auto_update=true)",
"games_processed": "number of game pages successfully crawled (present only when auto_update=true)"
},
"sample": {
"data": {
"team": "hanshin",
"season": "2026",
"players": [
{
"G": "32",
"H": "32",
"R": "20",
"2B": "5",
"3B": "0",
"AB": "128",
"BB": "15",
"CS": "2",
"HP": "1",
"HR": "0",
"PA": "145",
"SB": "6",
"SF": "1",
"SH": "0",
"SO": "24",
"TB": "37",
"AVG": ".250",
"GDP": "1",
"IBB": "0",
"OBP": ".331",
"RBI": "5",
"SLG": ".289",
"Player": "Chikamoto, Koji"
}
]
},
"status": "success"
}
}About the NPB API
Player and Roster Data
The get_team_roster endpoint returns all registered players on an NPB team, including jersey number, position group, birth date, physical measurements, and the player_id field that serves as the key for get_player_career_stats. That career endpoint returns a bio object (name, number, team, position, physical info) alongside either batting_stats or pitching_stats arrays — one record per season — depending on the player's position.
get_all_active_players spans all 12 NPB teams in a single call. It accepts an optional team filter and returns English-language names, team names, and player IDs. Entries containing Japanese characters are filtered out of the response, so the dataset reflects only players whose names are represented in the English-language roster pages.
Team Stats
get_team_batting_stats and get_team_pitching_stats each accept a required team identifier and an optional season year in YYYY format. Batting records include games played, at-bats, hits, home runs, RBI, batting average, slugging percentage, and OBP. Pitching records include wins, losses, saves, holds, ERA, innings pitched, and strikeouts. Both endpoints reflect the most recent completed game day.
Standings
get_team_standings returns standings for either the Central League or Pacific League, with wins, losses, ties, winning percentage, games behind, and head-to-head records against each opponent. get_both_standings retrieves both leagues in one request, returning central and pacific arrays ordered by current position. Both accept an optional season parameter to query historical seasons.
The NPB API is a managed, monitored endpoint for npb.jp — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when npb.jp changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official npb.jp API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track real-time NPB standings for both leagues using get_both_standings to power a standings widget
- Build a player comparison tool by querying get_player_career_stats for multiple player_ids and comparing year-by-year ERA or batting average
- Populate team roster pages with jersey numbers, positions, and physical measurements from get_team_roster
- Identify top home run hitters on a given team using get_team_batting_stats and filtering by home run totals
- Monitor bullpen performance across the season by tracking saves and holds via get_team_pitching_stats
- Compile an all-active-players database for NPB fantasy leagues using get_all_active_players across all 12 teams
- Analyze historical season-by-season trends for a pitcher by requesting get_player_career_stats and examining the pitching_stats array
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does NPB have an official developer API?+
How do I get the player_id needed for get_player_career_stats?+
players array includes a player_id field — an 8-digit numeric string — that you pass directly to get_player_career_stats.