# CNBC Scraper (`maria.f/cnbc-scraper`) Actor

Scrape news data from cnbc.com with this unofficial API. Extract articles, monitor their popularity and performance and automate the fight against fake news. Filter the results by authors, topics, categories, or publication dates. Preview or download the results in your preferred format.

- **URL**: https://apify.com/maria.f/cnbc-scraper.md
- **Developed by:** [Mariachiara Faraon](https://apify.com/maria.f) (community)
- **Categories:** News
- **Stats:** 120 total users, 1 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

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

### What does CNBC Scraper do?

CNBC Scraper extracts data from cnbc.com. It uses a smart algorithm to decide what paged are articles and automatically extracts rich information about each article. It can scrape the entire website with one click.

This free CNBC API will let you scrape and extract large datasets as often as you need to. The structured data can be downloaded as XML, JSON, CSV, HTML, and Excel, so that you can use it in your own applications, spreadsheets, reports, or other tools.

### How to scrape CNBC

CNBC Scraper is really easy to use. Just follow these steps to start scraping.

1. Click *Try for free*
2. Use the default start URLs or customize them to only scrape a section or category on CNBC
3. Select the maximum number of items you want to scrape.
4. Click *Start*
5. Preview and export your data from the *Dataset* tab

### Why scrape CNBC?

Scraping news, articles, and other content can help you gain insights into social media, monitor article popularity, track ad performance, or automate the fight against fake news. Check out how web scraping is being used in the [marketing and media industries](https://apify.com/industries/marketing-and-media) and in [research and education](https://apify.com/industries/research-and-education).

For more inspiration, read [13 ways media companies can use web scraping and automation](https://blog.apify.com/how-can-the-media-use-web-scraping-and-automation/).

### How much will it cost to scrape CNBC?

CNBC Scraper is very cheap to run so you can extract a large amount of articles even on an Apify free plan. If you need to get more data, you should sign up for one of our [paid plans](https://apify.com/pricing). Every Apify plan includes free monthly usage credits that you can use with CNBC Scraper.

### Is it legal to scrape CNBC?

Web scraping is legal, but note that personal data is protected by GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. We also recommend that you read our detailed blog post: [is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

### Copyright and publishing

Please be aware that most articles on the internet are under copyright protection. If you intend to publish or reuse article content, check the terms of use of CNBC.

### Need to scrape a different website?

This scraper is based on [Smart Article Extractor](https://apify.com/lukaskrivka/article-extractor-smart). This powerful web scraping tool can be customized to scrape articles from any website.

# Actor input Schema

## `startUrls` (type: `array`):

Can be main page URL or any category URLs. Article pages are found and enqueued from these.

## `maxArticlesPerCrawl` (type: `integer`):

Maximum number of valid articles scraped. The crawler will stop automatically after reaching this number.

## `dateFrom` (type: `string`):

Only articles from this day to present will be scraped. If empty, all articles will be scraped. Format is YYYY-MM-DD, e.g. 2019-12-31, or Number type e.g. 1 week or 20 days

## `onlyNewArticlesPerDomain` (type: `boolean`):

If true, will scrape only new articles each time you run it. All URLs you scraped are compared with saved ones. Scraped articles are saved in one dataset per each domain, datasets are named 'ARTICLES-SCRAPED-domain'

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.cnbc.com/world/?region=world"
    }
  ],
  "maxArticlesPerCrawl": 100,
  "onlyNewArticlesPerDomain": false
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.cnbc.com/world/?region=world"
        }
    ],
    "maxArticlesPerCrawl": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("maria.f/cnbc-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 = {
    "startUrls": [{ "url": "https://www.cnbc.com/world/?region=world" }],
    "maxArticlesPerCrawl": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("maria.f/cnbc-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 '{
  "startUrls": [
    {
      "url": "https://www.cnbc.com/world/?region=world"
    }
  ],
  "maxArticlesPerCrawl": 100
}' |
apify call maria.f/cnbc-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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