# CNN Sections & Tags Scraper (`scrapyx/cnn-sections-scraper`) Actor

Enumerates the section and tag taxonomy of six CNN editions -- slug, URL, hierarchy depth and last-modified date -- so you know which section values the other CNN scrapers accept. Covers 198 US sections, 1,137 Espanol sections and 2,236 Arabic tags.

- **URL**: https://apify.com/scrapyx/cnn-sections-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 Sections & Tags Scraper

The **discovery actor** for the CNN family. It enumerates the section and tag
taxonomy each edition publishes, so you know exactly which values the other CNN
scrapers' `sections` input will accept instead of guessing slugs against a 404.

| Edition | Sections | Tags |
| --- | --- | --- |
| CNN US / International | 198 | — |
| CNN en Español | 1,137 | — |
| CNN Arabic | 53 | **2,236** |
| CNN Greece | 53 | 106 child sitemaps |
| CNN Indonesia | 9 | — |
| Brasil, Chile, Czechia, Portugal, Japan, Türkiye | none published | — |

### Example input

```json
{
  "editions": ["us", "arabic", "indonesia"],
  "taxonomyKinds": ["section", "tag"]
}
```

### Output

`SECTION` and `TAG` rows carry `taxonomySlug` (the value to pass to a sibling
actor), `taxonomyUrl`, `taxonomyDepth` (1 for `/health`, 2 for `/world/africa`)
and the sitemap's own `lastmod`, `changefreq` and `priority`. Turn on
`includeTaxonomyDetail` to also fetch each page's title, heading and description.

Defaults to metadata-only — one request per edition — because the slug and URL
alone answer "what sections exist", and CNN Arabic's 2,236 tags would otherwise
mean 2,236 extra requests.

### Limits

- **Only CNN Arabic and CNN Greece publish a tag sitemap.** Asking for tags on
  another edition returns an ERROR row saying so rather than an empty result.
- **CNN Greece splits its tags across 106 child sitemaps.** `maxIndexChildren`
  caps how many are read (default 5) and the summary row records when more were
  available, so a partial listing is never silent.
- **CNN Indonesia has no taxonomy sitemap of its own.** Its sections are derived
  from the child URLs of its main sitemap index (`/{section}/sitemap_news.xml`).
  Because there are three sitemap files per section, rows are de-duplicated on
  the canonical section URL and `taxonomyDiscoveredVia` records the sitemap file
  the section was found through.
- **CNN en Español counts author and topic hubs as sections**, which is why it
  reports 1,137 against the flagship's 198. Filter on `taxonomyDepth` to get
  just the top level.

# Actor input Schema

## `editions` (type: `array`):

Six editions publish a section or tag sitemap. The other six are listed here so that asking for one returns a clear ERROR row naming why, rather than a silent miss.

## `taxonomyKinds` (type: `array`):

Sections are the site's navigation hierarchy; tags are topic and entity pages. Only CNN Arabic and CNN Greece publish a tag sitemap -- asking for tags on another edition returns an ERROR row saying exactly that.

## `keywords` (type: `array`):

Optional. Keep only entries whose slug, URL or (when detail is fetched) page title or description contains one of these words, case-insensitive.

## `maxItemsPerEdition` (type: `integer`):

Cap on entries returned per edition per kind. Defaults to 0 (unlimited) because taxonomy feeds are small and a truncated list defeats the point of a discovery actor.

## `includeTaxonomyDetail` (type: `boolean`):

Fetch each section or tag page for its title, heading and description. Off by default: the slug and URL alone answer 'what sections exist', and CNN Arabic alone has 2,236 tags, which would mean 2,236 extra requests.

## `maxIndexChildren` (type: `integer`):

CNN Greece splits its tag sitemap into 106 child files. This caps how many are read; the SEARCH\_SUMMARY row records when more were available, so a partial listing is never silent.

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

Upper bound on requests in flight at once across all editions 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`):

Apify Proxy on the shared datacenter pool. This is the default because it is included in your plan at no extra cost and this target works through it. If you start seeing blocks, challenges or empty results, switch the group here to Residential -- it uses real consumer IPs and gets through more, but Apify bills residential traffic per gigabyte, so leave it off unless you need it.

## Actor input object example

```json
{
  "editions": [
    "us"
  ],
  "taxonomyKinds": [
    "section"
  ],
  "keywords": [],
  "maxItemsPerEdition": 0,
  "includeTaxonomyDetail": false,
  "maxIndexChildren": 5,
  "maxConcurrency": 5,
  "minRequestInterval": 0.25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "editions": [
        "us"
    ],
    "taxonomyKinds": [
        "section"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyx/cnn-sections-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 = {
    "editions": ["us"],
    "taxonomyKinds": ["section"],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapyx/cnn-sections-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 '{
  "editions": [
    "us"
  ],
  "taxonomyKinds": [
    "section"
  ]
}' |
apify call scrapyx/cnn-sections-scraper --silent --output-dataset

```

## MCP server setup

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