結果留在磁碟,不進 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
把內政部實價登錄最新的逐棟成交價與成交租金,整理成結構化 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
↪ 複製後貼到終端機執行
↪ 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
[ { "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
用 --out 把整個行政區寫成一個檔,再用 --top N 或 jq/grep 取列
Write a whole district to one file with --out, then pull rows with --top N or jq/grep
呼叫前不佔 context,可 import 進後端/CI/cron
Costs no context until you call it; import it into a backend, CI or cron
同查詢 → 同結果;邏輯在程式,不是模型在迴圈裡開瀏覽器
Same query → same result; logic lives in code, not a model looping a browser
一致的欄位與型別,直接餵 app、報表或資料管線
Consistent fields and types, ready for apps, reports or data pipelines
| 對照 · COMPARISON | 自己上官網能做On the official site | +tw-lvr-cli 多給你+with tw-lvr-cli | ||
|---|---|---|---|---|
| query | 一次查一組條件,看網頁表格 | One filter set at a time, in an HTML table | 一行指令拿到乾淨 JSON/CSV | One command returns clean JSON/CSV |
| export | 人工複製 | Copy by hand | 直接 --out 寫檔,可進 pipeline | Write 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
內政部實價登錄官網是為「人用瀏覽器查詢、定期批次下載」設計的,沒有給程式逐址查詢用的乾淨 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
$ 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)
--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)
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)
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 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)
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)
整區行情 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)
以可攜的 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
# 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 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
tw-lvr extract 指定地區與月份;加 --pretty 取得格式化 JSON,或加 --out file.csv 把整個行政區寫成一個 CSV 檔。整個過程在程式內完成,結果留在磁碟,不進 LLM context。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.