# BKN Publications Scraper (`bovi/bkn-scraper`) Actor

Collect public BKN publication records from the official BKN website. Get titles, links, dates, categories, tags, excerpts, article text, and featured images when available. Run with search and maxResults, without a BKN login. Pricing: $0.0035 per result plus $0.00005 per Actor Start on Free.

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

## Pricing

from $3.50 / 1,000 bkn publications scrapers

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

## BKN Publications Scraper

This Actor extracts public news, announcements, press releases, and other publication records from BKN RI’s official `bkn.go.id` website through its public WordPress REST endpoint. It costs $0.0035 per scraped result on the Free plan, plus $0.00005 per Actor Start on the Free plan.

- Search BKN publication titles and content, or collect the latest posts with an empty search.
- Archive BKN news and announcements with titles, links, dates, categories, tags, excerpts, and article text.
- Export structured records with source-domain, scrape-time, and featured-image URL metadata when available.
- Run against the public source without a BKN login.

### What you get

The Actor reads published BKN posts from `https://www.bkn.go.id/wp-json/wp/v2/posts`. It follows pagination until it reaches the requested result count or there are no more posts. Each pushed item has a positive post ID, title, and BKN URL.

| Field | Type | What it contains |
| --- | --- | --- |
| `id` | integer | BKN post ID. |
| `title` | string | Publication title converted to text. |
| `url` | string | URL of the BKN publication. |
| `published_at` | string | Publication timestamp from the source, labeled UTC. |
| `updated_at` | string | Last update timestamp from the source, labeled UTC. |
| `excerpt` | string | Available rendered publication excerpt as text. |
| `content` | string | Available rendered article content as text. |
| `categories` | array of strings | Publication category names. |
| `tags` | array of strings | Publication tag names. |
| `image_url` | string | Featured image URL when a valid HTTP or HTTPS image is available. |
| `source_domain` | string | Hostname of the publication URL, such as `www.bkn.go.id`. |
| `scraped_at` | string | UTC timestamp assigned when the record is collected. |

> **Note:** Fields absent from a source post are not fabricated. If no valid featured image is found, `image_url` is omitted; categories and tags can be empty arrays.

The source URL is accepted only when it uses HTTP or HTTPS and belongs to `bkn.go.id` or one of its subdomains. Posts without a usable ID, title, or source URL are not pushed.

### Sample output

This shortened sample keeps every field except the long `excerpt` and `content` values.

```json
{
  "id": 127661,
  "title": "BKN Berikan Penghargaan Setinggi-tingginya bagi Dua ASN yang Gugur dalam Pemadaman Karhutla Bromo",
  "url": "https://www.bkn.go.id/bkn-berikan-penghargaan-setinggi-tingginya-bagi-dua-asn-yang-gugur-dalam-pemadaman-karhutla-bromo/",
  "published_at": "2026-10-16T08:08:45",
  "updated_at": "2026-10-16T08:08:45",
  "categories": ["Berita", "Publikasi"],
  "tags": [],
  "source_domain": "www.bkn.go.id",
  "scraped_at": "2026-10-17T03:22:59.474370+00:00",
  "image_url": "https://www.bkn.go.id/wp-content/uploads/2026/09/DSC04342-scaled.jpg"
}
```

### Pricing

This Actor uses pay-per-event billing with these charge events:

| Charge event | When it applies | Free-plan price |
| --- | --- | --- |
| `Actor Start` | When the Actor starts running, including a run that produces no results. | $0.00005 per event on the Free plan |
| `BKN Publications Scraper` | One scraped result (one dataset item) with all fields. | $0.0035 per event on the Free plan |

Example on the Free plan: 100 x $0.0035 = $0.35 for results, and one Actor Start adds $0.00005, so the total is $0.35005.

Larger result-only examples on the Free plan: 1,000 x $0.0035 = $3.50, and 10,000 x $0.0035 = $35.00.

The Apify Free plan includes $5 of monthly platform usage credit. After one Free-plan Actor Start, that credit covers 1,428 result events at the Free-plan rates. This is a credit calculation, not a promise that the source contains that many matching posts.

For this pay-per-event Actor, platform usage (compute, Apify Proxy traffic, and storage) is included in the event prices and paid by the Actor developer.

### How to use

1. **Open** the Actor in Apify and start a run using your Apify account.
2. **Enter** optional text in `search`, or leave it empty to collect the latest posts.
3. **Set** `maxResults` to the total number of records you want, from 1 to 1000.
4. **Check** `proxyConfiguration`. Its schema default is Apify Proxy with the `RESIDENTIAL` group, so a run that does not override it goes through Apify Proxy. A direct request happens only when you set `useApifyProxy` to `false`, or when the input is passed without the field where schema defaults are not applied.
5. **Run** the Actor and inspect the dataset records.
6. **Repeat** the run through Apify Schedules if you need regular collection.

Example input:

```json
{
  "search": "ASN",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

Export the dataset as JSON or CSV, or read it through the Apify dataset API.

### Input parameters

| Parameter | What it does | Default |
| --- | --- | --- |
| `search` | Optional text passed to the BKN posts search over titles and content; an empty value collects the latest posts. | Empty string |
| `maxResults` | Maximum total number of records to return across all pages. Range: minimum 1, maximum 1000. | `50` |
| `proxyConfiguration` | Optional Apify Proxy settings. A proxy is used only when `useApifyProxy` is `true`; `false` makes a direct request. | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` |

### Limits and edge cases

| Condition | What the buyer sees | What to do |
| --- | --- | --- |
| `maxResults` is `0` or negative when supplied programmatically | The Actor logs that no posts were requested and pushes nothing. | Use a positive value. |
| `maxResults` exceeds the number of matching published posts | The dataset contains fewer records than requested. | Broaden or remove `search`. |
| `search` matches no public BKN posts | The dataset is empty. | Check the spelling or leave `search` empty. |
| A source post lacks a usable ID, title, or BKN URL, or is not published | That item is skipped. | Check the source publication. |
| A post has no valid featured image or no category or tag terms | `image_url` is omitted; `categories` or `tags` can be empty arrays. | Treat the value as unavailable in the source. |
| A page request returns an HTTP error, times out (45-second request timeout), or returns non-JSON or a non-list response | The run stops with an error; records pushed before the error can already be in the dataset. | Review the run error and source availability, then run again. |
| The same post ID appears more than once while paging | Only the first occurrence is pushed. | No action needed. |

### FAQ

#### How much does it cost to scrape BKN publications?

Each scraped result costs $0.0035 on the Free plan, and each Actor Start costs $0.00005 on the Free plan. See the Pricing section for the worked example.

#### Why is my BKN dataset empty?

An empty dataset can occur when `search` matches no public BKN posts or when `maxResults` is supplied as zero or a negative value programmatically. Try removing `search` and use a positive `maxResults`.

#### What should I check if the run is not working?

Check the run error and confirm that the BKN public endpoint is available. An HTTP error, request timeout, non-JSON response, or non-list response stops the run. Then run it again.

#### Is it legal to collect data from BKN’s public website?

This Actor reads public publication data from the official BKN website through its public WordPress REST endpoint and does not require a login. Whether a particular collection or use is allowed depends on the source terms, applicable law, and your use case, so review those requirements first; this Actor does not provide a legal guarantee.

# Actor input Schema

## `search` (type: `string`):

Optional text to search in BKN publication titles and content. Leave empty to collect the latest posts.

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

Maximum number of public BKN publication records to collect.

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

Optional Apify Proxy settings. A proxy is used only when useApifyProxy is true; an omitted or false setting uses a direct request.

## Actor input object example

```json
{
  "search": "",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset with the scraped BKN publication records.

# 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 = {
    "search": "",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/bkn-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 = {
    "search": "",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bovi/bkn-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 '{
  "search": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bovi/bkn-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bovi/bkn-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/0zeZrN3Rqkn2tiwiy/builds/ZB8kNuC3HcjuZ7Mwm/openapi.json
