# CNN Search Scraper (`scrapyx/cnn-search-scraper`) Actor

Runs keyword searches against CNN.com's own search index and returns matching articles, videos and photo galleries -- headline, URL, thumbnail, modified date and teaser, with optional full article body, author, section and publish date fetched from each result's page.

- **URL**: https://apify.com/scrapyx/cnn-search-scraper.md
- **Developed by:** [Ibnu Adzim](https://apify.com/scrapyx) (community)
- **Categories:** News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## CNN Search Scraper

Runs **keyword searches against CNN.com's own search index** and returns the
matching articles, videos and photo galleries.

| | |
| --- | --- |
| **Covers** | `www.cnn.com` only — see Limits |
| **Content types** | articles, videos, photo galleries |
| **Returns** | headline, URL, thumbnail, modified date, teaser; optionally full article body, author, section and publish date |
| **Method** | HTTP only, one unauthenticated JSON endpoint. No browser, no login, no API key |

### Example input

```json
{
  "queries": ["climate change", "artificial intelligence"],
  "contentTypes": ["article", "video"],
  "sort": "relevance",
  "maxItemsPerQuery": 50,
  "includeFullBody": true
}
```

### Output

Every row carries `_input`, `_source`, `_scrapedAt`, `recordType`. Three record
types share the dataset: `SEARCH_RESULT` (one per hit), `SEARCH_SUMMARY` (one per
query + content type, with CNN's own reported total and the filters actually
applied) and `ERROR`. Every input maps to at least one row.

### Limits — read these, they are not obvious

- **Flagship only.** CNN's search index covers `www.cnn.com`. It does **not**
  include CNN en Español, Arabic, Brasil, Indonesia or any licensee edition —
  verified by searching `mexico` and `brasil` and finding only `www.cnn.com`
  hosts in every result. Use the **CNN Articles Scraper** for the other editions.
- **1,000-result hard ceiling.** CNN answers any offset at or beyond 1000 with an
  HTTP 403. A query can therefore never yield more than 1,000 rows regardless of
  the total it reports. Runs that reach it say so via `_warning` on the summary
  row rather than looking quietly truncated.
- **`searchTeaser` is not the article body.** The search API's own text field is
  a one-sentence teaser (measured 103–230 characters against real bodies of
  2,000–7,000). It is emitted under its own name so it cannot be mistaken for
  full text; set `includeFullBody` for the real thing.
- **The index is small.** Measured totals: `trump` 23, `2026` 233, `russia` 109,
  `news` 15. Common stopwords (`the`, `people`) return zero.
- **Only three content types and two sort orders are real.** See below.

### Two silent-fallback traps this actor guards against

CNN's API does not reject an unknown `types` or `sort` value — it *ignores* it
and returns something plausible:

- an unrecognised `types` returns the **unfiltered** result set (measured `of=157`
  for every invalid value, versus 14 / 132 / 407 for `article` / `video` /
  `gallery`)
- an unrecognised `sort` silently behaves as `newest`

Both are therefore rejected in code, not just in the Console enum — an API or CLI
run never sees a Console enum. Passing `contentTypes: ["live-story"]` returns a
named `invalid_input` error instead of a full unfiltered dump that looks like a
successful narrow search.

# Actor input Schema

## `queries` (type: `array`):

One search term per entry. Each term is run against CNN's own search index and gets its own SEARCH\_SUMMARY row. Single very common words can score as stopwords and return nothing -- 'a' returns 0 results while 'trump' returns 28.

## `contentTypes` (type: `array`):

Which kinds of content to search for. Each type is a separate query with its own summary row. Only these three are real: CNN's API silently ignores any other value and returns UNFILTERED results instead of an error, so this actor rejects anything else rather than passing it through.

## `sort` (type: `string`):

Newest first, or by CNN's own relevance score. Only these two values are real -- CNN's API silently treats 'oldest', 'relevancy' and 'score' as 'newest'.

## `maxItemsPerQuery` (type: `integer`):

Cap on results per search term per content type. Set to 0 for as many as CNN will serve. CNN's API refuses any offset at or beyond 1000 with an HTTP 403, so 1000 is a hard upstream ceiling regardless of what the reported total claims -- runs that hit it say so in the summary row.

## `includeFullBody` (type: `boolean`):

Fetch each result's own page and extract the complete article text plus author, section and publish date. Off by default because it costs one extra request per result. The search API's own text field is only a one-sentence teaser, returned as `searchTeaser` -- it is never the full body.

## `maxConcurrency` (type: `integer`):

Upper bound on requests in flight at once across all queries in this run.

## `minRequestInterval` (type: `number`):

Shared pacing floor across every request this run makes. Once this cap binds, raising concurrency buys nothing.

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

No bot mitigation was observed on the search API during recon -- it answered 200 cold and unproxied with no token or session. Residential is still this portfolio's standard cloud default.

## Actor input object example

```json
{
  "queries": [
    "climate change"
  ],
  "contentTypes": [
    "article"
  ],
  "sort": "newest",
  "maxItemsPerQuery": 50,
  "includeFullBody": false,
  "maxConcurrency": 5,
  "minRequestInterval": 0.25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# 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 = {
    "queries": [
        "climate change"
    ],
    "contentTypes": [
        "article"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyx/cnn-search-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 = {
    "queries": ["climate change"],
    "contentTypes": ["article"],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapyx/cnn-search-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 '{
  "queries": [
    "climate change"
  ],
  "contentTypes": [
    "article"
  ]
}' |
apify call scrapyx/cnn-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapyx/cnn-search-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/8E7eRq6k8EAFSPAir/builds/Ub0R90d6k0vaZdgrq/openapi.json
