{"skill":{"slug":"mfds-cli","displayName":"Mfds Cli","summary":"Korean Ministry of Food and Drug Safety (식품의약품안전처) public API CLI. Search drug product permissions (의약품 허가정보), consumer-friendly drug info (e약은요), DUR contra...","description":"---\nname: mfds-cli\ndescription: Korean Ministry of Food and Drug Safety (식품의약품안전처) public API CLI. Search drug product permissions (의약품 허가정보), consumer-friendly drug info (e약은요), DUR contraindications (병용금기/특정연령금기/임부금기/효능군중복), and drug recall/sale-stop alerts. Returns clean JSONL for AI agents. Use for pharmacy AI, medication-safety bots, prescription review, supplement diligence, and Korean healthcare data pipelines. Requires a free MFDS_API_KEY from data.go.kr.\nlicense: MIT-0\n---\n\n# mfds-cli — Korea Ministry of Food and Drug Safety (식품의약품안전처) CLI\n\nWraps four high-value MFDS Open APIs published on **data.go.kr**: drug master, e약은요 (consumer drug leaflet), DUR contraindications, and drug recalls / sale-stop notices. Every endpoint returns XML or JSON; this skill normalizes everything to **JSONL** so AI agents can pipe it straight into a vector store, a notebook, or another tool.\n\n> **Why this matters**: Korean drug data is the highest-traffic public-data category on data.go.kr after real estate. Pharmacy chatbots, medication-safety agents, and clinical-decision tools need a single, clean interface — not four separate XML wrappers. This is the only ClawHub skill covering MFDS at the time of publish.\n\n## Quick start\n\n```bash\nexport MFDS_API_KEY=\"<your-decoded-serviceKey>\"   # from data.go.kr (free, instant approval)\n\n# Search the drug master by Korean or English name\nbin/mfds-cli drug --name \"타이레놀\" --rows 5\n\n# Consumer-friendly drug leaflet (efficacy, dosage, side effects, storage)\nbin/mfds-cli drug-easy --name \"게보린\" --rows 3\n\n# Drug-drug interaction (병용금기) lookup\nbin/mfds-cli dur --type interaction --name \"와파린\"\n\n# Drugs recalled or sales-suspended this year\nbin/mfds-cli recall --year 2026 --rows 50\n```\n\n## Subcommands\n\n| Command | API | Use case |\n|---|---|---|\n| `drug` | DrugPrdtPrmsnInfoService06 | Drug product master — 품목명/제조사/허가번호/제형/주성분 |\n| `drug-easy` | DrbEasyDrugInfoService (e약은요) | Consumer leaflet — 효능/용법/주의/부작용/보관 |\n| `dur` | DURPrdlstInfoService03 (8 sub-types) | DUR contraindications and warnings |\n| `recall` | MdcinExecRslt2Service | Drug recall, sales-stop, disposal orders |\n\n### Common flags\n\n- `--key <KEY>` — override `$MFDS_API_KEY`\n- `--rows N` — page size (default 30, max 100)\n- `--page N` — 1-indexed page (default 1)\n- `--format jsonl|json|xml` — output (default jsonl)\n- `--raw` — pass through API response without normalization (for debugging)\n- `--endpoint <full-url>` — escape hatch when MFDS rotates a service version\n\n### `drug` — drug master\n\n| Flag | Maps to | Notes |\n|---|---|---|\n| `--name \"<text>\"` | `item_name` | 품목명 (Korean or English) |\n| `--maker \"<text>\"` | `entp_name` | 업체명 |\n| `--item-seq <13-digit>` | `item_seq` | 품목기준코드 |\n| `--bizrno <10-digit>` | `bizrno` | 업체 사업자등록번호 |\n| `--type-code <code>` | `prduct_type` | 전문/일반/원료의약품 등 |\n| `--cancel-name <text>` | `cancel_name` | 취소사유 (검색 시 취하/취소된 의약품도 포함) |\n\n### `drug-easy` — consumer leaflet (e약은요)\n\n| Flag | Maps to | Notes |\n|---|---|---|\n| `--name \"<text>\"` | `itemName` | 품목명 |\n| `--maker \"<text>\"` | `entpName` | 업체명 |\n| `--item-seq <13-digit>` | `itemSeq` | |\n| `--query-efficacy \"<text>\"` | `efcyQesitm` | 효능 키워드 검색 |\n| `--query-method \"<text>\"` | `useMethodQesitm` | 용법 키워드 |\n| `--query-warning \"<text>\"` | `atpnQesitm` | 주의사항 키워드 |\n| `--query-side-effect \"<text>\"` | `seQesitm` | 부작용 키워드 |\n| `--query-storage \"<text>\"` | `depositMethodQesitm` | 보관법 키워드 |\n\n### `dur` — DUR contraindication lookup\n\nThe DUR API publishes 8 distinct lists. Use `--type` to pick:\n\n| `--type` | Korean | What it tells you |\n|---|---|---|\n| `interaction` | 병용금기 | Drug A + Drug B should not be taken together |\n| `age` | 특정연령대금기 | Forbidden under N years old |\n| `pregnancy` | 임부금기 | Forbidden during pregnancy + grade A/B/C/D/X |\n| `capacity` | 용량주의 | Daily-dose cap warning |\n| `period` | 투여기간주의 | Max consecutive days warning |\n| `elderly` | 노인주의 | 65+ caution |\n| `efficacy-duplicate` | 효능군중복 | Same therapeutic class — risk of double-dose |\n| `extended-release` | 서방정분할주의 | Do not split this extended-release tablet |\n\nFilters: `--name \"<품목명>\"`, `--ingredient \"<주성분명>\"`, `--type-name \"<DUR유형명>\"`.\n\n### `recall` — recall / sales-stop / disposal\n\n| Flag | Notes |\n|---|---|\n| `--year YYYY` | 시정조치년도 |\n| `--name \"<text>\"` | 품목명 |\n| `--maker \"<text>\"` | 제조/수입업체명 |\n| `--action <code>` | 시정조치코드 (회수/판매중지/폐기 등) |\n\n## Output schema (JSONL)\n\nEach record is one line. The CLI normalizes MFDS XML/JSON into a stable shape; `_raw` retains the original API field names for fields the normalizer doesn't yet cover.\n\n```json\n{\n  \"type\": \"drug\",\n  \"item_seq\": \"200005221\",\n  \"item_name_ko\": \"타이레놀정500밀리그람(아세트아미노펜)\",\n  \"item_name_en\": \"Tylenol Tab. 500mg (Acetaminophen)\",\n  \"maker\": \"한국얀센(주)\",\n  \"permit_no\": \"200500001\",\n  \"permit_date\": \"20051018\",\n  \"form_code\": \"정제\",\n  \"main_ingredient\": \"아세트아미노펜 500mg\",\n  \"atc_code\": \"N02BE01\",\n  \"kpic_code\": \"643301250\",\n  \"narcotic\": false,\n  \"prescription\": \"일반의약품\",\n  \"_raw\": { \"...\": \"...\" }\n}\n```\n\n## Examples\n\nThe `examples/` folder includes:\n- `drug-name-to-leaflet.sh` — chain `drug` → `drug-easy` to get full consumer info from a brand name\n- `prescription-safety-check.sh` — given a list of drug names, flag DUR interactions and pregnancy warnings\n- `recall-watch.sh` — daily delta of recalls vs. yesterday's snapshot\n\n## Getting an API key\n\n1. Register at https://www.data.go.kr (Naver / Kakao social login OK).\n2. Search \"의약품제품허가정보\" (or any of the 4 services) and click **활용신청**.\n3. Approval is automatic for development tier (10,000 calls/day).\n4. Copy the **decoded** service key (not the URL-encoded one) and `export MFDS_API_KEY=...`.\n\nThe same key works across all four services after you register each one.\n\n## Rate limits\n\n- Development tier: 10,000 requests/day per service.\n- Production tier: unlimited after publishing a use case.\n- The CLI does not retry on 429; if you hit it, slow down with `sleep 0.2` between calls.\n\n## License\n\nMIT-0 — public-domain-equivalent. MFDS data itself is **공공누리 제1유형** (free use with attribution to 식품의약품안전처).\n","tags":{"drug":"0.1.0","healthcare":"0.1.0","korea":"0.1.0","korean":"0.1.0","latest":"0.1.0","mfds":"0.1.0","pharmacy":"0.1.0","public-data":"0.1.0"},"stats":{"comments":0,"downloads":336,"installsAllTime":13,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1778026234468,"updatedAt":1778492854429},"latestVersion":{"version":"0.1.0","createdAt":1778026234468,"changelog":"- Initial release of mfds-cli, a CLI for Korea Ministry of Food and Drug Safety (MFDS) public APIs.\n- Supports searching drug product permissions, consumer-friendly drug info, DUR contraindications, and drug recall/sale-stop alerts, all normalized to JSONL output.\n- Four main subcommands: drug, drug-easy, dur, and recall, each wrapping a corresponding MFDS API endpoint.\n- Includes detailed flag support, normalization options, and example usage scripts for pharmacy and healthcare workflows.\n- Requires free MFDS_API_KEY registration at data.go.kr; data rate limits and licensing are documented.","license":"MIT-0"},"metadata":null,"owner":{"handle":"chloepark85","userId":"s176h4kgd3ahcdsgj48g3epf1584a12v","displayName":"Chloe Park","image":"https://avatars.githubusercontent.com/u/15118976?v=4"},"moderation":null}