# Detik.com News Scraper (`romy/detik-news-scraper`) Actor

Scrape news articles from detik.com by keyword and channel, with full body text, author, and tags.

- **URL**: https://apify.com/romy/detik-news-scraper.md
- **Developed by:** [Romy](https://apify.com/romy) (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

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 Detik.com News Scraper do?

**Detik.com News Scraper** extracts full news articles from [detik.com](https://detik.com) — Indonesia's largest news portal — by keyword search. For each article it collects the full title, body text, author, tags, channel, publication timestamp, and URL. Filter by channel (finance, tech, sport, etc.) to narrow results.

### Why use Detik.com News Scraper?

- **Media monitoring:** Track coverage of any topic, brand, or person across Indonesia's top news source.
- **NLP & research:** Collect a corpus of Indonesian news articles for text analysis, sentiment analysis, or topic modeling.
- **Content aggregation:** Build news feeds or summaries for Indonesian audiences.
- **Competitive intelligence:** Monitor how competitors or industry topics are covered in Indonesian media.

### How to use Detik.com News Scraper

1. Open the Actor in Apify Console and click **Try for free**.
2. Enter a **Search Keyword** (required) — e.g. `ekonomi`, `teknologi`, `politik`.
3. Optionally select a **Channel** to restrict results (default: all channels).
4. Set **Max Results** to control how many articles to collect (default: 50, max: 500).
5. Click **Start**. Results appear in the **Output** tab when the run finishes.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `keyword` | string | required | Search keyword |
| `channel` | string | `"all"` | Channel filter: `all`, `news`, `finance`, `inet`, `sport`, `hot`, `food`, `oto` |
| `max_results` | integer | `50` | Articles to collect (1–500) |

### Output

Each dataset item represents one article:

```json
{
  "id": "8507344",
  "title": "Harga Sawit Turun 2 Pekan Terakhir, Petani Muratara Keluhkan Pupuk Mahal",
  "url": "https://www.detik.com/sumbagsel/berita/d-8507344/harga-sawit-turun-2-pekan-terakhir-petani-muratara-keluhkan-pupuk-mahal",
  "channel": "detikSumbagsel",
  "summary": "Harga TBS kelapa sawit di Musi Rawas Utara turun...",
  "thumbnail_url": "https://akcdn.detik.net.id/community/media/visual/2026/05/27/image.jpeg",
  "published_at": "2026-05-28T05:30:00+07:00",
  "author": "M Rizky Pratama",
  "content": "Muratara - Harga tandan buah segar (TBS) kelapa sawit...",
  "tags": ["harga sawit", "muratara", "petani sawit", "pupuk mahal"]
}
```

You can download the dataset in JSON, CSV, Excel, or HTML formats from the Output tab.

### Data fields

| Field | Format | Notes |
|---|---|---|
| `id` | text | Detik internal article ID |
| `title` | text | Article headline |
| `url` | link | Direct article URL |
| `channel` | text | Detik channel (e.g. detikFinance, detikInet) |
| `summary` | text | Short excerpt from search results |
| `thumbnail_url` | link | Article thumbnail image URL, may be null |
| `published_at` | date | ISO 8601 with WIB offset (+07:00) |
| `author` | text | Author name, may be null |
| `content` | text | Full article body (plain text) |
| `tags` | array | Topic tags assigned by Detik editors |

### Pricing

This Actor uses **Pay Per Event (PPE)** pricing — you pay per dataset item. Scraping 100 articles typically costs less than $0.15 (includes two HTTP requests per article).

### FAQ and disclaimers

This Actor accesses publicly available news content from detik.com for research and informational purposes. Use in accordance with detik.com's Terms of Service. Article content is copyright of Detik Network.

For bugs or feature requests, open an issue on the Issues tab.

# Actor input Schema

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

Search keyword, e.g. 'ekonomi', 'teknologi', 'politik'.

## `channel` (type: `string`):

Filter by Detik channel. Use 'all' for all channels.

## `max_results` (type: `integer`):

Maximum number of articles to collect (1-500).

## Actor input object example

```json
{
  "keyword": "ekonomi",
  "channel": "all",
  "max_results": 50
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "keyword": "ekonomi"
};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/detik-news-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 = { "keyword": "ekonomi" }

# Run the Actor and wait for it to finish
run = client.actor("romy/detik-news-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 '{
  "keyword": "ekonomi"
}' |
apify call romy/detik-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,romy/detik-news-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/Di4R2oqWraBlgmoNO/builds/iORsWCZhAQefFQ3kb/openapi.json
