# Japan Rice Prices by Prefecture & Variety (MAFF Monthly) (`vespa-zzz/jp-rice-wholesale-prices`) Actor

Monthly contract (相対取引) prices per 60 kg and volumes of Japanese rice by prefecture and variety from MAFF, e.g. Niigata Koshihikari. National average, crop-year averages, revision monitoring.

- **URL**: https://apify.com/vespa-zzz/jp-rice-wholesale-prices.md
- **Developed by:** [Vespa ZZZ](https://apify.com/vespa-zzz) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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 Rice Prices by Prefecture & Variety (MAFF Monthly)

Monthly **contract prices and volumes of Japanese rice** (相対取引価格・数量) by producing prefecture and variety —
Niigata Koshihikari (Uonuma, Sado, general …), Hokkaido Yumepirika, Akita Akitakomachi and about 120 others — as published
by Japan's Ministry of Agriculture, Forestry and Fisheries (MAFF). Includes the national average price and total
volume, crop-year averages to date and the previous crop year's average for comparison.

These are the prices agreed between shippers (JA groups and other collectors) and wholesalers — the reference price for
the Japanese rice market. Typical users: food manufacturers, restaurant chains and retailers buying rice, commodity
analysts and journalists following Japan's rice prices, and AI agents answering "how much does rice cost in Japan".

### What you can do

- Get the **latest month** (default) or any of the months MAFF currently lists (`months`, `latestMonths`).
- Filter by **prefecture** (`新潟`, `北海道` …) and **variety** (`コシヒカリ`, `魚沼`, `ゆめぴりか` …).
- **Monitor** with `onlyNew`: each run re-reads every month MAFF still lists (about 14 small files) and returns only new
  rows and **revised figures** (MAFF corrects preliminary figures, also for earlier months; corrections come back with
  `changeType: "revision"`). Rows left over by a spending limit or `maxItems` are returned by the next run. Run one
  monitor per `stateKey` at a time; a run that finds the state changed by another run stops before pushing more rows.
  After an upgrade from an earlier version of this Actor, the first monitoring run may report already-seen rows once
  more as revisions.

### Input examples

Niigata, latest month:

```json
{ "prefectures": ["新潟"] }
```

Koshihikari everywhere, last six months:

```json
{ "varieties": ["コシヒカリ"], "latestMonths": 6 }
```

Monthly monitor (schedule it weekly):

```json
{ "onlyNew": true, "stateKey": "rice" }
```

Around September a month can belong to two crop years (the old crop's last month and the new crop's first); both are
returned, distinguished by `cropYear`.

### Output example

```json
{
  "tradeMonth": "2026-10",
  "cropYear": 2026,
  "prefectureJa": "新潟",
  "varietyJa": "コシヒカリ（魚沼）",
  "isNationalTotal": false,
  "priceYenPer60kg": 27734,
  "quantityTonnes": 1733,
  "cropYearAveragePriceYenPer60kg": 26593,
  "previousCropYearAveragePriceYenPer60kg": 40682,
  "previousCropYearAverageUntil": "2026-10",
  "isPreliminary": true,
  "sourceFileUrl": "https://www.maff.go.jp/j/seisan/keikaku/soukatu/0810_08nensan_kakaku.csv",
  "source": "Ministry of Agriculture, Forestry and Fisheries (MAFF), Japan — 米の相対取引価格・数量 …"
}
```

- `priceYenPer60kg`: price in yen per 60 kg of brown rice for the month, as published by MAFF (MAFF's notes in the
  monthly PDF define it as the grade-1 price including transport, packaging and consumption tax).
- `quantityTonnes`: contracted volume in tonnes for the month.
- `cropYearAveragePriceYenPer60kg`: average from the start of the crop year to this month; in the first month it equals
  the month's price. `previousCropYearAveragePriceYenPer60kg` is the previous crop year's average up to
  `previousCropYearAverageUntil`, the comparison base MAFF uses.
- The national row has `isNationalTotal: true` and no prefecture or variety (only when no filter is set).
- Figures MAFF leaves blank (`-`, e.g. no contracts that month) are `null`, never 0.

The run fails with a clear message, instead of guessing, if a file's columns do not match its month and crop year, if a
value is not a number, or if the national total row is missing. The run summary (key-value store record `RUN_SUMMARY`)
lists the files read and the months available.

### Data source and terms

- Source: 農林水産省「米の相対取引価格・数量、契約・販売状況、民間在庫の推移等」
  (https://www.maff.go.jp/j/seisan/keikaku/soukatu/aitaikakaku.html). Reused under the MAFF website terms of use
  (compatible with CC BY 4.0) with attribution; **this Actor processes the data** (column selection, number parsing,
  normalised months and crop years).
- Not affiliated with or endorsed by MAFF. One run downloads the list page and one small CSV per month, with a pause
  between requests (MAFF's robots.txt disallows only unrelated procurement paths and sets no crawl delay).
- All selected files are downloaded and checked before anything is output; a truncated or changed file stops the run
  with a clear message. If you ask for more months than MAFF lists, the run summary reports the shortfall.

### 日本語の概要

農林水産省が毎月公表する「米の相対取引価格・数量」を、産地・品種銘柄ごとに取得します（玄米60kg当たりの価格、契約数量、
年産平均価格、前年産平均価格、全銘柄平均）。最新月または指定月、産地・銘柄の絞り込み、速報値の訂正検知（監視モード）に
対応。出典: 農林水産省ウェブサイト（本 Actor で加工）。

# Actor input Schema

## `months` (type: `array`):

Trade months as YYYY-MM, e.g. 2026-10. When a month belongs to two crop years (around September), both are returned. Empty = the latest months (see below). In monitoring mode, setting Months limits the check to those months.

## `latestMonths` (type: `integer`):

When Months is empty and monitoring is off: how many of the most recent months to return. In monitoring mode every listed month is checked instead.

## `prefectures` (type: `array`):

Producing prefectures as written by MAFF, e.g. 新潟, 北海道, 秋田. Empty = all.

## `varieties` (type: `array`):

Words in the variety/brand name, e.g. コシヒカリ, ゆめぴりか, 魚沼. Full-/half-width insensitive.

## `includeNationalTotal` (type: `boolean`):

Add the national average price / total volume row (only when no prefecture or variety filter is set).

## `onlyNew` (type: `boolean`):

Re-read every month MAFF lists and output only new or changed rows since the previous run with the same state key (MAFF corrects preliminary figures, also for earlier months; corrections are returned with changeType = revision). Months / Latest months are ignored unless Months is set.

## `stateKey` (type: `string`):

Name of the saved monitoring state. Letters, digits, - and \_ only.

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

Maximum rows per run.

## Actor input object example

```json
{
  "latestMonths": 1,
  "prefectures": [
    "新潟"
  ],
  "includeNationalTotal": true,
  "onlyNew": false,
  "stateKey": "default",
  "maxItems": 5000
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

## `runSummary` (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 = {
    "prefectures": [
        "新潟"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vespa-zzz/jp-rice-wholesale-prices").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 = { "prefectures": ["新潟"] }

# Run the Actor and wait for it to finish
run = client.actor("vespa-zzz/jp-rice-wholesale-prices").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 '{
  "prefectures": [
    "新潟"
  ]
}' |
apify call vespa-zzz/jp-rice-wholesale-prices --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vespa-zzz/jp-rice-wholesale-prices"
        }
    }
}
```

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/loFOD0ALIIUQQuC7E/builds/39yK4e6nMmRezs1x5/openapi.json
