# People's Financial News Scraper (`dadaodb/peoples-financial-news-scraper`) Actor

Scrape flash news from People's Financial News (人民财讯/证券时报), a famous financial news site in China.

- **URL**: https://apify.com/dadaodb/peoples-financial-news-scraper.md
- **Developed by:** [DaDao DB](https://apify.com/dadaodb) (community)
- **Categories:** News
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## People's Financial News Scraper

Scrape flash news from People's Financial News (人民财讯) by The Securities Times(证券时报), a state-owned financial news site in China.

### Features

- Fetches flash news items from People's Financial News' flash news API endpoint
- Configurable number of news items to retrieve (up to 500)
- Handles pagination automatically for large requests
- Input validation to ensure proper parameters
- Efficient data collection with rate limiting to avoid API restrictions

### Input Schema

The scraper accepts the following input parameter:

```json
{
  "numOfNews": 10
}
```

- numOfNews : The number of flash news items to retrieve (integer between 1-500)

### Usage

1. Run the actor on the Apify platform
2. Wait for the extraction to complete
3. Access the extracted data in the "Dataset" tab

### Output Format

The output is an array of news items with the following structure:

```json
[
  {
    "id": "1830463",
    "actionType": "news",
    "url": "/article/detail/1830463.html",
    "web_url": "/article/detail/1830463.html",
    "title": "土耳其外长会见乌克兰外长 讨论俄乌谈判筹备工作",
    "source": "央视新闻",
    "time": 1747229127000,
    "show_time": "1747229127",
    "pageTime": "1830463",
    "isRed": 0,
    "red": 0,
    "isTop": 0,
    "content": "人民财讯5月14日电，当地时间5月14日，土耳其外交部发布消息称，土耳其外长费丹当天在安塔利亚会见乌克兰外长瑟比加。双方就土耳其拟主办的旨在推动俄乌实现和平的谈判安排，以及乌克兰总统泽连斯基即将访土的筹备工作进行了磋商。（央视新闻）",
    "liked": false,
    "hasFav": false,
    "favUrl": "https://www.stcn.com/operation/collect.html",
    "audio": "",
    "share_url": "https://www.stcn.com/article/detail/1830463.html",
    "share": {
      "title": "土耳其外长会见乌克兰外长 讨论俄乌谈判筹备工作",
      "description": "人民财讯5月14日电，当地时间5月14日，土耳其外交部发布消息称，土耳其外长费丹当天在安塔利亚会见乌克兰外长瑟比加。双方就土耳其拟主办的旨在推动俄乌实现和平的谈判安排，以及乌克兰总统泽连斯基即将访土的筹备工作进行了磋商。（央视新闻）",
      "image": "https://static-web.stcn.com/app_default/xwzx_app/images/default_img/rmcx20250226.png",
      "url": "https://www.stcn.com/article/detail/1830463.html"
    }
  },
  ...
]
```

### Usage

- Set up your input parameters in the Apify platform or locally
- Set numOfNews to the desired number of news items (1-500)
- Run the Actor
- The Actor will automatically handle pagination and rate limiting
- Progress is logged to the console
- Access the collected data in the Actor's default dataset
- Data is stored in JSON format
- Each item contains complete news information including title, content, source, and timestamps

# Actor input Schema

## `numOfNews` (type: `integer`):

The number of news you want to get. The number must be between 1 and 500. The default value is 10.

## Actor input object example

```json
{
  "numOfNews": 10
}
```

# 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 = {
    "numOfNews": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("dadaodb/peoples-financial-news-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 = { "numOfNews": 10 }

# Run the Actor and wait for it to finish
run = client.actor("dadaodb/peoples-financial-news-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 '{
  "numOfNews": 10
}' |
apify call dadaodb/peoples-financial-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dadaodb/peoples-financial-news-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/52E9flSnTqFYc8GZ6/builds/IJoZNsaevwVebfeRb/openapi.json
