# API - Sheety 運用 google sheet 試算表 [Sheety 官網 ](https://sheety.co/) Sheety 是一個讓你能夠使用 Google Sheets 作為資料庫的工具和平台。它可以讓你輕鬆地將 Google Sheets 的資料轉換為 RESTful API,這樣你就可以透過 API 存取和管理你的試算表數據。 下面是我個人整理的小教學步驟,僅教如何使用sheety ### step 1 進到官網,連結你的GOOGLE試算表 ![](https://hackmd.io/_uploads/rJCp74Eu3.png) ### step 2 Projects頁面中 透過右邊按鈕新增專案,輸入你試算表的網址,即可新增 ![](https://hackmd.io/_uploads/H1SLzEVdh.png) ![](https://hackmd.io/_uploads/r1VvM4Edh.png) ### step 3 新增的專案點開後,如下圖所示 可以自行啟用功能,並且有ApiUrl 和規定格式說明 ![](https://hackmd.io/_uploads/B1oTfNEu2.png) ### 注意事項 第一行是必須要填寫的,其代表的是物件Key值 ![](https://hackmd.io/_uploads/Bk4mf4N_n.png) ### 個人示範的Code <iframe height="300" style="width: 100%;" scrolling="no" title="GOOGLE試算表 API" src="https://codepen.io/firebro42/embed/NWLQPdO?default-tab=html%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"> See the Pen <a href="https://codepen.io/firebro42/pen/NWLQPdO"> GOOGLE試算表 API</a> by FiReBrO42 (<a href="https://codepen.io/firebro42">@firebro42</a>) on <a href="https://codepen.io">CodePen</a>. </iframe> 使用get Api 來取得試算表的資料,如下所示: 試算表的資料會呈現在data之中 ``` //回傳之資料格式如下: // [object Object] { "data": { "test1": [ { "name": "王大明", "email": "man1245678@yahoo.com.tw", "phone": "0912345678", "score": 60, "id": 2 }, { "name": "劉大明", "email": "ans2378@yahoo.com.tw", "phone": "0912345678", "score": 60, "id": 3 }, { "name": "王守信", "email": "an0772@gmail.com", "phone": "0912345678", "score": "99", "id": 4 }, { "name": "Tami", "email": "tami123@gmail.com", "phone": "0987654321", "score": "10", "id": 5 } ] }, "status": 200, "statusText": "", "headers": { "cache-control": "public, max-age=30", "content-type": "application/json; charset=utf-8" }, "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json, text/plain, */*" }, "method": "get", "url": "https://api.sheety.co/af5836781ebddb89a4eb42a33c0c85ee/testApi/test1" }, "request": {} } ```