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

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

Taiwan property transactions,
turned into clean JSON

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

Turns the latest building-level transaction prices 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 2024 --to 2026 --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 transactions · Source: MOI real-price registry (OGDL) · ~2s

核心價值 · 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 秒/查詢

Deterministic, reproducible, ~2s/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 and presale development listings are not yet supported

DATA ACCESS

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

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

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

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
Not an official API · unaffiliated with MOI

JSON 查詢JSON query
$ tw-lvr extract --where 新竹市東區關新路 --from 2024 --to 2026 --top 3 --pretty
CSV 下載(--out 寫檔)CSV download (--out to file)
$ tw-lvr extract --where 新北市板橋區文化路一段 --from 2023 --to 2026 --out transactions.csv
# → transactions.csv · 整區寫入一個檔,可進 pipeline
當 library 使用Use as a library
import { extract } from 'tw-lvr-cli';

const res = await extract({
  where: '臺中市西屯區市政北二路',
  from: '2024', to: '2026',
});
// res.data: CleanRawRecord[] — 結構化、可直接寫入 DB
PLUGIN

當 plugin 用:裝進 Claude Code 與 Codex

當 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
# 在 Claude Code 內輸入:
/plugin marketplace add felixfu824/taiwan-property-price-cli
/plugin install tw-lvr-cli@tw-lvr-cli
# 之後可直接「查關新路 2024–2026 成交」

Codex

Agent Skill
codex plugins
$ codex plugin marketplace add felixfu824/taiwan-property-price-cli
$ codex plugin add tw-lvr-cli@tw-lvr-cli
# 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 year 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.
目前涵蓋 買賣(成屋)+預售屋,可依地區與年份查詢;尚未支援租賃與預售建案。資料源自內政部實價登錄開放資料,採政府資料開放授權條款(OGDL,相容 CC BY 4.0)。本工具按現狀提供,與內政部無關。
It covers sales (completed homes) + presale units, queryable by location and year; rentals and presale development listings are not yet supported. Data is sourced from MOI real-price open data under the Open Government Data License (OGDL, compatible with 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