API Documentation
Pasal.id public API for accessing Indonesian legal data. Free, no authentication, CORS enabled.
Base URL
https://pasal.id/api/v1Endpoints
/api/v1/searchSearch 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: 50)Example request
curl "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,
"status": "berlaku",
"type": "UU"
}
}
]
}/api/v1/lawsList 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: 100)offsetOffset for pagination (default: 0)Example request
curl "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"
}
]
}/api/v1/laws/{frbr_uri}Full detail of a regulation: metadata, list of articles with content, and relationships to other regulations.
Parameters
frbr_urirequiredFRBR URI path, e.g., akn/id/act/uu/2003/13Example request
curl "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",
"source_url": "https://peraturan.go.id/..."
},
"articles": [
{
"id": 10,
"type": "bab",
"number": "I",
"heading": "KETENTUAN UMUM",
"content": null,
"parent_id": null,
"sort_order": 1
},
{
"id": 11,
"type": "pasal",
"number": "1",
"heading": null,
"content": "Dalam undang-undang ini yang dimaksud dengan: 1. Ketenagakerjaan adalah...",
"parent_id": 10,
"sort_order": 2
}
],
"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 |
|---|---|
UU | Law |
PP | Government Regulation |
PERPRES | Presidential Regulation |
PERPPU | Government Regulation in Lieu of Law |
PERMEN | Ministerial Regulation |
KEPPRES | Presidential Decree |
INPRES | Presidential Instruction |
PERDA | Regional Regulation |
PERDA_PROV | Provincial Regulation |
PERDA_KAB | District/City Regulation |
UUD | Constitution |
TAP_MPR | People's Assembly Decree |
PERMA | Supreme Court Regulation |
PBI | Bank Indonesia Regulation |
PENPRES | Presidential Determination |
KEPMEN | Ministerial Decree |
SE | Circular Letter |
PERBAN | Agency/Institution Regulation |
PERMENKUMHAM | Minister of Law and Human Rights Regulation |
PERMENKUM | Minister of Law Regulation |
UUDRT | Emergency Law |
UUDS | Provisional Constitution |
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 "https://pasal.id/api/v1/search?q=ketenagakerjaan"
List all Government Regulations from 2020
curl "https://pasal.id/api/v1/laws?type=PP&year=2020"
Detail of Law 13/2003 (Employment) with all articles
curl "https://pasal.id/api/v1/laws/akn/id/act/uu/2003/13"
Use in JavaScript / TypeScript
const res = await fetch("https://pasal.id/api/v1/search?q=upah+minimum");
const data = await res.json();
// data.results berisi array hasil pencarian
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
res = requests.get("https://pasal.id/api/v1/laws", params={"type": "UU", "limit": 5})
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 |
404 | Regulation not found |
429 | Too many requests |
Rate Limiting
This API is free and open to all. To maintain service quality, we apply the following limits:
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 Claude without writing code.