# Korea Real Estate Transactions - 국토부 실거래가 (`gochujang/korea-real-estate-transactions`) Actor

Fetches Korea real estate transaction data from the Ministry of Land public API. Covers apartment, villa, and office-tel buy/rent deals by region and period.

- **URL**: https://apify.com/gochujang/korea-real-estate-transactions.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Korea Real Estate Transactions — 국토부 실거래가

Fetch official Korean real estate transaction records from the **Ministry of Land, Infrastructure and Transport (국토교통부)** public API. Covers apartment, villa (연립/다세대), and officetel buy and rent deals by region and time period. Perfect for real estate analysis, housing market research, property price tracking, and investment data pipelines in South Korea.

***

### Features

- **6 property types**: Apartment buy/rent, Villa buy/rent, Officetel buy/rent
- **Region filtering**: Specify any number of 5-digit region codes (법정동 코드)
- **Multi-month queries**: Query multiple year-months in a single run
- **Automatic pagination**: Fetches all pages per region/month combination
- **Retry logic**: 3 retries with exponential backoff on network errors
- **XML fallback**: Handles endpoints that return XML instead of JSON
- **PPE billing**: Pay only for records actually returned

***

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `service_key` | string | Yes | API key from [data.go.kr](https://www.data.go.kr). Obtain by registering and requesting access to the RTMSDataSvc APIs. |
| `property_type` | string | Yes | One of: `apartment_buy`, `apartment_rent`, `villa_buy`, `villa_rent`, `officetel_buy`, `officetel_rent` |
| `region_codes` | string\[] | Yes | 5-digit legal-district codes. Examples: Seoul=`11`, Gangnam-gu=`11680`, Jongno-gu=`11110`. Lookup codes at [code.go.kr](https://www.code.go.kr). |
| `deal_months` | string\[] | Yes | Year-months to query in `YYYYMM` format. E.g. `["202408", "202409"]` |
| `max_results` | integer | No | Maximum records to return (default: 1000) |

#### How to get an API key

1. Visit [data.go.kr](https://www.data.go.kr) and create a free account
2. Search for "국토교통부 아파트매매 실거래 자료" (or the relevant dataset)
3. Click "활용신청" (Apply for use) — approval is usually instant
4. Copy your `serviceKey` from the "마이페이지 > 개발계정" tab

***

### Output

Each record contains:

| Field | Type | Description |
|-------|------|-------------|
| `property_type` | string | Input property type (e.g. `apartment_buy`) |
| `region_code` | string | 5-digit region code |
| `deal_year_month` | string | YYYYMM of the deal |
| `name` | string | Building/complex name (단지명) |
| `area_sqm` | float | Exclusive area in sqm (전용면적) |
| `floor` | integer | Floor number |
| `deal_amount_krw` | integer | Transaction price in KRW (매매가, comma-stripped) |
| `deal_date` | string | ISO date `YYYY-MM-DD` |
| `address` | string | Legal address (지번) |
| `rent_type` | string | `"전세"` or `"월세"` (rent records only) |
| `deposit_krw` | integer | Deposit amount in KRW (rent records only) |
| `monthly_rent_krw` | integer | Monthly rent in KRW (월세 records only) |

#### Example output (apartment\_buy)

```json
{
  "property_type": "apartment_buy",
  "region_code": "11680",
  "deal_year_month": "202408",
  "name": "래미안퍼스티지",
  "area_sqm": 84.97,
  "floor": 12,
  "deal_amount_krw": 2850000000,
  "deal_date": "2024-08-05",
  "address": "개포동 1217",
  "rent_type": null,
  "deposit_krw": null,
  "monthly_rent_krw": null
}
```

#### Example output (apartment\_rent)

```json
{
  "property_type": "apartment_rent",
  "region_code": "11110",
  "deal_year_month": "202409",
  "name": "경희궁자이",
  "area_sqm": 59.9,
  "floor": 7,
  "deal_amount_krw": null,
  "deal_date": "2024-09-12",
  "address": "교북동 10",
  "rent_type": "전세",
  "deposit_krw": 700000000,
  "monthly_rent_krw": 0
}
```

***

### Pricing (Pay-Per-Event)

| Event | Price | When charged |
|-------|-------|-------------|
| Actor start | $0.001 | Once per run |
| Per transaction record | $0.001 | Per record pushed to dataset |

Fetching 1,000 apartment buy records ≈ **$1.001 total**.

***

### Notes

- Region codes are the first 5 digits of the 10-digit 법정동 코드. Use `11` for all of Seoul (slower, large result set).
- The public API rate-limits aggressively. The Actor automatically retries on transient failures.
- Some endpoints return XML regardless of `_type=json` parameter — the Actor handles both formats transparently.
- Data is updated by the Ministry of Land approximately monthly; very recent transactions may not yet appear.

**Keywords:** South Korea real estate, 국토부, apartment transactions, property market, 실거래가, land registry, housing market

# Actor input Schema

## `service_key` (type: `string`):

Deprecated — no longer required. This actor now scrapes rt.molit.go.kr directly without an API key.

## `property_type` (type: `string`):

Type of real estate transaction to fetch.

## `region_codes` (type: `array`):

List of 5-digit region codes from rt.molit.go.kr. Sido (province) codes end in 000: Seoul=11000, Busan=26000. Sgg (district) codes: Gangnam-gu=11680, Jongno-gu=11110. Use sido code to get all districts at once.

## `deal_months` (type: `array`):

List of year-months to query in YYYYMM format. E.g. \["202408", "202409"].

## `max_results` (type: `integer`):

Maximum number of transaction records to return across all regions and months.

## Actor input object example

```json
{
  "property_type": "apartment_buy",
  "region_codes": [
    "11000",
    "11680"
  ],
  "deal_months": [
    "202408",
    "202409"
  ],
  "max_results": 1000
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/korea-real-estate-transactions").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/korea-real-estate-transactions").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 '{}' |
apify call gochujang/korea-real-estate-transactions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/korea-real-estate-transactions"
        }
    }
}

```

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/ELA537FRK2gKGJNgk/builds/gUMBSXNycHbek2jit/openapi.json
