# Yahoo Japan News Comments (`ryyos/yahoo-japan-news-comments-scraper`) Actor

\[0.5/1000]Extract user comments from any Yahoo! News Japan (news.yahoo.co.jp) article - just paste a pickup or article link. Choose Recommended or Newest sort order and get clean, structured comment data with reaction counts in seconds.

- **URL**: https://apify.com/ryyos/yahoo-japan-news-comments-scraper.md
- **Developed by:** [Rio Dwi Saputra](https://apify.com/ryyos) (community)
- **Categories:** News, Automation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Yahoo Japan News Comments Scraper - Extract Reader Comments in Seconds

**Turn any Yahoo! News Japan article into structured comment data.** Paste a pickup link or an
article link and this Actor fetches reader comments (ヤフコメ) with your choice of sort order -
Recommended (おすすめ順) or Newest (新着順) - along with reaction counts (empathy, insight,
negative). No browser automation needed: comments are pulled directly from the same
server-rendered data Yahoo! News Japan sends to real visitors, so runs are fast and cheap.

### Why use this Actor?

- **Sentiment and public-opinion research** - pull hundreds of real reader comments per article
  for analysis, trend tracking, or NLP pipelines.
- **Monitor reactions to breaking news** - schedule this Actor on Apify to track how comment
  volume and sentiment evolve over time on a developing story.
- **Flexible input** - paste whatever link you have on hand: a `/pickup/{id}` link, a canonical
  `/articles/{hash}` link, or a direct `/comments` link. The Actor resolves it automatically.

### How to use Yahoo Japan News Comments Scraper

1. Click **Try for free** or **Start** on the Apify Console.
2. Paste an **Article URL** - e.g. `https://news.yahoo.co.jp/pickup/6589702`.
3. Choose a **Sort order**: Recommended or Newest.
4. Set **Max comments** to control how many comments to fetch.
5. Run the Actor and download your results as JSON, CSV, or Excel from the Output tab.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `articleUrl` | string | *(required)* | A `/pickup/{id}`, `/articles/{hash}`, or `/articles/{hash}/comments` link from news.yahoo.co.jp. |
| `sortOrder` | string (enum) | `recommended` | `recommended` (おすすめ順) or `newer` (新着順). |
| `maxComments` | integer | `50` | Maximum number of comments to fetch (10 per page). |
| `proxyConfiguration` | object | `{"useApifyProxy": false}` | Optional Apify Proxy configuration, recommended for large runs. |

See `.actor/input_schema.json` for the full definition.

### Output

Example output item:

```json
{
  "commentId": "85cc8387-bd69-4903-8dfd-0466148efb4b",
  "text": "高速道路の1メートルの隆起や新幹線の運休など、交通網の被害の大きさに驚いています。...",
  "userName": "cmx********",
  "postDate": "3時間前",
  "empathyCount": 246,
  "insightCount": 33,
  "negativeCount": 28,
  "permalink": "https://news.yahoo.co.jp/profile/news/comments/85cc8387-bd69-4903-8dfd-0466148efb4b",
  "profileUrl": "https://news.yahoo.co.jp/users/s3MdpciCk2JcZC1-VVktYBbnnDwDASDii4NOQIwAY7CzPZPh00"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

#### Data fields

| Field | Description |
|---|---|
| `commentId` | Yahoo!'s internal comment UUID. |
| `text` | Comment body text. |
| `userName` | Masked commenter handle as shown publicly (e.g. `cmx********`). |
| `postDate` | Relative post time as shown on the page (e.g. `3時間前`). |
| `empathyCount` | Count of 共感 (empathy) reactions. |
| `insightCount` | Count of なるほど (insightful) reactions. |
| `negativeCount` | Count of うーん (negative) reactions. |
| `permalink` | Direct link to this comment. |
| `profileUrl` | Link to the commenter's public profile. |

### Pricing

This Actor only performs lightweight HTTP requests (no browser), so fetching 50 comments
typically takes just a few seconds and runs cheaply even on the free Apify plan.

### Tips

- `maxComments` controls how many pages are fetched (10 comments per page) - keep it reasonable
  for frequently scheduled runs.
- Articles with very few comments will simply return fewer items than `maxComments`; this is
  expected, not an error.

### FAQ

**Is this legal?** Scraping publicly available web pages carries legal and Terms of Service
considerations that vary by jurisdiction and use case. Review Yahoo! News Japan's own terms
before relying on this data for anything beyond personal or research use, and use this Actor
responsibly.

**Found a bug or have a feature request?** Use the Issues tab on this Actor's page. Custom
scraping solutions are also available on request.

### Development

```bash
python -m venv .venv
.venv/Scripts/pip install -r requirements-dev.txt
pytest tests/
apify validate-schema
apify run --input-file test-inputs/pickup-recommended.json --purge
apify run --input-file test-inputs/article-newer.json --purge
```

No environment variables are required; this Actor only reads publicly served HTML pages.

# Actor input Schema

## `articleUrl` (type: `string`):

A Yahoo! News Japan article link. Accepts a pickup link (e.g. https://news.yahoo.co.jp/pickup/6589702), a canonical article link (e.g. https://news.yahoo.co.jp/articles/{hash}), or a direct comments link (.../articles/{hash}/comments). The Actor resolves pickup links to the underlying article automatically.

## `sortOrder` (type: `string`):

Comment sort order, matching the two options offered on the Yahoo! News Japan comments page.

## `maxComments` (type: `integer`):

Maximum number of comments to fetch. The Actor pages through the comments list (10 comments per page) until this limit is reached or there are no more comments.

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

Optional proxy configuration. Recommended when fetching a large number of comments to reduce the chance of rate limiting.

## Actor input object example

```json
{
  "articleUrl": "https://news.yahoo.co.jp/pickup/6589702",
  "sortOrder": "recommended",
  "maxComments": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `comments` (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 = {
    "articleUrl": "https://news.yahoo.co.jp/pickup/6589702"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ryyos/yahoo-japan-news-comments-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 = { "articleUrl": "https://news.yahoo.co.jp/pickup/6589702" }

# Run the Actor and wait for it to finish
run = client.actor("ryyos/yahoo-japan-news-comments-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 '{
  "articleUrl": "https://news.yahoo.co.jp/pickup/6589702"
}' |
apify call ryyos/yahoo-japan-news-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ryyos/yahoo-japan-news-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/vmse2hhqmAS3EwhfE/builds/thKdHUZoiGSNvZVlH/openapi.json
