National Law Information API
Official MOLEG API for searching statutes, administrative rules, local laws, court precedents, Constitutional Court decisions, statutory interpretations, and administrative appeals. Provides over 4.7 million legal records. On this server statutes are served by /api/law, and precedents are served by the separately built /api/prec (35,161 precedents, 30,814 with full text), not by target=prec.
What agents get
- Statute names, serial numbers, promulgation and enforcement dates, responsible ministries, detail links; precedent case names, case numbers, ruling dates, court names; local-law and administrative-rule records
Legal Q&A, contract and regulation review, precedent analysis, compliance checks, and guidance on administrative procedures
Use cases
- Search current statutes by statute name
- Look up full statute text
- Keyword search for precedents
- Search local laws and ordinances
- Verify the statute in force as of an enforcement date
Registered APIs (2)
Statute Search lawSearch.do
Official MOLEG unified search API. On this server /api/law ignores target and returns statutes only; use /api/prec for precedents.
targetRequired — law / prec (MOLEG original metadata) / adhmLaw / ordin / dpc. This server's /api/law does not support target — use /api/prec for precedents e.g.lawqueryRequired — Search keyword e.g.근로기준법typeOptional — JSON or XML e.g.JSONpageOptional e.g.1displayOptional — Results per page e.g.10
Returns: Statute serial number, Statute name in Korean, Promulgation date, Enforcement date, Responsible ministry name, Statute category name, Statute detail link, totalCnt
Rate limit: 10,000 calls/day (Per OC auth key)
Statute Detail Lookup lawService.do
Look up the full text of a statute by its serial number (MST)
targetRequired e.g.lawMSTRequired — Statute serial number (from the lawSearch result) e.g.285279typeOptional — HTML or XML e.g.HTMLefYdOptional — Reference enforcement date e.g.20261008
Returns: Full statute text (article/paragraph/item structure), Supplementary provisions, Enforcement date
Rate limit: 10,000 calls/day
Practical specs (official guides)
| National Law Information Open API guides (191 guides) | Online guide list https://open.law.go.kr/LSO/openApi/guideList.do Many official guides are distributed as HWP/DOCX. Registering server IP and domain is required for an OC key. |
|---|
Endpoints & required parameters
lawSearch.do GET
Direct OC key method
https://law.go.kr/DRF/lawSearch.do
OCRequired — Issued OC keytargetRequired — law / ls / etc e.g.lawqueryRequired — Search term e.g.leasetypeRequired — JSON or XML e.g.JSONdisplayOptional — Page size e.g.20pageOptional — Page e.g.1
Output: 법령일련번호, 법령명한글, 공포일자, 시행일자, 소관부처명, totalCnt
lawService.do GET
Law detail lookup
https://law.go.kr/DRF/lawService.do
OCRequiredtargetRequired e.g.lawMSTOptional — Law serial number (or ID)IDOptional — Law ID (or MST)typeRequired e.g.JSON
Output: 법령 본문 JSON
lawSearchList.do (GW) GET
Via Data.go.kr gateway, developer 10,000 calls/day
https://apis.data.go.kr/1170000/law/lawSearchList.do
serviceKeyRequired — Data.go.kr service keytargetRequired e.g.lawqueryRequired e.g.leasenumOfRowsOptional e.g.10pageNoOptional e.g.1typeRequired e.g.JSON
Output: totalCount, lawSearchList
| Auth | OC key / gateway ServiceKey — OC (direct) / serviceKey (gateway) (query) An OC key only works from the registered server IP/domain. Without registration it returns an authentication failure JSON. |
|---|---|
| Daily limit | Gateway developer account 10,000 calls/day. Check each guide for direct OC key limits. |
Actual response JSON — provider raw
{
"result": "사용자 정보 검증에 실패하였습니다.",
"msg": "OPEN API 호출 시 사용자 검증을 위하여 정확한 서버장비의 IP주소 및 도메인주소를 등록해 주세요."
}Provider error codes
| AUTH_FAIL User verification failed | IP/domain not registered Action: Check the IP/domain registered when issuing the OC key |
|---|---|
| 20 SERVICE_KEY_IS_NULL / PERMISSION_DENIED | Missing key or no permission Action: Check OC/serviceKey and application status |
| 22 LIMITED_NUMBER_OF_SERVICE_REQUESTS_EXCEEDS_ERROR | Daily quota exceeded Action: Resume after midnight |
| 12 NO_OPENAPI_SERVICE_ERROR | Target not found Action: Check target and law ID/MST |
Auth · pricing · terms
| Auth | OC — Issued free at open.law.go.kr. Stored only on the proxy server. |
|---|---|
| Pricing | Free. Auto-approved |
| License | Public data: attribution required |
| Redistribution | Allowed (attribution required) |
| Terms checked | 2026-11-07 |
| Apply | Sign up at open.law.go.kr -> Get an OC auth key (auto-approved) Portal |
| Status | Active |
| Last checked | 2026-11-07 |
How agents call
Call through our proxy. Start with the keyless quick API shown above (no token needed). For the Korean law service, target=law is served from our internal law DB with no token. For the keyed proxy, send X-Agent-Token to POST /agencatalog/api/call with ('service', 'endpoint', 'params'). Token issuance is not self-service; see /agencatalog/register/. The full service list is at /agencatalog/api/services.json.
Example: POST /agencatalog/api/call {service:'law-go-kr', endpoint:'lawSearch.do', params:{target:'law', query:'근로기준법'}}
Machine-readable JSON schema
{
"service": "law-go-kr",
"name": "National Law Information API",
"provider": "MOLEG",
"apis": [
{
"id": "lawSearch.do",
"name": "Statute Search",
"params": [
{
"name": "target",
"required": true,
"example": "law",
"desc": "law / prec (MOLEG original metadata) / adhmLaw / ordin / dpc. This server's /api/law does not support target — use /api/prec for precedents"
},
{
"name": "query",
"required": true,
"example": "근로기준법",
"desc": "Search keyword"
},
{
"name": "type",
"required": false,
"example": "JSON",
"desc": "JSON or XML"
},
{
"name": "page",
"required": false,
"example": "1"
},
{
"name": "display",
"required": false,
"example": "10",
"desc": "Results per page"
}
]
},
{
"id": "lawService.do",
"name": "Statute Detail Lookup",
"params": [
{
"name": "target",
"required": true,
"example": "law"
},
{
"name": "MST",
"required": true,
"example": "285279",
"desc": "Statute serial number (from the lawSearch result)"
},
{
"name": "type",
"required": false,
"example": "HTML",
"desc": "HTML or XML"
},
{
"name": "efYd",
"required": false,
"example": "20261008",
"desc": "Reference enforcement date"
}
]
}
],
"proxy_call": "POST /agencatalog/api/call",
"attribution": "Source: MOLEG National Law Information Service (open.law.go.kr)"
}
Error handling
All responses are JSON. On failure the proxy returns {"ok": false, "error": {"code", "message"}}. Handle by code:
| invalid_token | 403. Missing or invalid X-Agent-Token. Get a token via /agencatalog/register/ and resend with the header. |
|---|---|
| throttle | 429. One-call-per-second limit exceeded. Wait retry_after seconds and retry sequentially (no parallel calls). |
| agent_limit / institution_limit | 429. Daily quota exceeded. Resume after retry_after_seconds. |
| upstream_limit | 429. The upstream provider returned an over-quota error. Retry later. |
| unknown_service | 404. Unregistered service. Check the exact service/endpoint name in services.json. |
| not_found | 404. Bad path. Confirm you use POST /agencatalog/api/call. |
Notes
- API keys live only on the server. Clients asking for keys directly cannot use this route.
- Each provider has a daily quota. Over-quota calls return 429 and are blocked.
- Provider outages or over-quota errors are passed through. Check the error field before retrying.
- Attribution: Source: MOLEG National Law Information Service (open.law.go.kr)
Last checked: 2026-11-07
AI Knowledge Hub