Langsung ke konten utama
Skip to main content

API Documentation

Pasal.id public API for accessing Indonesian legal data. Free, no authentication, CORS enabled.

Base URL

https://pasal.id/api/v1

Endpoints

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 diubah
limitNumber 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"
    }
  ]
}
GET/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/13

Example 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.

CodeName
UULaw
PPGovernment Regulation
PERPRESPresidential Regulation
PERPPUGovernment Regulation in Lieu of Law
PERMENMinisterial Regulation
KEPPRESPresidential Decree
INPRESPresidential Instruction
PERDARegional Regulation
PERDA_PROVProvincial Regulation
PERDA_KABDistrict/City Regulation
UUDConstitution
TAP_MPRPeople's Assembly Decree
PERMASupreme Court Regulation
PBIBank Indonesia Regulation
PENPRESPresidential Determination
KEPMENMinisterial Decree
SECircular Letter
PERBANAgency/Institution Regulation
PERMENKUMHAMMinister of Law and Human Rights Regulation
PERMENKUMMinister of Law Regulation
UUDRTEmergency Law
UUDSProvisional Constitution

Status Values

Use with the status parameter in the /laws endpoint.

ValueDescription
berlakuRegulation is currently in force
dicabutRegulation has been revoked
diubahRegulation 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

CodeDescription
400Invalid or missing parameters
404Regulation not found
429Too many requests

Rate Limiting

This API is free and open to all. To maintain service quality, we apply the following limits:

Requests per minute60
Requests per day1.000
AuthenticationNot required
CORSAll origins (*)

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 us

For AI integration, use our MCP Server, direct access from Claude without writing code.