Indonesian Law API — Free REST API for Legal Data
Free REST API for Indonesian law search, regulation metadata, and full law detail. Requires a free personal access token. Contact us for higher-volume access.
Base URL
https://pasal.id/api/v1Authentication
All `/api/v1/*` requests require a personal access token. Create a free account, generate a token, and include it in your requests as shown below.
Example: include your token in the request
curl -H "Authorization: Bearer pasal_mcp_abc123_your_secret_here" \ "https://pasal.id/api/v1/search?q=ketenagakerjaan"
Get your free token on the Account page.
Requests without a valid token will be rejected with a 401 error.
Endpoints
GET/api/v1/search
Search regulations by keyword. Uses full-text search with automatic fallback.
Parameters
qrequiredSearch keywordtypeFilter by regulation type (see codes below)limitNumber of results (default: 10, max: 20)Example request
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://pasal.id/api/v1/search?q=upah+minimum&type=UU&limit=3"
Example response
{
"query": "upah minimum",
"total": 3,
"results": [
{
"id": 142,
"snippet": "Upah minimum sebagaimana dimaksud dalam ayat (1) ditetapkan oleh Gubernur…",
"metadata": {
"type": "UU",
"node_type": "pasal",
"node_number": "89"
},
"score": 0.85,
"work": {
"frbr_uri": "/akn/id/act/uu/2003/13",
"title": "Ketenagakerjaan",
"number": "13",
"year": 2003,
// Derived in-force verdict (revocation edges applied at read time),
// not the raw stored field. When the verdict cannot be certain the
// stored status is kept and "status_uncertain": true is added.
"status": "berlaku",
"type": "UU"
}
}
],
// When total === 0, the response also includes a "did_you_mean" array
// of up to 5 pg_trgm word_similarity matches against regulation titles.
// Useful as a soft-landing for typos or pasted full-title queries.
// Suggestions carry no "status" — fetch the law itself for its status.
"did_you_mean": [
{
"work_id": 54653,
"similarity": 0.604,
"work": {
"frbr_uri": "/akn/id/act/permenkes/2015/80",
"title": "Peraturan Menteri Kesehatan Nomor 80 Tahun 2015 tentang Penugasan Khusus Tenaga Kesehatan",
"number": "80",
"year": 2015,
"type": "PERMEN"
}
}
]
}GET/api/v1/laws
List regulations with type, year, and status filters. Supports pagination.
Parameters
typeFilter by regulation type (see codes below)yearFilter by year (e.g., 2023)statusFilter by status: berlaku, dicabut, or diubahlimitNumber of results (default: 20, max: 50)offsetOffset for pagination (default: 0)Example request
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://pasal.id/api/v1/laws?type=UU&year=2003&limit=2"
Example response
{
"total": 5,
"limit": 2,
"offset": 0,
"laws": [
{
"id": 1,
"frbr_uri": "/akn/id/act/uu/2003/13",
"title": "Ketenagakerjaan",
"number": "13",
"year": 2003,
"status": "berlaku",
"content_verified": true,
"type": "UU"
},
{
"id": 7,
"frbr_uri": "/akn/id/act/uu/2003/17",
"title": "Keuangan Negara",
"number": "17",
"year": 2003,
"status": "berlaku",
"content_verified": true,
"type": "UU"
}
]
}GET/api/v1/laws/{frbr_uri}
Full metadata, relationship graph, and parsed articles for a regulation. Requires authentication.
Requires a personal access token and returns the complete article tree, metadata, and cross-references for the specified regulation.
Parameters
frbr_urirequiredFRBR URI path, e.g., akn/id/act/uu/2003/13Example request
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://pasal.id/api/v1/laws/akn/id/act/uu/2003/13"
Example response
{
"work": {
"id": 1,
"frbr_uri": "/akn/id/act/uu/2003/13",
"title": "Ketenagakerjaan",
"number": "13",
"year": 2003,
"status": "berlaku",
"content_verified": true,
"type": "UU",
"type_name": "Undang-Undang"
},
"articles": [
{
"id": 10,
"type": "bab",
"number": "I",
"heading": "KETENTUAN UMUM",
"content": null,
"parent_id": null,
"sort_order": 1
}
],
"detail_access": {
"level": "full",
"articles_included": true,
"access_via": "api_key",
"full_detail_available_via": ["api_key"]
},
"relationships": [
{
"type": "Mengubah",
"type_en": "Amends",
"related_work": {
"frbr_uri": "/akn/id/act/uu/1969/14",
"title": "Ketentuan-Ketentuan Pokok Mengenai Tenaga Kerja",
"number": "14",
"year": 1969,
"status": "dicabut"
}
}
]
}Regulation Type Codes
Use the following codes for the type parameter in /search and /laws endpoints. Not case-sensitive.
| Code | Name |
|---|---|
UUD | Constitution |
TAP_MPR | People's Assembly Decree |
UU | Law |
PERPPU | Government Regulation in Lieu of Law |
KUHPERDATA | Civil Code (Burgerlijk Wetboek) |
PP | Government Regulation |
PERPRES | Presidential Regulation |
KEPPRES | Presidential Decree |
INPRES | Presidential Instruction |
PENPRES | Presidential Determination |
PERMEN | Ministerial Regulation |
PERMENKUMHAM | Minister of Law and Human Rights Regulation |
PERMENKUM | Minister of Law Regulation |
PERBAN | Agency/Institution Regulation |
PERDA | Regional Regulation |
PERDA_PROV | Provincial Regulation |
PERDA_KAB | District/City Regulation |
KEPMEN | Ministerial Decree |
SE | Circular Letter |
PERMA | Supreme Court Regulation |
PBI | Bank Indonesia Regulation |
UUDRT | Emergency Law |
UUDS | Provisional Constitution |
PMK | Constitutional Court Regulation |
PUTUSAN_MK | Constitutional Court Decision |
PERKETUA_MK | Chief Justice of Constitutional Court Regulation |
PERSEKJEN_MK | MK Secretary General Regulation |
POJK | Financial Services Authority Regulation |
PERGUB | Governor Regulation |
PERBUP | Regent Regulation |
PERWALI | Mayor Regulation |
QANUN | Qanun (Aceh Regulation) |
PERDASUS | Papua Special Regional Regulation |
PERDAIS | Special Region Regulation |
Status Values
Use with the status parameter in the /laws endpoint.
| Value | Description |
|---|---|
berlaku | Regulation is currently in force |
dicabut | Regulation has been revoked |
diubah | Regulation has been amended |
Quick Start
Search regulations about employment
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://pasal.id/api/v1/search?q=ketenagakerjaan"
List all Government Regulations from 2020
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://pasal.id/api/v1/laws?type=PP&year=2020"
Public metadata for Law 13/2003 (Employment)
curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://pasal.id/api/v1/laws/akn/id/act/uu/2003/13"
Use in JavaScript / TypeScript
const TOKEN = "pasal_mcp_…"; // Your token from pasal.id/akun
const res = await fetch("https://pasal.id/api/v1/search?q=upah+minimum", {
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await res.json();
for (const result of data.results) {
console.log(result.work.title, "-", result.metadata.node_type, result.metadata.node_number);
console.log(result.snippet);
}Use in Python
import requests
TOKEN = "pasal_mcp_…" # Your token from pasal.id/akun
res = requests.get(
"https://pasal.id/api/v1/laws",
params={"type": "UU", "limit": 5},
headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()
for law in data["laws"]:
print(f"{law['type']} {law['number']}/{law['year']} - {law['title']}")Error Responses
| Code | Description |
|---|---|
400 | Invalid or missing parameters |
401 | Invalid or missing authentication token |
404 | Regulation not found |
429 | Too many requests |
Rate Limiting
All documented `/api/v1/*` endpoints require a personal access token, and each route has its own throttles to discourage bulk extraction.
Token-authenticated
Requests exceeding the limit will receive a 429 Too Many Requests response.
Need higher limits?
If you're building an application that needs more access, we're happy to help. Contact us to discuss your needs, including custom API keys and higher limits.
Contact usFor AI integration, use our MCP Server, direct access from Codex, Claude, and other clients without writing code.