# CBS Local Scraper (`lukass/cbs-local-scraper`) Actor

Scrape news data from cbslocal.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/lukass/cbs-local-scraper.md
- **Developed by:** [Lukáš Širhal](https://apify.com/lukass) (community)
- **Categories:** News
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 1 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

### What does CBS Local Scraper do?

CBS Local Scraper extracts data from cbslocal.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 CBS Local 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 CBS Local

CBS Local 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 CBS Local
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 CBS Local?

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 CBS Local?

CBS Local 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 CBS Local Scraper.

### Is it legal to scrape CBS Local?

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 CBS Local.

### 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://cbslocal.com/"
    }
  ],
  "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://cbslocal.com/"
        }
    ],
    "maxArticlesPerCrawl": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("lukass/cbs-local-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://cbslocal.com/" }],
    "maxArticlesPerCrawl": 100,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lukass/cbs-local-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/r8OrDwrBVZdW8WcgX/builds/xZqqqw94FdDtMvTaS/openapi.json
