# Japan Diet Parliament Debates & Speeches Search (国会会議録) (`chivalrous_skyline_vtd/japan-diet-minutes`) Actor

Search Japanese parliament (National Diet) speeches since 1947 by keyword, speaker, party, committee or date, via the National Diet Library official API. Full text, structured rows.

- **URL**: https://apify.com/chivalrous_skyline_vtd/japan-diet-minutes.md
- **Developed by:** [HexaX](https://apify.com/chivalrous_skyline_vtd) (community)
- **Categories:** News
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 speech records

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

## Japan Diet Parliament Debates & Speeches Search (国会会議録)

### What it does

Search what was said in Japan's parliament, the National Diet (the Japanese equivalent of Hansard): plenary sessions and committees of the House of Representatives (衆議院) and the House of Councillors (参議院), from 1947.
Results come as structured rows: date, house, meeting, speaker, party, position, the full text of the speech, and links to the official record.

Data source: the **National Diet Library's official speech search API** of the [国会会議録検索システム](https://kokkai.ndl.go.jp/). No scraping of web pages.

### What you can do with Diet minutes data

- Policy research: how often and how a topic (for example 子育て支援, child-care support) is discussed.
- Journalism: find what a minister or member said, with a link to the official record.
- Speaker analysis: compare statements by party, committee or period.

### Why choose this Actor

- Uses the National Diet Library's official API, not page scraping.
- Low price: $2 per 1,000 speeches.
- Every row has source links (`speechURL`, `meetingURL`, `pdfURL`).

### Quick start

Keep the example (`子育て支援` = child-care support, 20 speeches) and press Start.

### Input

```json
{
  "keyword": "子育て支援",
  "maxResults": 20
}
```

Give at least one search condition. All conditions are combined with AND. To narrow the example, add for instance `"nameOfHouse": "衆議院"`, `"nameOfMeeting": "予算委員会"`, `"dateFrom": "2024-01-01"` and `"dateUntil": "2024-12-31"`.

| Field | API parameter | Notes |
|---|---|---|
| `keyword` | `any` | Several words separated by spaces must all match |
| `speaker` | `speaker` | e.g. 石破茂 |
| `speakerGroup` | `speakerGroup` | Parliamentary group (会派) |
| `speakerPosition` | `speakerPosition` | e.g. 内閣総理大臣 |
| `nameOfHouse` | `nameOfHouse` | 衆議院 / 参議院 / 両院 / 両院協議会. Other values are rejected; the API would silently ignore them and widen the search. |
| `nameOfMeeting` | `nameOfMeeting` | e.g. 本会議, 予算委員会 |
| `dateFrom`, `dateUntil` | `from`, `until` | YYYY-MM-DD |
| `sessionFrom`, `sessionTo` | `sessionFrom`, `sessionTo` | Diet session numbers (国会回次) |
| `searchRange` | `searchRange` | 冒頭 / 本文 / 冒頭・本文 |
| `maxResults` | — | 1–10,000, default 100 |
| `includeMeetingHeader` | — | Include `speechOrder` 0, the 会議録情報 header (attendance, agenda). Default off. |
| `excludeWitnesses` | — | Drop speeches by 証人・参考人・公述人. Default off. |

### Output

```json
{
  "speechID": "121405254X00220241004_016",
  "issueID": "121405254X00220241004",
  "session": 214,
  "nameOfHouse": "衆議院",
  "nameOfMeeting": "本会議",
  "issue": "第2号",
  "date": "2024-10-04",
  "closing": null,
  "speechOrder": 16,
  "speaker": "石破茂",
  "speakerYomi": "いしばしげる",
  "speakerGroup": "自由民主党・無所属の会",
  "speakerPosition": "内閣総理大臣",
  "speakerRole": null,
  "speech": "○内閣総理大臣（石破茂君）　…",
  "startPage": 2,
  "speechURL": "https://kokkai.ndl.go.jp/txt/121405254X00220241004/16",
  "meetingURL": "https://kokkai.ndl.go.jp/txt/121405254X00220241004",
  "pdfURL": "https://kokkai.ndl.go.jp/img/121405254X00220241004/2",
  "source": "国会会議録検索システム（国立国会図書館） https://kokkai.ndl.go.jp/"
}
```

Results are ordered by meeting date, newest first. The API fixes this order and offers no other sort. The status message reports how many speeches matched in total.

### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| `speech-record` | **$0.002** ($2 per 1,000 speeches) | Each speech saved |
| Actor start | Apify default | Once per run |

If you set a maximum charge for the run, the Actor stops once it is reached.

### FAQ

**Which language are the speeches in?** Japanese. Field names and this README are English; keywords should be Japanese.

**Is it complete?** It returns what the National Diet Library's search API returns, from 1947. The status message reports how many speeches matched in total.

**Can I use the text commercially?** See the copyright note below and check it for your own use.

### Responsible use (please read)

- **Polite access.** The service asks automated clients not to send parallel requests and to wait a few seconds after each response. This Actor sends one request at a time, 100 speeches per page, and waits 3 seconds between pages. Large searches take a while: 10,000 speeches need about 100 requests, roughly 5 minutes.
- **robots.txt** at kokkai.ndl.go.jp is checked before the first request. If it disallows the API path, or cannot be fetched, the run stops without searching.
- **Attribution.** Every row carries a `source` field. When you publish results, credit the 国会会議録検索システム (National Diet Library) and link to `speechURL`.
- **Copyright.** Under Article 40(1) of Japan's Copyright Act, political statements made in public in the Diet may be used freely, except compiling one person's statements into a collection. Check this for your own use; this is not legal advice.
- **Personal data.** Speakers are mostly legislators and officials acting in public roles. Witnesses and invited speakers (証人・参考人・公述人, `speakerRole` set) can be private individuals. Use `excludeWitnesses` if you do not need them, and do not use the data to profile individuals.
- Errors from the API, such as an invalid date, are shown in the run's status message. Timeouts, HTTP 429 and 5xx are retried 3 times with backoff.

### Run locally

```bash
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python -m unittest discover -s tests -t .      # unit tests, API mocked

mkdir -p storage/key_value_stores/default
echo '{"keyword": "子育て支援", "maxResults": 20}' > storage/key_value_stores/default/INPUT.json
python -m src                                   # or `apify run`; results in storage/datasets/default/
ACTOR_TEST_PAY_PER_EVENT=true python -m src     # simulate pay-per-event charging locally
```

### Sources

- API documentation: https://kokkai.ndl.go.jp/api.html
- Help and terms: https://kokkai.ndl.go.jp/help.html

### Related actors

- [AI Crawler Checker & GEO / AEO Audit](https://apify.com/chivalrous_skyline_vtd/ai-search-readiness-audit): check a site for AI search readiness (llms.txt, AI bots, JSON-LD).
- [Video Frame Extractor](https://apify.com/chivalrous_skyline_vtd/video-frame-extractor): frames, scene changes and thumbnails from video file URLs.
- [Stable Diffusion Prompt Extractor](https://apify.com/chivalrous_skyline_vtd/sd-prompt-extractor): read prompts and settings embedded in AI images.
- [Japanese to Romaji, Hiragana & Furigana Converter](https://apify.com/chivalrous_skyline_vtd/japanese-furigana-romaji): readings for Japanese text.

# Actor input Schema

## `keyword` (type: `string`):

Words to find in speeches. Separate several words with a space (all must match).

## `speaker` (type: `string`):

Speaker name, e.g. 石破茂.

## `speakerGroup` (type: `string`):

Parliamentary group name.

## `speakerPosition` (type: `string`):

e.g. 内閣総理大臣.

## `nameOfHouse` (type: `string`):

Leave empty for both houses.

## `nameOfMeeting` (type: `string`):

e.g. 予算委員会, 本会議.

## `dateFrom` (type: `string`):

YYYY-MM-DD

## `dateUntil` (type: `string`):

YYYY-MM-DD

## `sessionFrom` (type: `integer`):

Diet session number.

## `sessionTo` (type: `integer`):

Diet session number.

## `searchRange` (type: `string`):

Where the keyword is searched. Default: the API default.

## `maxResults` (type: `integer`):

Stop after this many speeches (1–10,000). The API is read politely, about 100 speeches every few seconds.

## `includeMeetingHeader` (type: `boolean`):

Also return speechOrder 0 (会議録情報: attendance list and agenda).

## `excludeWitnesses` (type: `boolean`):

Drop speeches by 証人・参考人・公述人 (usually private individuals invited to testify).

## Actor input object example

```json
{
  "keyword": "子育て支援",
  "maxResults": 20,
  "includeMeetingHeader": false,
  "excludeWitnesses": false
}
```

# Actor output Schema

## `results` (type: `string`):

Results in the run's default dataset.

# 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 = {
    "keyword": "子育て支援",
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("chivalrous_skyline_vtd/japan-diet-minutes").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 = {
    "keyword": "子育て支援",
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("chivalrous_skyline_vtd/japan-diet-minutes").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 '{
  "keyword": "子育て支援",
  "maxResults": 20
}' |
apify call chivalrous_skyline_vtd/japan-diet-minutes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chivalrous_skyline_vtd/japan-diet-minutes"
        }
    }
}
```

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/8dEW5dsJPrTljMSP7/builds/WIEb0YD4NgSGFijVB/openapi.json
