NAV Navbar
cURL

台灣圖霸 | Map8 Platform

歡迎使用 Logo 28x28 台灣圖霸 | Map8 Platform 地圖平台

有任何技術疑難,或其他疑問,都歡迎您 跟我們聯絡 喔!!!

Authentication (認證與授權)

要能取用 Map8 平台的 API,請於 URL query string 中以 key 參數帶入您的 API key :

https://api.map8.zone/place/geocode?address=台北市內湖區新湖三路189號&key=<您的 key>

請務必將上例 <您的 key> 替換成您的 API key 喔!!!

台灣圖霸平台 | Map8 Platform 的 API 透過 API key 來讓您使用平台的 API。您可以 點此申請試用

台灣圖霸平台 | Map8 Platform 的 API 預期來自 client 端的所有 API 請求於 URL 的 query string 中夾帶 API key 以認證並取得使用,例如 :

https://api.map8.zone/v2/place/geocode?address=台北市內湖區新湖三路189號&key=<您的 key>

Notation

  1. 左右鍵符號 (大於、小於符號, 也就是 < >) 所描述的是一個變數 (variable) 的 formal parameter 形式。本文件底下若提及參數部分,使用到此表示法時,請讀者將之代換成實際的內容 (也就是代換為 actual parameter,並且,不留下 < > 符號)。例如, https://api.map8.zone/find?keyword=<關鍵詞> 若實際關鍵詞為 taiwan,則實際呼叫時,應代換為 https://api.map8.zone/find?keyword=taiwan
  2. 位於 API 欄位內格式的 <參數>,為標準的 URL 之 query string 格式編碼 (i.e., name=value 以 URL % 編碼, 並以 & 連接)
  3. 除非另有指定,否則,地理經緯度座標 (lat 或 latitude 均指經度,lng 或 longitude 均指緯度) 以 WGS84 / EPSG:4326 為地理座標系統

Version

API Index

[Places] 地點搜尋

功能 : 搜尋台灣圖霸地圖內的地點

搜尋地點 API (Find Place API)

Syntax

https://api.map8.zone/v2/place/findplacefromtext/json?key=<您的 key>
    &input=<搜尋關鍵詞>
    &locationbias=<緯度>,<經度>

Example

curl -X GET "https://api.map8.zone/v2/place/findplacefromtext/json?key=<您的 key>&input=研鼎智能&locationbias=25.06102,121.58790"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "result": {
    "formatted_address": "台北市內湖區新湖三路189號",
    "geometry": {
      "location": {
        "lat": 25.065089,
        "lng": 121.580056
      }
    },
    "id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "place_id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "name": "研鼎智能股份有限公司",
    "tel": "02-87921567",
    "city": "台北市",
    "town": "內湖區",
    "type": "地點",
    "chain": "",
    "branch": "",
    "cat": "公司行號",
    "distance": 0.91
  },
  "status": "OK"
}

Example : 搜尋地點,並要求若搜尋結果有地址則附帶三碼郵遞區號

curl -X GET "https://api.map8.zone/v2/place/findplacefromtext/json?key=<您的 key>&input=研鼎智能&locationbias=25.06102,121.58790&postcode"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "result": {
    "formatted_address": "台北市內湖區新湖三路189號",
    "geometry": {
      "location": {
        "lat": 25.065089,
        "lng": 121.580056
      }
    },
    "id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "place_id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "name": "研鼎智能股份有限公司",
    "tel": "02-87921567",
    "city": "台北市",
    "town": "內湖區",
    "type": "地點",
    "chain": "",
    "branch": "",
    "cat": "公司行號",
    "distance": 0.91,
    "postcode": "114"
  },
  "status": "OK"
}

Example : 搜尋地點,並要求若搜尋結果有地址則附帶三碼郵遞區號內嵌於 formatted_address 欄位

curl -X GET "https://api.map8.zone/v2/place/findplacefromtext/json?key=<您的 key>&input=研鼎智能&locationbias=25.06102,121.58790&postcode&formatted_address_embed_postcode"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "result": {
    "formatted_address": "114 台北市內湖區新湖三路189號",
    "geometry": {
      "location": {
        "lat": 25.065089,
        "lng": 121.580056
      }
    },
    "id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "place_id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "name": "研鼎智能股份有限公司",
    "tel": "02-87921567",
    "city": "台北市",
    "town": "內湖區",
    "type": "地點",
    "chain": "",
    "branch": "",
    "cat": "公司行號",
    "distance": 0.91
  },
  "status": "OK"
}

給定關鍵詞,搜尋地點

地點詳細資訊 API (Place Details API)

Syntax

https://api.map8.zone/v2/place/details/json?key=<您的 key>
    &placeid=<地點 id>
    &postcode=true
    &formatted_address_embed_postcode=true

Example : 給定地點 ID 以取得地點詳細資訊 (同時,若該地點有地址,也取回三碼郵遞區號)

curl -X GET "https://api.map8.zone/v2/place/details/json?key=<您的 key>&placeid=NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==&postcode=true"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "result": {
    "formatted_address": "台北市內湖區新湖三路189號",
    "geometry": {
      "location": {
        "lat": 25.065089,
        "lng": 121.580056
      }
    },
    "id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "place_id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
    "name": "研鼎智能股份有限公司",
    "tel": "02-87921567",
    "city": "台北市",
    "town": "內湖區",
    "type": "地點",
    "chain": "",
    "branch": "",
    "cat": "公司行號",
    "distance": 0,
    "postcode": "114"
  },
  "status": "OK"
}

取得地點詳細資訊 (主要用於Autocomplete API -- 當使用者選擇了候選清單中的一項的時候,透過 place_id 呼叫本 API 以取得座標、電話等等詳細資料)。

搜尋周遭 API (Nearby Search API)

Syntax

https://api.map8.zone/v2/place/nearbysearch/json?key=<您的 key>
    &location=<緯度>,<經度>
    &radius=<範圍 (km)>
    &cat=<以逗號分隔所列舉之地點類型>

Example : 搜尋以地點為中心之周遭的便利商店與學校 (註 : 為減少篇幅,底下僅列出前五筆)

curl -X GET "https://api.map8.zone/v2/place/nearbysearch/json?key=<您的 key>&location=25.069117,121.58732&cat=便利商店,國小,國中,高中職校&postcode"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "results": [
    {
      "formatted_address": "台北市內湖區民權東路六段69號",
      "geometry": {
        "location": {
          "lat": 25.069215,
          "lng": 121.587593
        }
      },
      "id": "NzYqAQYCRh4HXV5TFDl7K1AdFkRXBRN4BgsFWl1SXxgVAR10AkACEg==",
      "place_id": "NzYqAQYCRh4HXV5TFDl7K1AdFkRXBRN4BgsFWl1SXxgVAR10AkACEg==",
      "name": "萊爾富便利商店北市民東店",
      "tel": "02-27931697",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "萊爾富便利商店",
      "branch": "北市民東店",
      "cat": "便利商店",
      "distance": 0.03,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區民權東路六段45號",
      "geometry": {
        "location": {
          "lat": 25.069168,
          "lng": 121.586274
        }
      },
      "id": "NzYqAQYCRh0FXV9TJwMACz5SGxF6AAkAPBtgaEJ3FiMfSyxqUQFNEg==",
      "place_id": "NzYqAQYCRh0FXV9TJwMACz5SGxF6AAkAPBtgaEJ3FiMfSyxqUQFNEg==",
      "name": "市立三民國中",
      "tel": "02-27924772",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "",
      "branch": "",
      "cat": "國中",
      "distance": 0.106,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區民權東路六段90巷1號",
      "geometry": {
        "location": {
          "lat": 25.068799,
          "lng": 121.586104
        }
      },
      "id": "NzYqAQYCRh0LVllTNFl6TDUDTQAARg15Fg1OfU91HgMBTDJoRFs8Eg==",
      "place_id": "NzYqAQYCRh0LVllTNFl6TDUDTQAARg15Fg1OfU91HgMBTDJoRFs8Eg==",
      "name": "全家便利商店三民店",
      "tel": "02-77230365",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "全家便利商店",
      "branch": "三民店",
      "cat": "便利商店",
      "distance": 0.127,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區湖興里民權東路六段138號",
      "geometry": {
        "location": {
          "lat": 25.068833,
          "lng": 121.588721
        }
      },
      "id": "NzYqAQYCRh0GVlpTACJMMR06HVxdAS1AORt1X24DTEwKTwAbZFdNEg==",
      "place_id": "NzYqAQYCRh0GVlpTACJMMR06HVxdAS1AORt1X24DTEwKTwAbZFdNEg==",
      "name": "市立新湖國小",
      "tel": "02-27963721",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "",
      "branch": "",
      "cat": "國小",
      "distance": 0.145,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區民權東路六段120巷7弄8號",
      "geometry": {
        "location": {
          "lat": 25.067709,
          "lng": 121.587595
        }
      },
      "id": "NzYqAQYCRhwDX1lTIS5CHiIIKzYJQxp0JjB8fl4bE1ZUTQN7fWI8Eg==",
      "place_id": "NzYqAQYCRhwDX1lTIS5CHiIIKzYJQxp0JjB8fl4bE1ZUTQN7fWI8Eg==",
      "name": "7-ELEVEN欣福門市",
      "tel": "02-27916033",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "7-ELEVEN",
      "branch": "欣福門市",
      "cat": "便利商店",
      "distance": 0.159,
      "postcode": "114"
    }
  ],
  "status": "OK"
}

Example : 不指定 cat (地點類型) 參數 (註 : 為減少篇幅,底下僅列出前五筆)

curl -X GET "https://api.map8.zone/v2/place/nearbysearch/json?key=<您的 key>&location=25.06102,121.58790"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "results": [
    {
      "formatted_address": "台北市內湖區新湖三路189號",
      "geometry": {
        "location": {
          "lat": 25.065089,
          "lng": 121.580056
        }
      },
      "id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
      "place_id": "NzYqAQYARhkCVltTRRxiJBIYMDIIZgVSLyMdf25eBDIIPQ1VHWEwEg==",
      "name": "研鼎智能股份有限公司",
      "tel": "02-87921567",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "",
      "branch": "",
      "cat": "公司行號",
      "distance": 0,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區新湖三路189號",
      "geometry": {
        "location": {
          "lat": 25.065089,
          "lng": 121.580056
        }
      },
      "id": "IykqAAMHRBwCV1lTRl90F1RSSDB1fgl6LR1xCXF4Vhc3CxIJfEI0Eg==",
      "place_id": "IykqAAMHRBwCV1lTRl90F1RSSDB1fgl6LR1xCXF4Vhc3CxIJfEI0Eg==",
      "name": "新湖三路189號",
      "tel": "",
      "city": "台北市",
      "town": "內湖區",
      "type": "地址",
      "chain": "",
      "branch": "",
      "cat": "",
      "distance": 0,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區新湖三路191號",
      "geometry": {
        "location": {
          "lat": 25.065226,
          "lng": 121.580315
        }
      },
      "id": "NzYqAQYBQhkBWFJTHB5TFiIVQVxtfwd6EShAVk9DVRFTKSUBDnY4Eg==",
      "place_id": "NzYqAQYBQhkBWFJTHB5TFiIVQVxtfwd6EShAVk9DVRFTKSUBDnY4Eg==",
      "name": "品砌家居",
      "tel": "02-27939213",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "",
      "branch": "",
      "cat": "居家修繕",
      "distance": 0.03,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區新湖三路191號",
      "geometry": {
        "location": {
          "lat": 25.065226,
          "lng": 121.580315
        }
      },
      "id": "IykqAAMHRBwCV15TIgNCDSEoFRRrBSdUAl8AdX9CMk4QNz9HckESEg==",
      "place_id": "IykqAAMHRBwCV15TIgNCDSEoFRRrBSdUAl8AdX9CMk4QNz9HckESEg==",
      "name": "新湖三路191號",
      "tel": "",
      "city": "台北市",
      "town": "內湖區",
      "type": "地址",
      "chain": "",
      "branch": "",
      "cat": "",
      "distance": 0.03,
      "postcode": "114"
    },
    {
      "formatted_address": "台北市內湖區行愛路159號",
      "geometry": {
        "location": {
          "lat": 25.064817,
          "lng": 121.579805
        }
      },
      "id": "NzYqAQYHQxYAXV1TGwMdCiRSFUYBZC9xMhlZZ39RAk4sHkwJfwcWEg==",
      "place_id": "NzYqAQYHQxYAXV1TGwMdCiRSFUYBZC9xMhlZZ39RAk4sHkwJfwcWEg==",
      "name": "第一金證券新湖證券櫃檯",
      "tel": "02-27903860",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "第一金證券",
      "branch": "新湖證券櫃檯",
      "cat": "證券投資",
      "distance": 0.039,
      "postcode": "114"
    }
  ],
  "status": "OK"
}

給定座標,搜尋周遭

任意關鍵詞搜尋 API (Text Search API)

Syntax

https://api.map8.zone/v2/place/textsearch/json?key=<您的 key>
    &query=<關鍵詞 (可空白分隔)>
    &location=<緯度>,<經度>
    &cat=<以逗號分隔所列舉之地點類型>

Example : 以 內湖 台北 為關鍵字搜尋 地點類型加油站 者 (註 : 為減少篇幅,底下僅列出前五筆)

curl -X GET "https://api.map8.zone/v2/place/textsearch/json?key=<您的 key>&query=內湖 台北&cat=加油站&location=25.06102,121.58790"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "results": [
    {
      "formatted_address": "台北市內湖區新明路92號",
      "geometry": {
        "location": {
          "lat": 25.059615,
          "lng": 121.589523
        }
      },
      "id": "NzYqAQYCRh0BXVNTPQV9CxcoDzIMcwtXHzkGU3dYEQ8TDRF8WhlBEg==",
      "place_id": "NzYqAQYCRh0BXVNTPQV9CxcoDzIMcwtXHzkGU3dYEQ8TDRF8WhlBEg==",
      "name": "統一速邁樂加油站內湖一站",
      "tel": "02-27929031",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "統一速邁樂加油站",
      "branch": "內湖一站",
      "cat": "加油站",
      "distance": 0.226
    },
    {
      "formatted_address": "台北市內湖區民權東路六段50號",
      "geometry": {
        "location": {
          "lat": 25.068355,
          "lng": 121.583351
        }
      },
      "id": "NzYqAQYHTR4BWVxTQydkJC4fTAF6ZlgDNAR4QVkfADQyFUJ3U0RNEg==",
      "place_id": "NzYqAQYHTR4BWVxTQydkJC4fTAF6ZlgDNAR4QVkfADQyFUJ3U0RNEg==",
      "name": "台灣宅配通-中油加油站內湖站-代收店",
      "tel": "02-27920678",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "台灣宅配通",
      "branch": "中油加油站內湖站-代收店",
      "cat": "貨運站",
      "distance": 0.936
    },
    {
      "formatted_address": "台北市內湖區民權東路六段50號",
      "geometry": {
        "location": {
          "lat": 25.068355,
          "lng": 121.583351
        }
      },
      "id": "NzYqAQYCRh0BXV9TMSMOEx0+STRRfQ9oWFNcawFEMSALDyMGdFkWEg==",
      "place_id": "NzYqAQYCRh0BXV9TMSMOEx0+STRRfQ9oWFNcawFEMSALDyMGdFkWEg==",
      "name": "中油加油站內湖站",
      "tel": "02-27920678",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "中油加油站",
      "branch": "內湖站",
      "cat": "加油站",
      "distance": 0.936
    },
    {
      "formatted_address": "台北市內湖區內湖路一段362號",
      "geometry": {
        "location": {
          "lat": 25.081308,
          "lng": 121.571103
        }
      },
      "id": "NzYqAQYHTR8CXlxTWD0AFQUUUiFuTD8FTw1vYk98KQM2ABR8QxkaEg==",
      "place_id": "NzYqAQYHTR8CXlxTWD0AFQUUUiFuTD8FTw1vYk98KQM2ABR8QxkaEg==",
      "name": "台灣宅配通-中油加油站內湖麗山街站-代收店",
      "tel": "02-26577339",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "台灣宅配通",
      "branch": "中油加油站內湖麗山街站-代收店",
      "cat": "貨運站",
      "distance": 2.82
    },
    {
      "formatted_address": "台北市內湖區內湖路一段362號",
      "geometry": {
        "location": {
          "lat": 25.081308,
          "lng": 121.571103
        }
      },
      "id": "NzYqAQYCRh0AXlpTMCJSJTE/OFhQc1xVBQB/dnYMLj4IMgBfAFkgEg==",
      "place_id": "NzYqAQYCRh0AXlpTMCJSJTE/OFhQc1xVBQB/dnYMLj4IMgBfAFkgEg==",
      "name": "中油加油站內湖麗山街站",
      "tel": "02-26577339",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "chain": "中油加油站",
      "branch": "內湖麗山街站",
      "cat": "加油站",
      "distance": 2.82
    }
  ],
  "status": "OK"
}

以任意的關鍵詞組合進行搜尋

地點自動完成 API (Place Autocomplete API)

Syntax

https://api.map8.zone/v2/place/autocomplete/json?key=<您的 key>
    &input=<關鍵詞 (可空白分隔)>
    &location=<緯度>,<經度>
    &radius=<範圍 (km)>

Example

curl -X GET "https://api.map8.zone/v2/place/autocomplete/json?key=<您的 key>&input=明美&location=25.06102,121.58790"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "status": "OK",
  "predictions": [
    {
      "id": "NzYqAQYGQhoHWlpTOi0OLlIbDkdAZR0DAA5+UAtYCxwgNhxdRVggEg==",
      "place_id": "NzYqAQYGQhoHWlpTOi0OLlIbDkdAZR0DAA5+UAtYCxwgNhxdRVggEg==",
      "name": "明美",
      "city": "台北市",
      "town": "松山區",
      "type": "地點",
      "cat": "購物商場",
      "distance": 2.212
    },
    {
      "id": "NzYqAQYEQR8LWVtTQDwZFgkVPTZVekVeMy5VQUkfXiggTCRbDngkEg==",
      "place_id": "NzYqAQYEQR8LWVtTQDwZFgkVPTZVekVeMy5VQUkfXiggTCRbDngkEg==",
      "name": "明美公園",
      "city": "台北市",
      "town": "內湖區",
      "type": "地點",
      "cat": "公園",
      "distance": 0.076
    },
    {
      "id": "NzYqAQYCRxsDWl5TDSlXFgABEEJ+dThAMBsPcFkGSCgSFjJKc14kEg==",
      "place_id": "NzYqAQYCRxsDWl5TDSlXFgABEEJ+dThAMBsPcFkGSCgSFjJKc14kEg==",
      "name": "明美藥局",
      "city": "台北市",
      "town": "中山區",
      "type": "地點",
      "cat": "藥局",
      "distance": 6.211
    },
    {
      "id": "NzYqAQYBRh4KXFtTQS9dNFVSTSdqeQsBQgdAX15OJDglHhtWAgM8Eg==",
      "place_id": "NzYqAQYBRh4KXFtTQS9dNFVSTSdqeQsBQgdAX15OJDglHhtWAgM8Eg==",
      "name": "明美精品",
      "city": "台南市",
      "town": "中西區",
      "type": "地點",
      "cat": "購物商場",
      "distance": 269.393
    },
    {
      "id": "NzYqAQYBTR4EXV5TAw5SPT88DxxbAAJ8Py99V2BNEk4kPCVpfwRNEg==",
      "place_id": "NzYqAQYBTR4EXV5TAw5SPT88DxxbAAJ8Py99V2BNEk4kPCVpfwRNEg==",
      "name": "明美藥局",
      "city": "屏東縣",
      "town": "屏東市",
      "type": "地點",
      "cat": "藥局",
      "distance": 289.058
    },
    {
      "id": "NzYqAQYHRRwAXlhTDlt1LlcrDR10DzhiBzlDdw17VU8uTgFIeQAWEg==",
      "place_id": "NzYqAQYHRRwAXlhTDlt1LlcrDR10DzhiBzlDdw17VU8uTgFIeQAWEg==",
      "name": "三明美食",
      "city": "新北市",
      "town": "萬里區",
      "type": "地點",
      "cat": "中式美食",
      "distance": 18.022
    },
    {
      "id": "NzYqAQYGQhcKW1xTAhoFVzYxICVdRglGBh5ye2BmSAAvODBjQlgwEg==",
      "place_id": "NzYqAQYGQhcKW1xTAhoFVzYxICVdRglGBh5ye2BmSAAvODBjQlgwEg==",
      "name": "明美寢具行",
      "city": "台北市",
      "town": "中山區",
      "type": "地點",
      "cat": "居家修繕",
      "distance": 5.743
    },
    {
      "id": "NzYqAQYGQRgDVlNTMF4BAFEdOi1tDjtWJ15BBH1nFgsQPDt2Y3Q4Eg==",
      "place_id": "NzYqAQYGQRgDVlNTMF4BAFEdOi1tDjtWJ15BBH1nFgsQPDt2Y3Q4Eg==",
      "name": "明美服裝行",
      "city": "台北市",
      "town": "萬華區",
      "type": "地點",
      "cat": "購物商場",
      "distance": 8.251
    },
    {
      "id": "NzYqAQYGQRgDV1pTAC1xCjATMRJ6cy1RNRt/eWFBF00PCQ9VQlU0Eg==",
      "place_id": "NzYqAQYGQRgDV1pTAC1xCjATMRJ6cy1RNRt/eWFBF00PCQ9VQlU0Eg==",
      "name": "明美時裝社",
      "city": "台北市",
      "town": "萬華區",
      "type": "地點",
      "cat": "購物商場",
      "distance": 8.945
    },
    {
      "id": "NzYqAQYBTRoFVlpTFFx9TApAUkVyZx17OlMORgoMLRARLx1CelU4Eg==",
      "place_id": "NzYqAQYBTRoFVlpTFFx9TApAUkVyZx17OlMORgoMLRARLx1CelU4Eg==",
      "name": "明美傢俱行",
      "city": "新北市",
      "town": "三峽區",
      "type": "地點",
      "cat": "居家修繕",
      "distance": 25.959
    }
  ]
}

讓使用者邊輸入,便邊回應出推測的可能清單 -- 運用在逐字逼近搜尋目標物的場景上。

[Places] 地址定位與反定位

功能 :

Geocoding API

Syntax

https://api.map8.zone/v2/place/geocode/json?key=<您的 key>
    &address=<地址>
    &latlng=<緯度>,<經度>

Example : 地址定位 (帶入 address 參數)

curl -X GET "https://api.map8.zone/v2/place/geocode/json?key=<您的 key>&address=台北市內湖區新湖三路189號"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "results": [
    {
      "formatted_address": "台北市內湖區新湖三路189號",
      "geometry": {
        "location": {
          "lat": "25.0650892053",
          "lng": "121.580056243"
        }
      },
      "id": "IykqAAMHRBwCV1lTRl90F1RSSDB1fgl6LR1xCXF4Vhc3CxIJfEI0Eg==",
      "place_id": "IykqAAMHRBwCV1lTRl90F1RSSDB1fgl6LR1xCXF4Vhc3CxIJfEI0Eg==",
      "name": "新湖三路189號",
      "city": "台北市",
      "town": "內湖區",
      "type": "地址",
      "postcode": "114",
      "level": "1",
      "likelihood": -1,
      "authoritative": "true"
    }
  ],
  "status": "OK"
}

Example : 反地址定位 (帶入 latlng 參數)

curl -X GET "https://api.map8.zone/v2/place/geocode/json?key=<您的 key>&latlng=25.065089,121.580056"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "新湖三路189號",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
      }
    ],
    "status" : "OK"
}

Example : 反地址定位 (帶入 latlng 參數,並要求三碼郵遞區號)

curl -X GET "https://api.map8.zone/v2/place/geocode/json?key=<您的 key>&latlng=25.065089,121.580056&postcode"
{
  "html_attribution": [
    "台灣圖霸",
    "研鼎智能",
    "PAPAGO!"
  ],
  "results": [
    {
      "formatted_address": "台北市內湖區新湖三路189號",
      "name": "新湖三路189號",
      "city": "台北市",
      "town": "內湖區",
      "postcode": "114"
    }
  ],
  "status": "OK"
}

Example : 反地址定位 (帶入 latlng 參數,並要求三碼郵遞區號直接內嵌於 formatted_address 欄位)

curl -X GET "https://api.map8.zone/v2/place/geocode/json?key=<您的 key>&latlng=25.065089,121.580056&postcode&formatted_address_embed_postcode"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "114 台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "新湖三路189號",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
      }
    ],
    "status" : "OK"
}

[Maps] 嵌入動態地圖

功能 : 在您的網站中嵌入互動地圖

Maps Embed API

Example (請於瀏覽器直接打開;或透過本文主說明示範之 iframe)

https://maps.map8.zone/?key=<您的 key>&title=研鼎智能&address=台北市內湖區新湖三路189號6樓&description=台灣圖霸,有口皆碑#15.6/25.065089/121.580056

Example : 加上 optional 的地圖視角 (請於瀏覽器直接打開;或透過本文主說明示範之 iframe)

https://maps.map8.zone/?key=<您的 key>&title=研鼎智能&address=台北市內湖區新湖三路189號6樓&description=台灣圖霸,有口皆碑#15.6/25.065089/121.580056/0/50

您也可以使用 iframe 方式來將台灣圖霸的地圖嵌入您的網站 -- 如下示範,只要將上述網址格式直接填入底下 <iframe> 標籤內的 src 欄位即可 :

<iframe src="https://maps.map8.zone/?key=<您的 key>&title=研鼎智能&address=台北市內湖區新湖三路189號6樓&description=台灣圖霸,有口皆碑#15.6/25.065089/121.580056/0/50" width="640" height="480"></iframe>

Maps embed api iframe example 7

讓您在網站或其他任何素材中嵌入互動地圖

[Maps] 地圖靜態圖片

功能 : 在您的網站中嵌入靜態地圖 (圖片)

Maps Static API

Example (請於瀏覽器直接打開)

https://api.map8.zone/maps/static?key=<您的 key>&center=25.03745%2C121.547428&zoom=17&size=1024x768&format=jpg

Maps static api demo

製作顯示地圖的圖檔,讓您在網站或其他任何素材中嵌入靜態地圖

[Routes] 路徑規劃與道路屬性

功能 : 依據起訖點與中途點進行路徑規劃、取得道路屬性

路徑規劃 API (Directions API)

Syntax

https://api.map8.zone/routes/<交通工具>/<起訖點座標組>.json?key=<您的 key>

Example : 此例以 car (汽車) 作為交通工具 (請於瀏覽器直接打開)

curl -X GET "https://api.map8.zone/route/car/121.579839,25.065064;121.576499,25.068178;121.579343,25.068134.json?key=<您的 key>"
{{
  "routes": [
    {
      "geometry": {
        "coordinates": [
          [
            121.579839,
            25.065064
          ],
          [
            121.579546,
            25.064909
          ],
          [
            121.578805,
            25.06596
          ],
          [
            121.578781,
            25.06604
          ],
          [
            121.578521,
            25.066659
          ],
          [
            121.578507,
            25.066692
          ],
          [
            121.578494,
            25.066722
          ],
          [
            121.578468,
            25.066785
          ],
          [
            121.578467,
            25.066786
          ],
          [
            121.578353,
            25.067059
          ],
          [
            121.578264,
            25.067271
          ],
          [
            121.578195,
            25.067422
          ],
          [
            121.57813,
            25.067532
          ],
          [
            121.576516,
            25.067576
          ],
          [
            121.576499,
            25.068178
          ],
          [
            121.576476,
            25.069015
          ],
          [
            121.57716,
            25.068802
          ],
          [
            121.578674,
            25.068336
          ],
          [
            121.579343,
            25.068134
          ]
        ],
        "type": "LineString"
      },
      "legs": [
        {
          "steps": [],
          "distance": 590.3,
          "duration": 96,
          "summary": "行愛路, 民權東路六段11巷"
        },
        {
          "steps": [],
          "distance": 398.1,
          "duration": 65,
          "summary": "瑞湖街, 民權東路六段15巷"
        }
      ],
      "distance": 988.4,
      "duration": 161
    }
  ],
  "waypoints": [
    {
      "distance": 0,
      "name": "新湖三路",
      "location": [
        121.579839,
        25.065064
      ]
    },
    {
      "distance": 0,
      "name": "瑞湖街",
      "location": [
        121.576499,
        25.068178
      ]
    },
    {
      "distance": 0,
      "name": "民權東路六段15巷",
      "location": [
        121.579343,
        25.068134
      ]
    }
  ]
}

路徑規劃功能 : 依據所給定之起點、中途點 (零或多個)、與目的地之地理座標,依 Map8 的圖資與演算法來規劃路徑

道路屬性 API (Roads API)

Syntax

https://api.map8.zone/v2/route/road/<交通工具>?key=<您的 key>
    &latlng=<緯度>,<經度>
    &additional_fields

Example : 此例以 car (汽車) 作為交通工具

curl -X GET "https://api.map8.zone/v2/route/road/car?key=<您的 key>&latlng=25.073448,121.544539&additional_fields=speed,elevated,height,bridge"
{
    "html_attribution": [
        "台灣圖霸",
        "研鼎智能",
        "PAPAGO!"
    ],
    "results": [
        {
            "formatted_address": "台北市中山區 - 中山高汐五高架道路",
            "id": "",
            "place_id": "",
            "name": "中山高汐五高架道路",
            "city": "台北市",
            "town": "中山區",
            "type": "道路",
            "distance": 5.10,
            "speed": "100",
            "elevated": "1",
            "height": "",
            "bridge": ""
        }
    ],
    "status": "OK"
}

對道路進行反定址 (也就是由輸入之地理座標轉為道路),並獲取道路屬性。



https://map8.zone

HTTP Status Code

以上 API,可能回傳的 HTTP status code 如后 :

Error Code 意義
400 Bad Request -- 表示您的 requset 解析有誤。通常是給入的參數多了或少了,或是格式有錯誤,或必要參數卻沒給,等等
401 Unauthorized -- 表示您未給定您的 key,或是您給的 key 並非有效。請跟我們聯絡
503 Service Unavailable -- 表示您的 request 已經超出與我們約定的 QoS (服務品質) 等級。通常過一會兒 (QoS 上限解除) 再重發一次即可成功。如果持續發生,請跟我們聯絡

"status" 欄位

以上 API,可能回傳之 status 欄位的意義為 :

status 意義
OK 無發生任何錯誤;該地點被成功偵測,並且至少回傳一則結果
ZERO_RESULTS 表示搜尋雖然完成,但未得到任何有效結果。此狀況譬如可能發生在您對本 API 發出的 request 所給定的中心座標在一個偏遠地區
OVER_QUERY_LIMIT 表示您已經超出您的配額。請跟我們聯絡
REQUEST_DENIED 表示您的 request 無法進行;一般來說是您未給定您的 key,或是您給的 key 並非有效。請跟我們聯絡
INVALID_REQUEST 表示您的 requset 解析有誤。通常是給入的參數多了或少了,或是格式有錯誤,或必要參數卻沒給,等等
UNKNOWN_ERROR 表示是我們的伺服器端的錯誤;再重試一次可能就會成功。如果持續發生此問題,請跟我們聯絡

地點類型

所支援的景點類型,為字串,如下 :