Back to Skills

kosis-stats

국가데이터처가 운영하는 KOSIS(국가통계포털, kosis.kr) Open API로 한국 공식 통계표를 검색하고 메타데이터·데이터·대용량 자료를 조회한다. Use when the user asks for 한국 공식 통계 (인구, 가구, 물가, 고용 등) 수치 조회, not for analysis or visualization.

6,516stars745forksUpdated 7/29/2026

Security Assessment

Safe(92/100)
Security Score92/100

About kosis-stats

KOSIS Stats automates read-only retrieval of official Korean government statistics through the KOSIS (Korean Statistical Information Service, kosis.kr) Open API operated by Statistics Korea. It lets users search official statistical tables and fetch metadata, data cells, and large datasets for topics like population, households, prices, and employment. The skill is explicitly query-only: it does not create, modify, register, or publish statistics, and it is meant for pulling raw numbers rather than analysis or visualization.

A Python helper (stdlib-only, Python 3.9+) exposes subcommands for search, metadata, data, bigdata, list, explain, and indicator, covering endpoints such as statistics search, table metadata, parameterized data-cell queries, large-volume datasets requiring a pre-registered userStatsId, the category tree, statistical explanations, and key-indicator concepts. Common options include human-readable or JSON output, a dry-run mode that prints the request URL and parameters without a key, timeout control, and a direct mode. By default general queries route through a hosted or self-hosted k-skill proxy that injects the KOSIS key server-side, so most usage needs no local credentials; only bigdata or direct calls read a KOSIS API key. Credential resolution is handled safely, preferring existing environment variables, then an agent's own secret vault (1Password, Bitwarden, macOS Keychain), then a fallback dotenv file at 0600 permissions, and its guidance stresses never committing keys, masking keys in dry-run output, and respecting the API rate limit. A reference guide documents key issuance, limits, endpoints, response quirks, and error codes, backed by tests and fixtures.

The target users are analysts, researchers, and developers who need programmatic access to authoritative Korean statistics and want a safe, well-documented CLI wrapper. It is not for real-time market data, visualization, or statistics authoring.

FAQ

Do I need an API key to use it?

For general search, meta, data, list, explain, and indicator queries, no: they route through a hosted or self-hosted k-skill proxy that injects the key server-side. A free KOSIS Open API key is only needed for the bigdata subcommand or direct (proxy-bypassing) calls.

What can and can't it do?

It is query-only: it searches tables and retrieves metadata, data cells, and large datasets. It does not author, register, or modify statistics, and it is not intended for visualization, analysis, reports, or real-time market data.

What are the prerequisites?

Python 3.9+ using only the standard library (no external packages), and access to a k-skill proxy with a KOSIS route for general queries. It is a directory-package skill that also needs its scripts/ and references/ files, not just SKILL.md.

How are API keys handled?

Credentials are resolved from existing environment variables first, then an agent secret vault (1Password, Bitwarden, macOS Keychain), then a fallback dotenv file with 0600 permissions; keys must never be committed and are masked in dry-run output.

What are the API limits I should know about?

Per the reference guide, KOSIS enforces roughly 1,000 calls per minute per key, a 40,000-cell cap per response, HTTPS-only access, and documented error codes for auth, input, quota, and server issues that the helper detects and reports.

All Files

8 files
scripts/run_kosis_stats.py29.6 KB
View
tests/fixtures/data_response.json0.5 KB
View
references/kosis-openapi-guide.md4.9 KB
View
tests/__init__.py0.0 KB
View
tests/fixtures/meta_response.json0.1 KB
View
SKILL.md9.7 KB
View
tests/test_run_kosis_stats.py23.5 KB
View
tests/fixtures/search_response.json0.4 KB
View

Install kosis-stats

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill