# Korean Public Libraries API - Hours & Seats (`ingenuous_signature/korea-libraries-kr`) Actor

Export official Korean library addresses, opening hours, closed days and reading seats from data.go.kr. No API key needed; bring your own approved key optionally. Not live occupancy.

- **URL**: https://apify.com/ingenuous\_signature/korea-libraries-kr.md
- **Developed by:** [종현 김](https://apify.com/ingenuous_signature) (community)
- **Categories:** Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 100 library records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Korea Libraries KR

Export one bounded page of official Korean library records for finding opening hours, closed days and reading seats. This Actor uses the [national library standard dataset](https://www.data.go.kr/data/15013109/standard.do) and its [OpenAPI](https://www.data.go.kr/data/15013109/openapi.do), not a library website scraper. The [DCAT metadata](https://www.data.go.kr/biz/dcat/metadata/15013109.do) says `이용허락범위 제한 없음`.

### Input

No API key needed: the Actor uses its approved key for this OpenAPI by default. Optionally bring your own approved **serviceKey** to use your own quota. The catalog lists free automatic approval, 10,000 development requests and the fixed HTTPS endpoint `https://api.data.go.kr/openapi/tn_pubr_public_lbrry_api`. Your optional key uses the secret input field; neither key is bundled, logged or written to the dataset. Encoded and decoded keys are accepted. Working example: `{"maxItems":1,"pageNo":0}`. `maxItems` defaults to 1 (1–200), `pageNo` defaults to 0 (0–1000), and optional `libraryName` and `province` use the documented `LBRRY_NM` and `CTPRVN_NM` filters. Exactly one source page is requested per run; the approved daily quota is shared by no-key users and quota exhaustion fails explicitly.

### Output

Each dataset item contains `name`, `libraryType`, `roadAddress`, `latitude`, `longitude`, `closedDays`, weekday/Saturday/holiday opening and closing times, `readingSeats` and `officialSource`. Missing or invalid optional numbers become `null`; time and closed-day descriptions remain as published, including `00:00` values. There is **no generated library ID**: the official response field table has no ID. Personal phone numbers and unrelated source fields are discarded. The dataset describes source records, not live availability or a guaranteed update schedule.

An empty page emits no dataset records and no charge event. API authentication, quota, HTTP, JSON and response-shape failures fail explicitly without disclosing a key.

### Pricing

Pay per event `records-100`: **USD $0.10 for each started block of 100 emitted rows** (1–100 = one event, 101–200 = two, 0 = none). The source API itself is free; this covers Apify normalization/execution. Accepted events are not settled payments. See [pricing notes](docs/pricing.md).

### Local checks

Run `npm install`, `npm test`, `npm run typecheck:tests`, `npm run build`, and `apify validate-schema` in this directory. Fixtures are synthetic records using field names and example values from the official response table; the JSON envelope is based on the sibling national-standard-data Actor and is exercised over local HTTP. No live key or authenticated API receipt is stored.

# Actor input Schema

## `serviceKey` (type: `string`):

No API key needed: the Actor uses its approved key by default. Optionally enter your own key approved for OpenAPI 15013109 (encoded or decoded) to use your own quota.

## `maxItems` (type: `integer`):

One API page only, up to 200 records.

## `pageNo` (type: `integer`):

The official request table shows pageNo=0 in its example.

## `libraryName` (type: `string`):

Optional official LBRRY\_NM filter, maximum 100 characters.

## `province` (type: `string`):

Optional official CTPRVN\_NM filter, maximum 100 characters.

## Actor input object example

```json
{
  "maxItems": 1,
  "pageNo": 0
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("ingenuous_signature/korea-libraries-kr").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "maxItems": 1 }

# Run the Actor and wait for it to finish
run = client.actor("ingenuous_signature/korea-libraries-kr").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 1
}' |
apify call ingenuous_signature/korea-libraries-kr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ingenuous_signature/korea-libraries-kr"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ervVdY20cZ4ySiRuR/builds/IS5BamBIFs3oPRi6T/openapi.json
