# Indonesian School Directory Scraper (`moving_beacon-owner1/indonesian-school-directory-scraper`) Actor

Extract comprehensive Indonesian school directory records, official NPSN numbers, accreditation grades, geographical locations, contact details, campus facilities, and student/teacher counts directly from the Ministry of Primary and Secondary Education API

- **URL**: https://apify.com/moving_beacon-owner1/indonesian-school-directory-scraper.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.99 / 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.

Learn more: https://docs.apify.com/actors/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

## Indonesian School Directory Scraper (Kemendikdasmen / Sekolah Kita)

Extract comprehensive Indonesian school directory records, official NPSN numbers, accreditation grades, geographical locations, contact details, campus facilities, and student/teacher counts directly from the Ministry of Primary and Secondary Education API ([sekolah.data.kemendikdasmen.go.id](https://sekolah.data.kemendikdasmen.go.id)).

***

### Features

- **Official National Directory**: Interfaces directly with the official *Sekolah Kita* data service of Indonesia's Ministry of Education, covering over 116,000+ educational institutions nationwide.
- **NPSN & Accreditation**: Extracts authoritative 8-digit NPSN (*Nomor Pokok Sekolah Nasional*) identification numbers and official BAN-S/M accreditation status (`A`, `B`, `C`, etc.).
- **Comprehensive Educational Stages**: Covers all institutional stages: SD (Elementary), SMP (Junior High), SMA (Senior High), SMK (Vocational), TK (Kindergarten), KB, PKBM, and Special Education (SLB).
- **Public / Private Breakdown**: Filter seamlessly by institutional governance: `NEGERI` (Public) or `SWASTA` (Private).
- **Deep School Profile Enrichment**: Queries public profiles to extract contact telephone numbers, official emails, websites, GPS coordinates (`lintang`/`bujur`), electrical power capacity (`daya_listrik`), internet connectivity types, land area, active curriculum, and photo galleries.
- **Statistical Headcounts**: Extracts student enrollment counts (total, male, female), classroom count, student-to-class ratio, and teacher headcounts.
- **Resilient & Polite**: Built-in exponential backoff, rate-limit retry (`Retry-After` header support), and polite request throttling.
- **Apify Proxy Support**: Integrates with Apify residential and datacenter proxies.

***

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `keyword` | `string` | `"SDN 1 Bandung"` | School name, keyword, or NPSN code. Leave empty to search by location or stage only. |
| `location` | `string` | `""` | Indonesian regency or city name (e.g. `"Kota Bandung"`, `"Kab. Bandung Barat"`, `"Kota Surabaya"`). |
| `bentuk_pendidikan` | `string` | `""` | Filter by level: `SD`, `SMP`, `SMA`, `SMK`, `TK`, `KB`, `PKBM`, `SLB`. Leave empty for all. |
| `status` | `string` | `""` | School ownership status: `NEGERI` (Public) or `SWASTA` (Private). |
| `limit` | `integer` | `50` | Maximum total number of school records to extract. |
| `per_page` | `integer` | `100` | Number of results per API request page (max 100). |
| `pages` | `integer` | `20` | Maximum number of API pages to traverse. |
| `details` | `boolean` | `true` | When true, fetches public profile details (contacts, coordinates, facilities, student/teacher stats). |
| `details_limit` | `integer` | `0` | Cap on profile detail enrichment queries (0 means enrich all retrieved schools). |
| `delay` | `number` | `0.2` | Polite pause in seconds between consecutive API queries. |
| `timeout` | `integer` | `40` | Network request timeout in seconds. |
| `proxyConfiguration` | `object` | `null` | Optional Apify proxy settings (e.g. `{"useApifyProxy": true, "apifyProxyCountry": "ID"}`). |

***

### Example Input JSON

```json
{
  "keyword": "SDN 1 Bandung",
  "location": "Kota Bandung",
  "bentuk_pendidikan": "SD",
  "status": "NEGERI",
  "limit": 20,
  "per_page": 100,
  "pages": 5,
  "details": true,
  "details_limit": 10,
  "delay": 0.2,
  "timeout": 40,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

***

### Output Dataset Schema

Each item in the output dataset contains:

| Field | Type | Description |
|---|---|---|
| `npsn` | `string` | Unique 8-digit National School Identification Number (*Nomor Pokok Sekolah Nasional*). |
| `sekolah_id` | `string` | Unique internal UUID of the school record. |
| `nama` | `string` | Official registered school name. |
| `bentuk_pendidikan` | `string` | Educational stage (`SD`, `SMP`, `SMA`, `SMK`, `TK`, etc.). |
| `status_sekolah` | `string` | Ownership status (`NEGERI` for public, `SWASTA` for private). |
| `akreditasi` | `string \| null` | National accreditation grade (`A`, `B`, `C`). |
| `provinsi` | `string` | Province name (e.g. `Prov. Jawa Barat`). |
| `kabupaten_kota` | `string` | Regency or city (e.g. `Kab. Bandung Barat`). |
| `kecamatan` | `string` | District name. |
| `nama_dusun` | `string \| null` | Village or hamlet name. |
| `alamat_jalan` | `string` | Campus street address. |
| `rt` | `integer \| null` | Neighborhood RT unit number. |
| `rw` | `integer \| null` | Community RW unit number. |
| `kode_pos` | `string` | Postal code. |
| `foto_utama` | `string` | Direct URL to featured school photo. |
| `profil_url` | `string` | Direct web link to public school profile. |
| `nomor_telepon` | `string \| null` | School contact telephone number. |
| `email` | `string \| null` | School contact email address. |
| `website` | `string \| null` | Official school website URL. |
| `lintang` | `number \| null` | GPS latitude coordinate. |
| `bujur` | `number \| null` | GPS longitude coordinate. |
| `daya_listrik` | `integer \| null` | Campus electrical capacity in Watts. |
| `akses_internet` | `string \| null` | Primary internet connection type (e.g. `Fibre Optic`, `Seluler`). |
| `akses_internet_2` | `string \| null` | Secondary internet connection type. |
| `waktu_penyelenggaraan` | `string \| null` | Operating schedule / shift (e.g. `Pagi/5 hari`). |
| `luas_tanah_milik` | `number \| null` | Owned campus land area in m². |
| `semester` | `string \| null` | Current academic semester reference. |
| `jumlah_siswa` | `integer \| null` | Total enrolled student headcount. |
| `jumlah_siswa_l` | `integer \| null` | Male enrolled students. |
| `jumlah_siswa_p` | `integer \| null` | Female enrolled students. |
| `jumlah_rombel` | `integer \| null` | Total classrooms / study groups (*rombel*). |
| `rasio_siswa_rombel` | `integer \| null` | Average student-to-classroom ratio. |
| `jumlah_guru_l` | `integer \| null` | Male teachers headcount. |
| `jumlah_guru_p` | `integer \| null` | Female teachers headcount. |
| `kurikulum` | `array` | List of active curricula (e.g. `["Kurikulum SD Merdeka"]`). |
| `foto_sekolah` | `array` | URLs of school campus facility photos. |
| `source` | `string` | Source API hostname (`"sekolah.data.kemendikdasmen.go.id"`). |
| `scraped_at` | `string` | ISO 8601 UTC timestamp of extraction. |

#### Example Output Record

```json
{
  "npsn": "70048129",
  "sekolah_id": "00DD4D09-2E31-4249-A583-39C19DF540E1",
  "nama": "SMP BANDUNG BARAT FOUNDATION-1",
  "bentuk_pendidikan": "SMP",
  "status_sekolah": "SWASTA",
  "akreditasi": null,
  "provinsi": "Prov. Jawa Barat",
  "kabupaten_kota": "Kab. Bandung Barat",
  "kecamatan": "Kec. Cipatat",
  "nama_dusun": null,
  "alamat_jalan": "Kp. Sindang Mekar RT.01 RW.11",
  "rt": 1,
  "rw": 11,
  "kode_pos": "40754",
  "foto_utama": "https://file.data.kemendikdasmen.go.id/sekolahkita/70/7004/70048129-2.jpg",
  "profil_url": "https://sekolah.data.kemendikdasmen.go.id/profil-sekolah/00DD4D09-2E31-4249-A583-39C19DF540E1",
  "nomor_telepon": null,
  "email": "smpbbf1@gmail.com",
  "website": null,
  "lintang": -6.8452,
  "bujur": 107.4128,
  "daya_listrik": 2200,
  "akses_internet": "Fibre Optic",
  "akses_internet_2": "Shared",
  "waktu_penyelenggaraan": "Pagi/5 hari",
  "luas_tanah_milik": 800,
  "semester": "2026/2027 Gasal",
  "jumlah_siswa": 142,
  "jumlah_siswa_l": 75,
  "jumlah_siswa_p": 67,
  "jumlah_rombel": 6,
  "rasio_siswa_rombel": 24,
  "jumlah_guru_l": 1,
  "jumlah_guru_p": 4,
  "kurikulum": [
    "Kurikulum Merdeka"
  ],
  "foto_sekolah": [
    "https://file.data.kemendikdasmen.go.id/sekolahkita/70/7004/70048129-1.jpg",
    "https://file.data.kemendikdasmen.go.id/sekolahkita/70/7004/70048129-2.jpg"
  ],
  "source": "sekolah.data.kemendikdasmen.go.id",
  "scraped_at": "2026-11-18T14:20:00.000000+00:00"
}
```

***

### Compliance & Policy Guidelines

- **Public Educational Data**: Data is sourced from the publicly accessible *Sekolah Kita* information portal maintained by Indonesia's Ministry of Education (*Kementerian Pendidikan Dasar dan Menengah*).
- **Polite Request Throttling**: The actor includes a configurable `delay` parameter (default 0.2s) and handles `429 Too Many Requests` status codes with exponential backoff.
- **Fair Use & Research**: This scraper is intended for educational research, school mapping, public data analytics, and civic projects.
- **Data Privacy**: Contact details provided are institutional school administration contacts published for public communication. Users must comply with applicable data protection regulations when handling institutional or contact data.

***

### How to Run

#### Apify Platform

1. Find the Actor in the Apify Console.
2. Configure search criteria (e.g. `keyword`, `location`, `bentuk_pendidikan`, `status`).
3. Click **Start** to execute.
4. Download results in JSON, CSV, Excel, or NDJSON.

# Actor input Schema

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

School name, NPSN code, or keyword to search (e.g. 'SDN 1 Bandung', 'SMP Negeri 1', 'SMK'). Leave empty to search by location or stage.

## `location` (type: `string`):

Indonesian regency or city name (e.g. 'Kota Bandung', 'Kab. Bandung Barat', 'Kota Jakarta Selatan', 'Kota Surabaya').

## `bentuk_pendidikan` (type: `string`):

Filter by educational stage (e.g. SD, SMP, SMA, SMK, TK).

## `status` (type: `string`):

Filter by school status (NEGERI = public, SWASTA = private).

## `limit` (type: `integer`):

Maximum number of schools to extract.

## `per_page` (type: `integer`):

Number of results per API request page (maximum 100).

## `pages` (type: `integer`):

Maximum number of API pages to query.

## `details` (type: `boolean`):

When enabled, queries the public profile of each school to extract phone, email, website, GPS coordinates, facilities, student/teacher counts, and curriculum.

## `details_limit` (type: `integer`):

Maximum number of records to enrich with full profile details (set to 0 to enrich all retrieved records).

## `delay` (type: `number`):

Delay in seconds between API requests to avoid rate limits.

## `timeout` (type: `integer`):

Timeout in seconds for API HTTP requests.

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

Optional proxy configuration for requests.

## Actor input object example

```json
{
  "keyword": "SDN 1 Bandung",
  "location": "Kota Bandung",
  "bentuk_pendidikan": "",
  "status": "",
  "limit": 50,
  "per_page": 100,
  "pages": 20,
  "details": true,
  "details_limit": 0,
  "delay": 0.2,
  "timeout": 40
}
```

# 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": "SDN 1 Bandung",
    "location": "Kota Bandung",
    "limit": 50,
    "per_page": 100,
    "pages": 20,
    "details_limit": 0,
    "delay": 0.2,
    "timeout": 40
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/indonesian-school-directory-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": "SDN 1 Bandung",
    "location": "Kota Bandung",
    "limit": 50,
    "per_page": 100,
    "pages": 20,
    "details_limit": 0,
    "delay": 0.2,
    "timeout": 40,
}

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/indonesian-school-directory-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": "SDN 1 Bandung",
  "location": "Kota Bandung",
  "limit": 50,
  "per_page": 100,
  "pages": 20,
  "details_limit": 0,
  "delay": 0.2,
  "timeout": 40
}' |
apify call moving_beacon-owner1/indonesian-school-directory-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moving_beacon-owner1/indonesian-school-directory-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/bp3r20lWPfwBknmvB/builds/avYQbqhC6r9TZ81hL/openapi.json
