Request
https://api.zapi.ink/v1/indonesia:perpusnas/collection-statsSend your key in the x-api-key header. The response is JSON in the { project, data, timestamp } envelope, and an identical request is served from cache for 5 minutes.
Parameters
No parameters. Call it as is.
Code examples
curl -X GET "https://api.zapi.ink/v1/indonesia:perpusnas/collection-stats" \ -H "x-api-key: zpi_xxxxxxxxxxxxxxxxxxxxxxxx"
const res = await fetch("https://api.zapi.ink/v1/indonesia:perpusnas/collection-stats", { method: "GET", headers: { "x-api-key": "zpi_xxxxxxxxxxxxxxxxxxxxxxxx" }, }); const data = await res.json(); console.log(data);
import requests res = requests.get( "https://api.zapi.ink/v1/indonesia:perpusnas/collection-stats", headers={"x-api-key":"zpi_xxxxxxxxxxxxxxxxxxxxxxxx"}, ) print(res.json())
Example response
{ "project": "indonesia:perpusnas", "data": { "total": 34759, "authors": [ { "count": 2557, "value": "Perpustakaan Nasional" }, { "count": 1794, "value": "Yayasan Idayu" }, { "count": 261, "value": "Madrais Sadewa Alibassa Kusuma Wijayaningrat," }, { "count": 197, "value": "Topographisch Bureau" }, { "count": 194, "value": "Topographische Inrichting" }, { "count": 170, "value": "Topografische Dienst" }, { "count": 156, "value": "Ipphos" }, { "count": 154, "value": "Badan Koordinasi Survey dan Pemetaan Nasional" } ], "scripts": [ { "count": 2364, "value": "Aksara Arab" }, { "count": 2030, "value": "Aksara Jawa" }, { "count": 1266, "value": "Aksara Latin" }, { "count": 690, "value": "aksara Lontara" }, { "count": 546, "value": "Aksara Lontara" }, { "count": 505, "value": "Aksara Bali" }, { "count": 341, "value": "Aksara Arab (Pegon)" }, { "count": 220, "value": "aksara Cacarakan" } ], "provider": "perpusnas", "subjects": [ { "count": 2413, "value": "Manuskrip Jawa" }, { "count": 1800, "value": "Kesusastraan Jawa" }, { "count": 1598, "value": "Manuskrip" }, { "count": 1326, "value": "Manuskrip Arab" }, { "count": 1264, "value": "Manuskrip Melayu" }, { "count": 1123, "value": "Manuskrip Sulawesi Selatan" }, { "count": 1035, "value": "Manuskrip Sunda" }, { "count": 796, "value": "Kesusastraan Arab" } ], "languages": [ { "count": 15130, "value": "Indonesia" }, { "count": 3878, "value": "Jawa" }, { "count": 3089, "value": "Tidak tersedia" }, { "count": 2561, "value": "Belanda" }, { "count": 1154, "value": "Makassar" }, { "count": 1079, "value": "Melayu" }, { "count": 1049, "value": "Arab" }, { "count": 677, "value": "Sunda" } ], "materialTypes": [ { "count": 14592, "value": "Manuskrip" }, { "count": 11842, "value": "Bahan Campuran" }, { "count": 3372, "value": "Monograf" }, { "count": 1874, "value": "Bahan Kartografis" }, { "count": 1372, "value": "Sumber Elektronik" }, { "count": 1056, "value": "Terbitan Berkala" }, { "count": 534, "value": "Bentuk Mikro" }, { "count": 100, "value": "Rekaman Suara" } ], "digitalContentByMaterialType": [ { "materialType": "Rekaman Suara", "collectionCount": 100, "digitalContentCount": 1070 }, { "materialType": "Sumber Elektronik Berkala", "collectionCount": 2, "digitalContentCount": 599 }, { "materialType": "Manuskrip", "collectionCount": 14592, "digitalContentCount": 27371 }, { "materialType": "Sumber Elektronik", "collectionCount": 1372, "digitalContentCount": 4563 }, { "materialType": "Terbitan Berkala", "collectionCount": 1056, "digitalContentCount": 1096438 }, { "materialType": "Bahan Kartografis", "collectionCount": 1874, "digitalContentCount": 2226 }, { "materialType": "Bahan Campuran", "collectionCount": 11842, "digitalContentCount": 11716 }, { "materialType": "Monograf", "collectionCount": 3372, "digitalContentCount": 5299 } ] }, "timestamp": "2026-08-30T00:49:31Z" }
Frequently asked questions
How do I call the Perpusnas Collection Stats API?
Send a GET request to https://api.zapi.ink/v1/indonesia:perpusnas/collection-stats with your Zapi key in the x-api-key header. It takes no parameters. The response is JSON in the { project, data, timestamp } envelope.
What does the Perpusnas Collection Stats API return?
Khastara (Perpusnas) — the SPA host khastara.perpusnas.go.id is Cloudflare-challenged on every cheap rung; its own backend khastara-api.perpusnas.go.id answers plain fetch. The example response has the fields total, authors, scripts, provider, subjects, languages, materialTypes, digitalContentByMaterialType. Each item in authors has fields such as count, value.
Is the Perpusnas Collection Stats API free?
Yes. It is on the Zapi free tier: 600 Zap a month with one API key and no credit card. Each call costs 1 Zap. Paid plans raise the limits.
Can an AI assistant call the Perpusnas Collection Stats API?
Yes. Add the Zapi MCP server (https://mcp.zapi.ink/mcp) to Claude, Cursor or another MCP client and ask in plain words; it calls run_scraper with scraper "perpusnas" and endpoint "collection-stats".
What other Perpusnas API endpoints are there?
It has 4 endpoints. Besides Collection Stats: Article, Articles, Opac Search.
