# Indonesia News Headlines Scraper (`nanodata/indonesia-news-headlines-scraper`) Actor

Collect fresh Indonesian news headlines from the public news sitemaps of detik.com and CNN Indonesia: title, link, publication time, section, keywords and image. Built for monitoring. Pay per headline.

- **URL**: https://apify.com/nanodata/indonesia-news-headlines-scraper.md
- **Developed by:** [nanodata](https://apify.com/nanodata) (community)
- **Categories:** News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 headline scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

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

## Indonesia News Headlines Scraper

Collect recent Indonesian news headlines from [detik.com](https://www.detik.com/) and [CNN Indonesia](https://www.cnnindonesia.com/). Each row is one headline with its link, publication time, section, keywords and publication name. Headlines and metadata only: the actor does not open article pages and returns no article text.

The data comes from the public news sitemaps that the two outlets publish for search engines. No account and no API key are needed.

### What you get

For each headline the actor returns one row with:

- `url`, `title`: the article address and the headline as the outlet prints it
- `publishedAt`, `publishedAtUtc`: the publication time as the outlet gives it (Jakarta time, `+07:00`) and the same time in UTC
- `outlet`, `publicationName`, `language`: `detik` or `cnnindonesia`, the publication name from the sitemap (for example `detikNews` or `CNN Indonesia`) and the language code (`id`)
- `keywords`: the outlet's keywords for the article, as a list
- `section`, `site`: the section taken from the sitemap address (for example `nasional`, `internasional`, `berita`, `sepakbola`) and the host of the sitemap (for example `news.detik.com`)
- `imageUrl`: the image address when the sitemap carries one, otherwise null
- `sourceSitemap`, `scrapedAt`: the sitemap the headline was read from and the time of collection

A value the source does not show is null. Rows are unique by `url` within a run.

### Typical uses

- Media monitoring: watch what the main Indonesian outlets publish
- Brand and keyword alerts: filter by a name or topic and run the actor every hour
- A news feed for Indonesian market, politics or sports coverage
- Collect headlines and keywords for later analysis or for your own archive

### Important: recent headlines only

News sitemaps list only the most recent articles, roughly the last 48 hours, and about 100 to 200 headlines per section. They are not an archive. By default the actor delivers only headlines published in the last 48 hours, counted from the start of the run, newest first. Headlines without a publication date are skipped in that default window, and the run status says how many. Evergreen and listing sitemaps (the fyb.detik.com stories and the property sections) are not read in the default window, because they hold older articles. To read further back, set `publishedAfter` yourself; the actor then delivers what the sitemaps still hold after that date. The actor is built for monitoring: schedule it every hour or every day and remove duplicates by `url` in your own storage.

### Pricing

You pay per headline delivered, plus a small fee for each run.

| Event | Name | Price |
|---|---|---|
| Run start (charged once, together with the first delivered row) | `actor-start` | $0.001 per run |
| One headline row | `headline-result` | $0.0008 per headline |

A run that finds nothing is not charged. If you set a maximum cost for the run, the actor stops cleanly once the next row would go over it.

**New to Apify?** Every account gets a $5 free monthly platform credit, enough for a first test run before you pay anything.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `outlets` | list | `detik`, `cnnindonesia` | Outlets to read |
| `sections` | list | all sections | Section names such as `nasional`, `internasional`, `ekonomi`, `olahraga`, `berita`, `sepakbola`. Empty means every section of the selected outlets |
| `keyword` | text | none | Keep only headlines whose title or keywords contain this text (not case sensitive) |
| `publishedAfter` | text | last 48 hours | Optional. Replaces the default 48 hour window: keep only headlines published after this date or date and time, for example `2026-11-12` or `2026-11-12T08:00:00+07:00`. Without a time zone the value is read as Jakarta time |
| `maxResults` | number | 200 | Maximum headlines in total, up to 20,000 |

How it works:

- The actor first reads the sitemap index of each outlet, then the news sitemap of each section, newest sections first. `maxResults` is split evenly between the selected outlets. If one outlet has fewer headlines in the window than its share, the unused part goes to the other outlet. The delivered rows are sorted newest first.
- detik.com has many sections on several of its sites (news, sport, finance, tech, food and others). The same section name can exist on more than one site, for example `berita`. To pick one site, write the site and the section, for example `news/berita` or `sport/sepakbola`.
- `keyword` and the date window are applied after reading, on the rows. A section whose sitemap was last updated before the start of the window is skipped without a request.
- A headline that appears in two sections is delivered once.
- Requests are made one at a time with a pause of at least 2 seconds between them. detik.com lists about 240 news sitemaps and CNN Indonesia 9, so a run over every section reads about 250 files and takes ten minutes or more. Narrow `sections` or lower `maxResults` for a faster run.
- Number fields also accept numbers written as text, for example `"50"`.
- Started with no input, the actor returns up to 50 headlines from both outlets.

#### Example: latest headlines from both outlets

```json
{
  "outlets": ["detik", "cnnindonesia"],
  "maxResults": 300
}
```

#### Example: keyword alert on CNN Indonesia national news

```json
{
  "outlets": ["cnnindonesia"],
  "sections": ["nasional"],
  "keyword": "jakarta",
  "maxResults": 50
}
```

#### Example: hourly feed of new headlines

```json
{
  "outlets": ["detik", "cnnindonesia"],
  "publishedAfter": "2026-11-12T08:00:00+07:00",
  "maxResults": 1000
}
```

### Output sample

```json
{
  "url": "https://www.cnnindonesia.com/nasional/20261112140704-32-1426385/mpr-rapat-gabungan-bahas-jadwal-paripurna-wapres-pengganti-gibran-esok",
  "title": "MPR Rapat Gabungan Bahas Jadwal Paripurna Wapres Pengganti Gibran Esok",
  "publishedAt": "2026-11-12T14:15:50+07:00",
  "publishedAtUtc": "2026-11-12T07:15:50Z",
  "outlet": "cnnindonesia",
  "publicationName": "CNN Indonesia",
  "language": "id",
  "keywords": ["mpr", "rapat gabungan", "wakil presiden", "gibran rakabuming raka", "paripurna", "ahmad muzani"],
  "section": "nasional",
  "site": "www.cnnindonesia.com",
  "imageUrl": null,
  "sourceSitemap": "https://www.cnnindonesia.com/nasional/sitemap_news.xml",
  "scrapedAt": "2026-11-12T07:35:10Z"
}
```

### Limitations

- Headlines and metadata only. Article text, authors, comments and view counts are not collected.
- The news sitemaps cover roughly the last 48 hours, and the default window is 48 hours. Run the actor on a schedule and keep what you collect.
- A section that publishes rarely may hold fewer headlines in the window than its share. The unused part goes to the other outlet, so a run can deliver fewer rows than `maxResults`.
- The number of headlines per section is set by the outlet, usually 100 to 200. Sections that are updated rarely hold older headlines.
- `imageUrl` is filled only when the sitemap carries an image. The current sitemaps of both outlets carry none, so it is usually null.
- `keywords` are the outlet's own keywords and may be short or missing for some articles.
- Only detik.com and CNN Indonesia are covered. Other outlets are not part of this actor.
- If the source keeps refusing, the run ends with a status that says so, and only delivered rows are charged.

### FAQ

**Where does the data come from?**
From the public news sitemaps of detik.com and CNN Indonesia, the files they publish for search engines.

**Do I get the article text?**
No. The actor returns the headline, link and metadata. Use the `url` to open the article.

**Can I get headlines older than two days?**
Only what the sitemaps still hold. Set `publishedAfter` to an earlier date to include older headlines. The sitemaps are not an archive, so schedule the actor to build your own.

**How often should I run it?**
Every hour for alerts, or once or twice a day for a daily digest. Remove duplicates by `url`.

**Why did I get fewer rows than `maxResults`?**
The last 48 hours (or your `publishedAfter` window) held fewer headlines than you asked for, your filters removed some, or the maximum cost you set for the run was reached. The run status message says which.

**What happens when nothing matches?**
The run ends with no rows, nothing is charged, and the status says so.

**Can a run be restarted safely?**
Yes. Progress is saved after every batch. A restarted run continues where it stopped and does not deliver or charge the same rows twice.

**Is this affiliated with detik.com or CNN Indonesia?**
No. This is an independent tool that reads public sitemaps. Please keep your use modest and in line with the terms of the outlets.

### Use with AI agents (MCP)

Connect this actor to any MCP-compatible AI client, such as Claude Desktop, Cursor, VS Code, LangChain or LlamaIndex.

**MCP server URL:**

```
https://mcp.apify.com?tools=nanodata/indonesia-news-headlines-scraper
```

**Example prompt once connected:**

> "Use `indonesia-news-headlines-scraper` to collect the 30 latest Indonesian headlines with section and publication time. Return results as a table."

### Related Actors

- [Google News Scraper: Articles, Sources & Dates by Keyword](https://apify.com/santamaria-automations/google-news-scraper): Scrape Google News results for any keyword: article title, publisher, snippet, link and publication date.
- [RSS & Atom Feed Reader - Monitor Any Feed at Scale](https://apify.com/santamaria-automations/rss-feed-reader): Extract articles from RSS, Atom, and JSON feeds including title, author, content, images, categories, enclosures, and publication dates.
- [Bluesky Profiles and Posts Scraper](https://apify.com/nanodata/bluesky-profiles-posts-scraper): Find Bluesky profiles by keyword and collect posts from any profile.

### Support

Found a problem or need a field added? Open an issue on the [Issues tab](https://apify.com/nanodata/indonesia-news-headlines-scraper/issues). We usually reply within one business day. You can also email contact@nanoscrape.com.

# Actor input Schema

## `outlets` (type: `array`):

Which outlets to read: detik, cnnindonesia. Default: both.

## `sections` (type: `array`):

Optional. Section names such as nasional, internasional, ekonomi, berita, sepakbola. Leave empty to read every section of the selected outlets.

## `keyword` (type: `string`):

Optional. Keep only headlines whose title or keywords contain this text (not case sensitive).

## `publishedAfter` (type: `string`):

Optional. Without it, only headlines from the last 48 hours are delivered. Set it to replace that window: keep only headlines published after this date or date and time, for example 2026-11-12 or 2026-11-12T08:00:00+07:00. A value without a time zone is read as Jakarta time.

## `maxResults` (type: `integer`):

Maximum number of headlines in total, split evenly between the selected outlets. Default 200.

## Actor input object example

```json
{
  "outlets": [
    "detik",
    "cnnindonesia"
  ],
  "maxResults": 50
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

One row per headline

# 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 = {
    "outlets": [
        "detik",
        "cnnindonesia"
    ],
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("nanodata/indonesia-news-headlines-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 = {
    "outlets": [
        "detik",
        "cnnindonesia",
    ],
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("nanodata/indonesia-news-headlines-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 '{
  "outlets": [
    "detik",
    "cnnindonesia"
  ],
  "maxResults": 50
}' |
apify call nanodata/indonesia-news-headlines-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nanodata/indonesia-news-headlines-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/jzl8nBTFabAbhcUEs/builds/SxYz11D8fXgpLfZqq/openapi.json
