# Rakuten Ichiba Products & Price Scraper (Japan) (`xtracto/rakuten-products-scraper`) Actor

Scrape product listings from Rakuten Ichiba, Japan's largest online marketplace. Every row carries the price, sold-out state, shop code and name, review count and rating, shipping, Rakuten point rate, genre path and brand — from the server-rendered state, no API key and no browser.

- **URL**: https://apify.com/xtracto/rakuten-products-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Rakuten Ichiba Products & Price Scraper (Japan)

Scrape product listings from **Rakuten Ichiba**, Japan's largest online
marketplace.

### What you get

One row per product (`recordType: PRODUCT`), from a 35-field upstream record:

`itemCode` · `variantId` · `productName` · `itemUrl` · `shopCode` ·
`shopName` · `shopUrl` · `price` · `isSoldOut` · `hasPriceRange` ·
`reviewCount` · `reviewAverage` · `shippingCost` · `shippingFree` ·
`shippingFreeThreshold` · `shippingText` · `pointCount` ·
`pointBaseMultiplier` · `genreIdPath` · `brandName` · `imageUrl` ·
`searchRank` · `pageNumber`

…plus the full upstream object spread in verbatim, a `SEARCH_SUMMARY` per
query, and an `ERROR` row per failed input — **every input maps to at least
one row**.

`itemUrl` is the stable, shareable item page. Rakuten's own `url` field is a
click-tracking redirect carrying a per-request token that expires; it is kept
as `trackingUrl` rather than passed off as the product link.

### Example input

```json
{
  "searchQueries": ["ノートパソコン", "laptop"],
  "sortBy": "2",
  "maxProductsPerQuery": 400,
  "includeSoldOut": false
}
```

### Known limits — read before you buy

- **The reachable window is sort-dependent, by more than 10×.** For the same
  query (`laptop`, `numFound: 127,841`):

  | Sort | Rakuten's published reachable `subset` | Pages |
  |---|---|---|
  | none / Standard | **6,750** | 150 |
  | Price low→high | **405** | 9 |

  Rakuten publishes that number itself in every response, and this actor
  **reads it** rather than hardcoding a page count — a fixed 150 would have
  driven 141 pointless requests on any sorted run, each one re-serving page 1.
  The summary row carries `upstreamNumFound`, `upstreamReachableSubset` and
  `reachablePageCeiling` side by side.

- **Past the ceiling, Rakuten re-serves page 1.** HTTP 200, a full 50-row
  page, `pagination.start` back to 0 — page 200 overlapped 49 of 50 items with
  page 1. The stop condition is upstream's own `start` echo, never "empty
  page", which would loop forever collecting duplicates.

- **An unknown sort value is not ignored — it becomes "newest".** `s=-1` and
  `s=99` both return exactly what `s=1` returns. A typo would silently reorder
  your entire result set while looking like a default run, so this actor
  refuses unknown values at input validation instead.

- **A page carries 50 items but the paging stride is 45.** The extra five are
  promoted placements that do not advance the offset. A client that derives
  the next offset from `len(items)` skips five real products per page; this
  one takes the offset from `pagination.start + pageSize`.

- **No detail-page pass.** The listing row already carries price, stock, shop
  identity, reviews, shipping, points and genre. A detail pass would double the
  requests to re-fetch what is in hand. Brand is the exception: upstream's own
  `brand` was null on 45 of 45 rows across several queries, so it is usually
  absent from the listing rather than dropped here.

- **Three field names were guessed and produced null on every row.**
  `shipping.free`, `shipping.text` and `point.rate` do not exist. The real keys
  are `shipping.price`, `shipping.estimateDeliveryDay` and
  `point.baseMultiplier`, so free shipping, the delivery promise and the point
  multiplier were all missing while looking like "this product has none".
  Fixed 2026-09-24, with a control that could disagree: `shipping.price` is 0 on
  45 of 45 wireless-earphone rows, which proves nothing on its own, but a
  3-seat-sofa page returns 880 and a large-fridge page returns 4,000 and 6,600.
  So 0 really means free, and free shipping is simply near-universal in light
  goods.

### How it works

No API key, no login, no browser. The listing arrives server-rendered in
`<script>window.__INITIAL_STATE__ = {…}</script>` (~236 KB), at
`state.data.ichibaSearch`.

The blob must be read with a **balanced-brace walker**, not a regex: a
non-greedy `\{.*?\}\s*</script>` overshoots the real end by ~330 bytes and
dies with `Extra data: line 1 column 236024`, because the state contains both
nested objects and literal braces inside string values.

### Policy

`rakuten.co.jp/robots.txt` names no AI crawler, and `/search/mall/` is allowed
for `User-agent: *`. Only public product listings are read — no login, no user
data, no personal profiles.

# Actor input Schema

## `searchQueries` (type: `array`):

Product keywords to search on Rakuten Ichiba, one per entry. Japanese or English both work. Each query reaches roughly 6,750 products — Rakuten publishes that reachable subset itself and re-serves page 1 beyond it, so several narrow queries beat one broad one.

## `sortBy` (type: `string`):

How results are ordered. Only codes verified to change the result set are offered. Important: Rakuten does NOT ignore an unrecognised sort value — it silently treats it as 'newest first', so a typo would reorder everything while looking like a default run. This actor refuses unknown values instead. Note: applying a sort also shrinks how deep you can page — Rakuten publishes a reachable subset of ~6,750 rows unsorted but only ~405 when sorted by price, for the same query.

## `maxProductsPerQuery` (type: `integer`):

Stop after this many products per query. Rakuten publishes its own reachable ceiling per response and this actor reads it: about 6,750 rows (150 pages) for an unsorted query, but as few as ~405 (9 pages) once a sort is applied. Beyond it Rakuten re-serves page 1, and the run stops there and says so.

## `includeSoldOut` (type: `boolean`):

Keep items Rakuten marks as sold out. They are always flagged with 'isSoldOut' either way. Turn this off for a clean in-stock price comparison.

## `maxConcurrency` (type: `integer`):

Upper bound on requests in flight across all queries. Paging inside one query is always sequential, because each page's stop condition depends on the previous response's offset echo.

## `minRequestInterval` (type: `string`):

Minimum delay between the START of consecutive requests. This, not concurrency, is the honest speed control: once the rate cap binds, extra concurrency buys nothing.

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

Proxy used for every request. Datacenter pinned to Japan is the default — no bot mitigation was observed on any TLS profile, but Rakuten serves prices, shipping and Rakuten-point rates for the local market, so a non-Japanese exit is a correctness risk before it is a blocking one.

## Actor input object example

```json
{
  "searchQueries": [
    "laptop"
  ],
  "sortBy": "",
  "maxProductsPerQuery": 100,
  "includeSoldOut": true,
  "maxConcurrency": 3,
  "minRequestInterval": "0.6",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# 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 = {
    "searchQueries": [
        "laptop"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/rakuten-products-scraper").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 = { "searchQueries": ["laptop"] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/rakuten-products-scraper").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 '{
  "searchQueries": [
    "laptop"
  ]
}' |
apify call xtracto/rakuten-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/rakuten-products-scraper"
        }
    }
}
```

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/mmywRkwNeK1CJblpB/builds/HuoR9h614JIePHznx/openapi.json
