# netkeiba Race Cards Scraper (JRA entries) (`superslowsloth/netkeiba-race-cards`) Actor

Scrape JRA race cards (出馬表) from netkeiba for any race day or list of race ids: one flat row per horse per race - bracket, horse number, horse name and id, sex/age, weight carried, jockey, trainer, body weight, plus the race's name, grade, course, distance, surface and post time.

- **URL**: https://apify.com/superslowsloth/netkeiba-race-cards.md
- **Developed by:** [Superslow Sloth](https://apify.com/superslowsloth) (community)
- **Categories:** Sports, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 entry scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## netkeiba Race Cards Scraper (JRA entries)

Scrape JRA race cards (出馬表) from netkeiba and get one flat row per horse per
race - no nested objects, no HTML to strip. Built for a handicapping table: give
it race days (or specific race ids) and get back every runner's bracket, horse
number, horse, sex and age, weight carried, jockey, trainer and body weight,
with the race's own name, grade, course, distance, surface and post time on
every row.

### Input

| field | meaning |
|---|---|
| `dates` | JRA race days as `YYYYMMDD` (or `YYYY-MM-DD`). Every JRA race netkeiba lists for each day is read, at every racecourse running that day. Empty = the upcoming weekend in Japan time: Saturday and Sunday, or just today when run on a Sunday. Monday holiday meetings are not guessed - add those dates yourself |
| `raceIds` | Optional 12-digit netkeiba race ids (the `race_id=` value in a race card URL). When given, the day list is skipped and `dates` is ignored |
| `maxItems` | Stop after this many entry rows in total, across every race |
| `proxyConfiguration` | Apify datacenter proxy by default - see **Proxy** below |

### How it works

1. For each date, `race.netkeiba.com/top/race_list_sub.html?kaisai_date=<date>`
   lists that day's JRA races. Each race appears there twice (its race card and
   a hidden replay link); every race is read once.
2. For each race, `race.netkeiba.com/race/shutuba.html?race_id=<id>` is read
   and every runner row of its entries table becomes one dataset row.

A date with no JRA meeting is reported in the log and costs nothing beyond the
actor-start event. The same horse in the same race is never pushed or charged
twice, even if a race id is given twice.

### Output

Race columns, repeated on every runner row:

| field | meaning |
|---|---|
| `race_id`, `race_url` | netkeiba's race id and the race card it was read from |
| `race_date` | `YYYY-MM-DD`, read off the race card |
| `venue` | Racecourse as printed, in Japanese (中山, 東京, 京都 ...) |
| `race_number` | Race number on the day (11 for 11R) |
| `race_name` | e.g. スプリンターズS |
| `race_grade` | Grade printed after the name, e.g. `G1`; `null` for an ungraded race |
| `post_time` | Post time in Japan time, `HH:MM` |
| `surface` | `turf` (芝), `dirt` (ダ) or `jump` (障) |
| `distance_m` | Distance in metres |
| `course_detail` | Direction and course variant as printed, e.g. `右 外 C` |
| `weather`, `track_condition` | As printed on the race header (曇, 稍 ...), once announced |
| `field_size` | Runner count the race header prints |
| `race_conditions` | Age/class/weight conditions as printed, e.g. `サラ系３歳以上 オープン (国際)(指) 定量` |

Runner columns:

| field | meaning |
|---|---|
| `bracket` | 枠番, 1-8 |
| `horse_number` | 馬番 |
| `horse_name`, `horse_id`, `horse_url` | Horse, and its netkeiba database page |
| `sex`, `age` | 牡 / 牝 / セ and age in years |
| `weight_carried_kg` | 斤量 |
| `jockey`, `jockey_id` | Jockey as printed, and netkeiba's jockey id |
| `trainer`, `trainer_id`, `trainer_stable` | Trainer, netkeiba's trainer id, and training centre (美浦 / 栗東) |
| `body_weight_kg`, `body_weight_change_kg` | 馬体重 and its change from the previous run |
| `odds`, `popularity` | See below - `null` in practice |

#### `null` is not zero

A column is `null` when netkeiba's page did not print the value, never a zero
standing in for it. A `0` would read as a measurement ("no weight change",
"weight carried 0") when the page said nothing.

- **`odds` and `popularity` are null on every row seen.** netkeiba prints
  these cells as placeholders (`---.-`, `**`) and fills them in with JavaScript
  from a separate odds feed after the page loads. This actor reads the page's
  HTML, which carries no number, so it reports `null` rather than inventing
  one. They would be filled automatically if netkeiba ever printed a number in
  the HTML.
- **`body_weight_kg` / `body_weight_change_kg`** are only published about an
  hour before post time, so a card read earlier has none. The change is also
  `null` when the page says the previous weight was not measured (`前計不`).
- **`bracket` / `horse_number`** are null on a card published before the draw.
- **`weather` / `track_condition`** appear once the day's going is announced.
- **`race_grade`** is null for every ungraded race.

### Encoding

netkeiba served its race pages as EUC-JP for years; on 2026-10-04 they were
UTF-8. This actor decodes each page by the charset it declares (HTTP header,
then the page's own `<meta charset>`), so horse and jockey names come out as
Japanese text either way.

### Proxy

Apify datacenter proxy is the default: netkeiba served both pages normally to a
datacenter address when probed on 2026-10-04. If a run's log shows refusals
(HTTP 403/429) it rotates the exit address and retries; switch to residential
only if refusals persist.

### Billing

Pay per event: **$0.0021 per entry** (one horse in one race), plus a small
**actor-start** fee per run. Platform usage - compute, bandwidth, proxy - is
included. An 18-runner G1 and a 9-runner maiden are charged by the rows they
actually produce.

# Actor input Schema

## `dates` (type: `array`):

JRA race days to scrape, as YYYYMMDD (or YYYY-MM-DD), e.g. "20261004". Every JRA race listed on netkeiba for each day is read, at every racecourse running that day. Leave empty for the upcoming weekend in Japan time: Saturday and Sunday, or just today when run on a Sunday. Monday holiday meetings are not guessed - add those dates explicitly. Ignored when race ids are given below.

## `raceIds` (type: `array`):

Optional. Specific netkeiba race ids to read (12 digits, the race_id= value in a race card URL such as race.netkeiba.com/race/shutuba.html?race_id=...). When given, the race-day list step is skipped and the dates above are ignored.

## `maxItems` (type: `integer`):

Stop after this many entry rows (one per horse per race) in total, across every race. A full JRA day is typically 24 to 36 races of 8 to 18 runners, so a two-meeting day is roughly 300 to 450 rows.

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy is the default: netkeiba's race pages were served normally to a datacenter address when probed on 2026-10-04. Switch to residential only if a run's log shows refusals (HTTP 403/429).

## Actor input object example

```json
{
  "dates": [],
  "raceIds": [],
  "maxItems": 500,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `entries` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "dates": [],
    "raceIds": [],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("superslowsloth/netkeiba-race-cards").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "dates": [],
    "raceIds": [],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("superslowsloth/netkeiba-race-cards").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "dates": [],
  "raceIds": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call superslowsloth/netkeiba-race-cards --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,superslowsloth/netkeiba-race-cards"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LlcjmtpIAHWLDsvEU/builds/KVjcd1Cwk7Spprg2E/openapi.json
