台灣實價登錄 · 開放資料 JSON/CSV

台灣房價成交資料,
變成乾淨的 JSON

Taiwan property transactions,
turned into clean JSON

內政部實價登錄最新的逐棟成交價與成交租金,整理成結構化 JSON/CSV 寫到磁碟——給 agent、app、腳本與後端串接,不佔 LLM 的 context,隨附可攜的 Agent Skill

Turns the latest building-level sale prices and transacted rents from 內政部實價登錄 (MOI real-price registry) into structured JSON/CSV written to disk — for agents, apps, scripts and backends, kept out of the LLM context. Ships with a portable Agent Skill

$ npm i -g tw-lvr-cli copy
$ npx -y tw-lvr-cli@latest extract ... copy

↪ 複製後貼到終端機執行

↪ Copy, then run in your terminal

給程式與 agent 用的實價登錄資料源——不是給人查單一物件的網站

A real-price data source for programs and agents — not a website for looking up a single home

與內政部無關 · unaffiliated

zsh — tw-lvr extract
$ tw-lvr extract --where "新竹市東區關新路" --from 202401 --to 202612 --top 3 --pretty
[
  {
    "building": "丹麥",
    "address": "新竹市關新路19巷99號二樓",
    "txnDateRoc": "114/12/27",
    "totalPriceWan": 2380,
    "siteAdjUnitPrice": 48.1445,
    "totalAreaPing": 49.43,
    "layout": "3房2廳2衛"
  },
  {
    "building": "北歐",
    "address": "新竹市關新路19巷3號十二樓",
    "txnDateRoc": "114/12/27",
    "totalPriceWan": 3930,
    "siteAdjUnitPrice": 45.6988,
    "totalAreaPing": 86,
    "layout": "4房2廳2衛"
  },
  {
    "building": "月影",
    "address": "新竹市關新路29號十二樓之33",
    "txnDateRoc": "114/12/14",
    "totalPriceWan": 1050,
    "siteAdjUnitPrice": 53.3028,
    "totalAreaPing": 19.7,
    "layout": "1房1廳1衛"
  }
]

3 筆成交 · 來源:內政部實價登錄(OGDL)· 約 2–3 秒

3 transactions · Source: MOI real-price registry (OGDL) · ~2–3s

核心價值 · CORE VALUE

核心價值:把資料留在磁碟,讓程式自由運用

Core value: keep the data on disk, let programs work freely

01

結果留在磁碟,不進 context

Results stay on disk, not in context

--out 把整個行政區寫成一個檔,再用 --top N 或 jq/grep 取列

Write a whole district to one file with --out, then pull rows with --top N or jq/grep

02

CLI+library+可攜 Skill,免架 server

CLI + library + portable Skill, no server

呼叫前不佔 context,可 import 進後端/CI/cron

Costs no context until you call it; import it into a backend, CI or cron

03

確定、可重現,約 2–3 秒/查詢

Deterministic, reproducible, ~2–3s/query

同查詢 → 同結果;邏輯在程式,不是模型在迴圈裡開瀏覽器

Same query → same result; logic lives in code, not a model looping a browser

04

乾淨、結構化 JSON/CSV

Clean, structured JSON/CSV

一致的欄位與型別,直接餵 app、報表或資料管線

Consistent fields and types, ready for apps, reports or data pipelines

功能範圍 · SCOPE

功能範圍:官網能做的,加上程式才做得到的

Scope: what the site does, plus what only code can do

對照 · COMPARISON 自己上官網能做On the official site tw-lvr-cli 多給你with tw-lvr-cli
query 一次查一組條件,看網頁表格One filter set at a time, in an HTML table 一行指令拿到乾淨 JSON/CSVOne command returns clean JSON/CSV
export 人工複製Copy by hand 直接 --out 寫檔,可進 pipelineWrite a file with --out, drop into a pipeline
batch 無批次:整區一頁頁翻No batch: page through a district by hand 整個行政區一次取得、寫檔Pull a whole district at once, written to disk
access 只能人點,無法程式化Clicks only, not programmable 可被腳本/agent/後端呼叫Callable from scripts, agents and backends

目前涵蓋 買賣(成屋)+預售屋+租賃;尚未支援 預售建案

Currently covers sales (completed homes) + presale units + rentals; presale development listings are not yet supported

DATA ACCESS

實價登錄 資料下載/JSON,一行指令、全台適用

實價登錄 資料下載/JSON — one command, any city

內政部實價登錄官網是為「人用瀏覽器查詢、定期批次下載」設計的,沒有給程式逐址查詢用的乾淨 API;tw-lvr-cli 在背後啟動短暫的 headless 瀏覽器擷取官網公開資料,整理成一致、可程式讀取的 JSON/CSV,不論哪個縣市,同一行指令就能取得
非官方工具 · 與內政部無關

The official 實價登錄 (MOI real-price registry) site is built for human browser lookups and periodic bulk downloads — not a clean, program-ready per-address API. tw-lvr-cli runs a short-lived headless browser against the official site and normalizes that public data into consistent, machine-readable JSON/CSV; the same one command works for any city
Unofficial tool · unaffiliated with MOI

JSON 查詢JSON query
$ tw-lvr extract --where 新竹市東區關新路 --from 202401 --to 202612 --top 3 --pretty
resolved: 新竹市 關新路
OK: 131 record(s), showing top 3
coverage: 2024=90 2025=39 2026=2 (span 113/01/06..115/05/16)
[
  {
    "building": "月影",
    "buildingUnit": "",
    "address": "新竹市關新路29號二樓之25",
    "addrNum": "29",
    "txnDate": "2026-05",
    "txnDateRoc": "115/05/16",
    "totalPriceWan": 800,
    "rawUnitPrice": 43.5967,
    "siteAdjUnitPrice": 43.5977,
    "siteUnitPriceFormula": "總價/總面積",
    "totalAreaPing": 18.35,
    "totalAreaM2": 60.661246500000004,
    "mainBuildingPct": 33.1,
    "mainAreaM2": 20.08,
    "parkPriceWan": 0,
    "parkAreaM2": null,
    "parkCount": 1,
    "txnType": "房地(土地+建物)+車位",
    "floor": "二層/十三層",
    "buildingType": "住宅大樓(11層含以上有電梯)",
    "mainUse": "辦公用",
    "layout": "1房1衛",
    "hasElevator": true,
    "note": "",
    "lat": 24.784898516070896,
    "lon": 121.01805864228453,
    "detailKey": "rl8zmNv4ii/3Dbx0EhUZatsO6dfoxqTDqjoQF5EZ7A4=",
    "meta": {
      "fetchedAt": "2026-07-06T13:53:40.521Z",
      "queryId": "新竹市 關新路"
    }
  },
  …(節錄:其餘 2 筆省略 · 2 more records omitted)
]

實際輸出節錄(2026-07 擷取)· 資料來源:內政部不動產實價登錄(OGDL)Real output, excerpted (captured 2026-07) · Source: MOI real-price registry (OGDL)

CSV 下載(--out 寫檔)CSV download (--out to file)
$ tw-lvr extract --where 新北市板橋區文化路一段 --from 202301 --to 202612 --out transactions.csv
# → transactions.csv · 整區寫入一個檔,可進 pipeline · one file per district, pipeline-ready
resolved: 新北市 板橋區 文化路一段
OK: 326 record(s)
coverage: 2023=119 2024=96 2025=88 2026=23 (span 112/01/07..115/06/04)
wrote transactions.csv

# transactions.csv 開頭 2 行 · first 2 lines of the file:
building,buildingUnit,address,addrNum,txnDate,txnDateRoc,totalPriceWan,rawUnitPrice,siteAdjUnitPrice,siteUnitPriceFormula,totalAreaPing,totalAreaM2,mainBuildingPct,mainAreaM2,parkPriceWan,parkAreaM2,parkCount,txnType,floor,buildingType,mainUse,layout,hasElevator,note,lat,lon,detailKey
,,板橋區文化路一段136巷13號三樓,13,2026-06,115/06/04,1760,49.6614,49.6559,總價/總面積,35.44,117.15719759999999,88.2,103.33,0,,0,房地(土地+建物),三層/四層,公寓(5樓含以下無電梯),住家用,3房1廳2衛,false,親友、員工、共有人或其他特殊關係間之交易;其他增建;急買急賣;,25.0184862210524,121.46593725426087,MJ78I7rcBb0zSjfPqErzefj7xdXHSWV7Ef+F7Hwgujs=
…(其餘 325 筆在檔案裡 · 325 more rows in the file)

實際輸出節錄(2026-07 擷取)· 資料來源:內政部不動產實價登錄(OGDL)Real output, excerpted (captured 2026-07) · Source: MOI real-price registry (OGDL)

租金查詢(--rent,成交租金非開價)Rent query (--rent — transacted, not asking)
$ tw-lvr extract --where 台北市大安區 --from 202401 --to 202606 --rent --refine --top 3
# → 月租金/坪租/租期/出租型態,rentalService 分開社會住宅補貼案件 · rentalService separates subsidized social housing
resolved: 臺北市 大安區
OK: 4482 record(s), showing top 3
coverage: 2024=1593 2025=1970 2026=919 (span 113/01/01..115/05/20)
usable (non-excluded): 2024=1147 2025=1475 2026=695 (span 113/01/01..115/05/20)

# 節錄第 3 筆,格式化顯示 · record 3 of 3, pretty-printed:
{
  "building": "",
  "address": "大安區安居街124巷6號二樓",
  "addrNum": "6",
  "txnDate": "2026-05",
  "txnDateRoc": "115/05/20",
  "monthlyRentTwd": 22000,
  "unitRentTwdPing": 962,
  "unitRentFormula": "總價/總面積",
  "rawUnitRentTwdPing": 961.54,
  "areaPing": 22.88,
  "areaM2": 75.64,
  "parkRentTwd": 0,
  "rentTarget": "租賃房屋",
  "buildingType": "公寓(5樓含以下無電梯)",
  "mainUse": "",
  "useClass": "",
  "layout": "3房1廳1衛",
  "floor": "二層/三層",
  "hasMgmtOrg": false,
  "hasFurniture": true,
  "hasElevator": false,
  "equipment": "冷氣、熱水器、傢俱",
  "rentalType": "整戶出租",
  "rentalService": "社會住宅代管",
  "buildingAgeYears": 0,
  "rentPeriod": "1150521~1160520",
  "note": "續租案件;",
  "lat": 25.018346559330038,
  "lon": 121.5516021112654,
  "detailKey": "jzSFgigpR3dIUAMWMl3ADPYHd8dslijiCqLRc7DHRQk=",
  "meta": {
    "fetchedAt": "2026-07-06T13:53:45.576Z",
    "queryId": "臺北市 大安區"
  },
  "netRentTwd": 22000,
  "netAreaPing": 22.88,
  "adjUnitRentTwdPing": 962,
  "rentKind": "分層/其他",
  "excluded": false,
  "excludeReason": "",
  "parkRentIncluded": false,
  "confidence": "high"
}

實際輸出節錄(2026-07 擷取)· 資料來源:內政部不動產實價登錄(OGDL)Real output, excerpted (captured 2026-07) · Source: MOI real-price registry (OGDL)

當 library 使用Use as a library
import { extract } from 'tw-lvr-cli';

const res = await extract({
  where: '臺中市西屯區市政北二路',
  from: '202401', to: '202612',
});
// res.data: CleanRawRecord[] — structured, DB-ready records/結構化、可直接寫入 DB
// 實際執行後 · after running for real:
res.code: "OK"
res.data.length: 62
res.data[0]: {
  "building": "天璽II",
  "buildingUnit": "",
  "address": "西屯區市政北二路65號九樓之3",
  "addrNum": "65",
  "txnDate": "2026-04",
  "txnDateRoc": "115/04/20",
  "totalPriceWan": 4450,
  "rawUnitPrice": 44.3757,
  "siteAdjUnitPrice": 44.3749,
  "siteUnitPriceFormula": "總價/總面積",
  "totalAreaPing": 100.28,
  "totalAreaM2": 331.50462120000003,
  "mainBuildingPct": 51.44,
  "mainAreaM2": 170.53,
  "parkPriceWan": 0,
  "parkAreaM2": null,
  "parkCount": 1,
  "txnType": "房地(土地+建物)+車位",
  "floor": "九層/十四層",
  "buildingType": "住宅大樓(11層含以上有電梯)",
  "mainUse": "住家用",
  "layout": "3房1廳3衛",
  "hasElevator": true,
  "note": "",
  "lat": 24.161787532137293,
  "lon": 120.63948040761308,
  "detailKey": "5PC2EKTzcb9TnaViQOVcDdGf/ZBqVYQHcpZK+bhWL5k=",
  "meta": {
    "fetchedAt": "2026-07-06T13:57:18.959Z",
    "queryId": "臺中市 西屯區 市政北二路"
  }
}

實際輸出節錄(2026-07 擷取)· 資料來源:內政部不動產實價登錄(OGDL)Real output, excerpted (captured 2026-07) · Source: MOI real-price registry (OGDL)

WORKED EXAMPLE

實戰一題:租屋板的問題,資料怎麼接手

One real question — from forum thread to answer

tw-lvr 只負責一件事:把整區成交租金寫進磁碟。後面的過濾與統計,是你的 jq/pandas/agent 的事

tw-lvr does exactly one thing — it writes a district's transacted rents to disk. The filtering and stats that follow belong to your jq / pandas / agent

「竹北租金這兩年是不是漲很兇?光明六路又比整區貴多少?」

改寫自租屋討論區的常見提問(去識別化)Paraphrased, de-identified, from a common rental-forum question
① tw-lvr 的事:整區寫進磁碟① tw-lvr's job — the district lands on disk
$ tw-lvr extract --where 新竹縣竹北市 --from 202201 --to 202606 --rent --refine --out zhubei.json
# 光明六路的部分同法再拉一次:--where 新竹縣竹北市光明六路 · same again for the road cut
resolved: 新竹縣 竹北市
OK: 2998 record(s)
coverage: 2022=439 2023=557 2024=809 2025=817 2026=376 (span 111/01/01..115/05/20)
wrote zhubei.json

實際輸出(2026-07 擷取)· 資料來源:內政部不動產實價登錄(OGDL)Real output (captured 2026-07) · Source: MOI real-price registry (OGDL)

② 你的程式接手:排除、分年、取中位數② your code takes over — filter, group, median
import pandas as pd, json
rows = pd.DataFrame(json.load(open("zhubei.json")))
mkt = rows[(~rows.excluded) & (rows.rentKind != "套房")
           & ~rows.rentalService.str.startswith("社會住宅")]
print(mkt.groupby(mkt.txnDate.str[:4]).adjUnitRentTwdPing.median())
# ↑ 排除註記異常與社會住宅補貼案件,只留市場行情 · keep market-rate leases only
txnDate
2022    582.0
2023    628.0
2024    682.5
2025    671.0
2026    655.0
Name: adjUnitRentTwdPing, dtype: float64
# 元/坪/月,年度中位數 · median TWD per ping per month, by year

實際輸出(對同一份 zhubei.json 重跑可重現)· 資料來源:內政部不動產實價登錄(OGDL)Real output — reproducible against the same zhubei.json · Source: MOI real-price registry (OGDL)

答案Answer

整區行情 2022→2024 漲約 +17%,之後回落(2025 −1.7%、2026 上半年再 −2.4%);光明六路較整區貴約 13–16%(2024–25,樣本 n=10/16)

District market rents rose about +17% from 2022 to 2024, then eased (−1.7% in 2025, another −2.4% in 2026 H1); 光明六路 runs roughly 13–16% above the district (2024–25, n=10/16)

方法:排除套房與社會住宅補貼案件後取年度中位數(元/坪/月);整區年度樣本 n≥98;n<10 的年份不下結論。資料擷取 2026-07 · 來源:內政部不動產實價登錄(OGDL)

Method: yearly medians (TWD/ping/month) after dropping studios and subsidized social-housing leases; district cuts have n≥98 per year; years with n<10 get no conclusion. Captured 2026-07 · Source: MOI real-price registry (OGDL)

PLUGIN

當 plugin 用:裝進 Claude Code 與 Codex

Use as a plugin — install into Claude Code and Codex

以可攜的 Agent Skill 形式提供,讓 coding agent 直接呼叫 tw-lvr,結果寫到磁碟、不佔對話 context

Shipped as a portable Agent Skill so a coding agent can call tw-lvr directly — results land on disk, out of the conversation context

Claude Code

Agent Skill
Claude Code
# Type inside Claude Code/在 Claude Code 內輸入:
/plugin marketplace add felixfu824/taiwan-property-price-cli
/plugin install tw-lvr-cli@tw-lvr-cli
# Then ask for “關新路 202401–202612 transactions”/之後可直接查 202401–202612 成交

Codex

Agent Skill
codex plugins
$ codex plugin marketplace add felixfu824/taiwan-property-price-cli
$ codex plugin add tw-lvr-cli@tw-lvr-cli
# Portable with the project; no always-on server/skill 隨專案可攜,無需常駐 server
誠實邊界 · HONEST BOUNDARIES

誠實邊界:選對工具,比硬塞功能重要

Honest boundaries: the right tool beats a bloated one

不是給你的 · not for you
只想查一間房?
Just looking up one home?
  • 用 591/樂居——免費、UI 好、資料已清洗
  • Use 591/樂居 — free, good UI, already cleaned
  • 想看單一物件的歷史成交與行情走勢,網站體驗更好
  • For one property's history and trend, the websites are simply nicer
  • 不需要寫程式、不需要批次,就別裝 CLI
  • No code, no batch needed — don't install a CLI
是給你的 · for you
需要程式吃的乾淨資料?
Need clean data for code?
  • app/後端/agent 要直接吃結構化、即時的實價資料
  • An app, backend or agent that consumes structured, current real-price data
  • 要整區批次、寫檔、進資料管線或排程
  • District-wide batch pulls, file output, pipelines or schedules
  • 要確定、可重現的結果——用 tw-lvr-cli
  • Deterministic, reproducible results — use tw-lvr-cli
FAQ

常見問題

Frequently asked

內政部官網是為人用瀏覽器查詢、定期批次下載而設計,沒有給程式逐址查詢用的乾淨 API。tw-lvr-cli 在背後跑短暫的 headless 瀏覽器擷取官網公開資料,整理成一致的 JSON/CSV,不論哪個縣市,同一行指令就能取得。它是非官方工具,與內政部無關。
The official site is built for human browser lookups and periodic bulk downloads, not a clean program-ready per-address API. tw-lvr-cli runs a short-lived headless browser against it and normalizes the public data into consistent JSON/CSV; the same one command works for any city. It is an unofficial tool, unaffiliated with MOI.
tw-lvr extract 指定地區與月份;加 --pretty 取得格式化 JSON,或加 --out file.csv 把整個行政區寫成一個 CSV 檔。整個過程在程式內完成,結果留在磁碟,不進 LLM context。
Run tw-lvr extract with a location and month range; add --pretty for formatted JSON, or --out file.csv to write a whole district to one CSV. It all happens in code and the result stays on disk — out of the LLM context.
沒有,而且是刻意的。tw-lvr-cli 以 Agent Skill 加上 Claude/Codex plugin 與 library 的形式提供,而非常駐的 MCP server——這樣呼叫前不佔 context,結果寫到磁碟、可重現,也更容易進 CI/cron。
No, by design. tw-lvr-cli ships as an Agent Skill plus Claude/Codex plugin and a library — not a long-running MCP server. That way it costs no context until called, writes reproducible results to disk, and slots into CI/cron easily.
資料來自內政部實價登錄的公開開放資料(OGDL);tw-lvr-cli 與內政部、591、樂居皆無關。要查單一物件、看行情走勢,591/樂居 的網站體驗更好;要把資料給程式或 agent 直接使用,才用 tw-lvr-cli。
Data comes from MOI's public open data (OGDL); tw-lvr-cli is unaffiliated with MOI, 591 or 樂居. For looking up a single property or browsing trends, those websites are nicer; tw-lvr-cli is for feeding data straight into programs or agents.
目前涵蓋 買賣(成屋)+預售屋+租賃(--rent,租賃有獨立輸出結構),可依地區與月份查詢;尚未支援預售建案。資料源自內政部實價登錄開放資料,採政府資料開放授權條款(OGDL,可轉 CC BY 4.0)。本工具按現狀提供,與內政部無關。
It covers sales (completed homes) + presale units + rentals (--rent, with its own lease output schema), queryable by location and month; presale development listings are not yet supported. Data is sourced from MOI real-price open data under the Open Government Data License (OGDL, convertible to CC BY 4.0). Provided as-is, unaffiliated with MOI.
npm i -g tw-lvr-cli

把實價登錄變成你程式的資料源

Make the real-price registry your program's data source

$ npm i -g tw-lvr-cli copy