An unofficial scraper API for referensi.data.kemdikbud.go.id, built with Node.js and Express. This project extracts and serves structured educational institution data from the Indonesian Ministry of Education website.
- π Access to education reference data from PAUD, DIKDAS, DIKMEN, DIKTI, etc.
- π Full scraping support across Province β City/Regency β District β Institutions levels
- π§ Dynamic content extraction with normalized output (camelCase keys, number conversion)
- β‘ JSON file caching with configurable TTL (persistent across restarts)
- π¦ Export to CSV via query param
?export=csv - π’ Fetch full institution detail (contacts, documents, location, etc)
All endpoints return JSON by default. For CSV, append ?export=csv to list routes.
GET /GET /pendidikan/:menu
# Example: /pendidikan/paudGET /pendidikan/:menu/:areaId/:levelId
# Example: /pendidikan/paud/010000/1
# Example: /pendidikan/paud/010100/2
# Example: /pendidikan/paud/010101/3GET /pendidikan/npsn/:npsn
# Example: /pendidikan/npsn/00000000- Only list-based endpoints support CSV (
/,/pendidikan/:menu,/pendidikan/:menu/:areaId/:levelId) - Use
?export=csvquery parameter to get CSV - CSV fields are always quoted and escaped for Excel/Sheets compatibility
- Detail endpoints like
/npsndo not support CSV export
git clone https://github.com/daffaalam/dataref-kemdikbud.git
cd dataref-kemdikbud
npm install
npm run dev # for development with auto-reload- Node.js v22.x (LTS)
- npm v10+
Via .env or config.js:
| Key | Description | Default |
|---|---|---|
PORT |
Port to run server | 3000 |
BASE_URL |
Base scrape target | https://referensi.data.kemdikbud.go.id |
CACHE_ENABLED |
Enable/disable file caching | true if NODE_ENV=production |
CACHE_TTL |
Milliseconds before cache expires | 86400000 (24 hours) |
CACHE_DIR |
Cache directory path | ./.cache |
.
βββ routes/ # Express route definitions
βββ utils/ # Scraper logic: cheerio, axios, parsing
βββ cache/ # JSON file caching system
βββ middleware/ # Injects apiBase dynamically
βββ index.js # Server entry point
- This project is not affiliated with Kemdikbud.
- Use responsibly; scraping may be rate-limited by the source.
- Contributions and issues are welcome!
MIT License β Β© daffaalam
This project is unofficial and for educational purposes only.