Skip to content

Instantly share code, notes, and snippets.

@ptxmotc
Created January 4, 2018 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptxmotc/bed5e1e48274c1147c7bf01eeb1ea04c to your computer and use it in GitHub Desktop.
Save ptxmotc/bed5e1e48274c1147c7bf01eeb1ea04c to your computer and use it in GitHub Desktop.
支援ODATA查詢語法.md

【ODATA使用說明】

  1. 基本查詢 http://ptx.transportdata.tw/MOTC/Rail/TRA/Station?$format={format}

    {format}為資料格式:json、xml、csv

    範例:火車車站基本資料http://ptx.transportdata.tw/MOTC/Rail/TRA/Station?$format=xml

  2. 進階查詢

    {dataId}:資料代號

    {format}:資料格式

    {top}:取最前筆數

    {skip}:跳過筆數

    {orderby}:排序欄位

    範例:火車車站資本資料

    http://ptx.transportdata.tw/MOTC/v2/Rail/TRA/Station?$orderby=StationID&$top=10&$skip=100&$format=JSON

    ps:其中StationID為資料欄位名稱

  3. ODATA服務開發實作請詳見連結

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment