# Rakuten Travel Scraper (`shiokoshi356/rakuten-travel-scraper`) Actor

Scrape Rakuten Travel hotel data via official API. Search hotels by location, get details, rankings, and availability across Japan.

- **URL**: https://apify.com/shiokoshi356/rakuten-travel-scraper.md
- **Developed by:** [Shiokoshi356](https://apify.com/shiokoshi356) (community)
- **Categories:** E-commerce, Travel
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Rakuten Travel Scraper

Apify Actor to scrape Japan hotel data from Rakuten Travel using the official Rakuten Travel API. Search hotels by keyword, retrieve hotel rankings, and collect detailed hotel information across all regions of Japan.

### Features

- **Keyword Hotel Search**: Search for hotels by keyword (e.g., "Tokyo", "Osaka", "Kyoto") using the Rakuten Travel KeywordHotelSearch API
- **Hotel Rankings**: Retrieve Rakuten Travel's hotel popularity rankings by genre (overall, onsen, etc.)
- **Automatic Pagination**: Fetches multiple pages of results up to your specified limit
- **Rate Limiting**: Built-in 1 request/second rate limiting to comply with Rakuten API guidelines
- **Retry Logic**: Automatic retry with exponential backoff on transient errors

### Use Cases

- Collect Japan hotel data for market research and price analysis
- Monitor hotel availability and pricing trends across Japanese cities
- Build hotel comparison datasets for travel planning tools
- Aggregate Rakuten Travel hotel reviews and ratings

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `application_id` | string | Yes | - | Rakuten API Application ID |
| `access_key` | string | Yes | - | Rakuten API Access Key |
| `mode` | string | No | `search` | `search` for keyword search, `ranking` for hotel rankings |
| `keyword` | string | No | - | Search keyword (e.g., "Tokyo", "Osaka") |
| `genre` | string | No | `all` | Ranking genre (e.g., "all", "onsen") |
| `max_results` | integer | No | 30 | Maximum results (1-1000) |
| `log_level` | string | No | `INFO` | Logging level (DEBUG/INFO/WARNING/ERROR) |

### Output

Each hotel record contains:

- `hotel_name` - Hotel name
- `hotel_id` - Rakuten hotel number
- `hotel_special` - Hotel description/highlights
- `hotel_min_charge` - Minimum room price (JPY)
- `latitude` / `longitude` - Geographic coordinates
- `postal_code` - Postal code
- `address` - Full address
- `telephone` - Phone number
- `access` - Transportation access information
- `parking` - Parking information
- `nearest_station` - Nearest train station
- `hotel_image_url` / `hotel_thumbnail_url` - Hotel images
- `review_count` - Number of reviews
- `review_average` - Average review score
- `hotel_url` - Rakuten Travel hotel page URL
- `plan_list_url` - Rakuten Travel plan list URL
- `area_name` - Area/region name (ranking mode)

### Getting API Credentials

1. Register at [Rakuten Web Service](https://webservice.rakuten.co.jp/)
2. Create an application to get your Application ID and Access Key
3. Both credentials are free to obtain

### Example Input

#### Search Mode

```json
{
    "application_id": "YOUR_APP_ID",
    "access_key": "YOUR_ACCESS_KEY",
    "mode": "search",
    "keyword": "Tokyo",
    "max_results": 50
}
````

#### Ranking Mode

```json
{
    "application_id": "YOUR_APP_ID",
    "access_key": "YOUR_ACCESS_KEY",
    "mode": "ranking",
    "genre": "all",
    "max_results": 10
}
```

### Technical Details

- Uses the new `openapi.rakuten.co.jp` API domain (migrated Feb 2026)
- Built with Python 3.12, aiohttp, Pydantic v2
- Structured JSON logging via structlog
- Fully typed with comprehensive test coverage

# Actor input Schema

## `application_id` (type: `string`):

Rakuten API Application ID (required, free to obtain at https://webservice.rakuten.co.jp/).

## `access_key` (type: `string`):

Rakuten API Access Key (required since Feb 2026 migration, obtain at https://webservice.rakuten.co.jp/).

## `mode` (type: `string`):

Search mode: 'search' for keyword hotel search, 'ranking' for hotel popularity rankings.

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

Search keyword (e.g., 'Tokyo', 'Osaka', '東京'). Used in search mode with KeywordHotelSearch API.

## `genre` (type: `string`):

Genre for hotel ranking mode (e.g., 'all', 'onsen').

## `max_results` (type: `integer`):

Maximum number of hotel results to return (max 1000).

## `log_level` (type: `string`):

Logging verbosity.

## Actor input object example

```json
{
  "mode": "search",
  "genre": "all",
  "max_results": 30,
  "log_level": "INFO"
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("shiokoshi356/rakuten-travel-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("shiokoshi356/rakuten-travel-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call shiokoshi356/rakuten-travel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shiokoshi356/rakuten-travel-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Rakuten Travel Scraper",
        "description": "Scrape Rakuten Travel hotel data via official API. Search hotels by location, get details, rankings, and availability across Japan.",
        "version": "0.1",
        "x-build-id": "OZ9Mdk8fKpsWxb9xC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shiokoshi356~rakuten-travel-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shiokoshi356-rakuten-travel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/shiokoshi356~rakuten-travel-scraper/runs": {
            "post": {
                "operationId": "runs-sync-shiokoshi356-rakuten-travel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/shiokoshi356~rakuten-travel-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-shiokoshi356-rakuten-travel-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "application_id",
                    "access_key"
                ],
                "properties": {
                    "application_id": {
                        "title": "Application ID",
                        "type": "string",
                        "description": "Rakuten API Application ID (required, free to obtain at https://webservice.rakuten.co.jp/)."
                    },
                    "access_key": {
                        "title": "Access Key",
                        "type": "string",
                        "description": "Rakuten API Access Key (required since Feb 2026 migration, obtain at https://webservice.rakuten.co.jp/)."
                    },
                    "mode": {
                        "title": "Search Mode",
                        "enum": [
                            "search",
                            "ranking"
                        ],
                        "type": "string",
                        "description": "Search mode: 'search' for keyword hotel search, 'ranking' for hotel popularity rankings.",
                        "default": "search"
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Search keyword (e.g., 'Tokyo', 'Osaka', '東京'). Used in search mode with KeywordHotelSearch API."
                    },
                    "genre": {
                        "title": "Ranking Genre",
                        "type": "string",
                        "description": "Genre for hotel ranking mode (e.g., 'all', 'onsen').",
                        "default": "all"
                    },
                    "max_results": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of hotel results to return (max 1000).",
                        "default": 30
                    },
                    "log_level": {
                        "title": "Log Level",
                        "enum": [
                            "DEBUG",
                            "INFO",
                            "WARNING",
                            "ERROR"
                        ],
                        "type": "string",
                        "description": "Logging verbosity.",
                        "default": "INFO"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
