{"id":21401964,"url":"https://github.com/bigjk/teburu","last_synced_at":"2026-01-03T22:04:54.882Z","repository":{"id":181493568,"uuid":"666856080","full_name":"BigJk/teburu","owner":"BigJk","description":"Self-Hosted Google Sheet as API.","archived":false,"fork":false,"pushed_at":"2023-07-18T07:20:07.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T03:17:57.018Z","etag":null,"topics":["api","backend","golang","spreadsheet"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BigJk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T20:07:42.000Z","updated_at":"2023-07-18T07:21:41.000Z","dependencies_parsed_at":"2024-11-22T15:35:54.868Z","dependency_job_id":"90c0a250-d5fa-44b6-a35a-27cc1c035b32","html_url":"https://github.com/BigJk/teburu","commit_stats":null,"previous_names":["bigjk/teburu"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fteburu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fteburu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fteburu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fteburu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BigJk","download_url":"https://codeload.github.com/BigJk/teburu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243894350,"owners_count":20365016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","golang","spreadsheet"],"created_at":"2024-11-22T15:33:54.628Z","updated_at":"2026-01-03T22:04:54.814Z","avatar_url":"https://github.com/BigJk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗂️ てぶる ー teburu\n\nSelf-hosted Google Sheets as an API. It's like a self-hosted version of [Sheety](https://sheety.co/) and [Sheet2API](https://sheet2api.com/).\n\n## 💡 Idea\n\nThe basic idea is that if you had a google sheet table like that:\n\n| name | description | price |\n| ---- | ----------- | ----- |\n| Apple | A fruit | 1.99 |\n| Banana | A fruit | 2.99 |\n\nYou could access it as a JSON API like that:\n\n```json\n[\n  {\n    \"name\": \"Apple\",\n    \"description\": \"A fruit\",\n    \"price\": 1.99\n  },\n  {\n    \"name\": \"Banana\",\n    \"description\": \"A fruit\",\n    \"price\": 2.99\n  }\n]\n```\n\nThat way you can use Google Sheets as a CMS for your website or as a database for your app. This is especially useful if you have non-technical people who need to edit the data, or you need a quick prototyping solution without having to set up a management ui.\n\n## ⚠️ Pre-requisites\n\n### 1. Set up a Google Cloud project\n\nYou will need to set up a Google Cloud project to use teburu. This is because teburu uses the Google Sheets API to read and write to your spreadsheet. The free quota (300 requests per minute) should be enough for most smaller use cases if you factor in caching. You can follow the steps below to set up a Google Cloud project:\n\n- Go to the Google Cloud Console ([console.cloud.google.com](https://console.cloud.google.com)) and create a new project.\n- Enable the Google Sheets API for your project by searching for \"Google Sheets API\" in the API Library and enabling it.\n- Create API credentials by navigating to the \"Credentials\" section and clicking on \"Create credentials\" -\u003e \"Service account key\". Select the appropriate service account and choose JSON as the key type. Download the JSON file that contains your credentials.\n- Also save the email address (``*.gserviceaccount.com``) of the service account that you created. You will need this later.\n\n### 2. Set up your spreadsheet\n\nYou will need to set up your spreadsheet to use teburu.\n\n- Create a new spreadsheet in Google Sheets or open a existing one.\n- Share the spreadsheet with the service account email address that you saved earlier. Give it edit access.\n- In the first row of the spreadsheet, add your column names. These will be the keys in your JSON response.\n- Now you can start adding data to your spreadsheet. You can add as many rows as you want. You can also add multiple sheets to your spreadsheet. Each sheet will be a separate endpoint in teburu.\n\n## 🌐 Endpoints\n\n### (GET) ``/api/sheet/:id/:sheet``\n\nReturns the contents of the sheet as a JSON array.\n\n#### Parameters\n\n- ``id``: The ID of your spreadsheet. This is the long string of characters in the URL of your spreadsheet.\n- ``sheet``: The name of the sheet in your spreadsheet.\n\n### (GET) ``/api/sheet/:id/:sheet/:eid``\n\nReturns a single row from the sheet as a JSON object.\n\n#### Parameters\n\n- ``id``: The ID of your spreadsheet. This is the long string of characters in the URL of your spreadsheet.\n- ``sheet``: The name of the sheet in your spreadsheet.\n- ``eid``: The ID of the row to return. This is the number in the first column of your spreadsheet.\n\n### Query Parameter\n\nAdditional query parameters can be added to the URL to modify the JSON response.\n\n- ``case``: The case of the keys in the JSON response. Can be ``camel``, ``snake``, ``kebab``, ``plain`` and ``screaming_snake``. Defaults to ``camel``.\n- ``columns``: The columns to return in the JSON response in comma seperated form like ``name,description``. Defaults to all columns.\n- ``format``: The format of the JSON response. Can be ``simple``, ``dynamic`` and ``complex``. Defaults to ``simple``.\n  - ``simple``: Returns row fields as simple ``\"key\": \"value\"`` pairs.\n  - ``complex``: Returns the row fields as ``\"key\": { \"value\": \"...\", \"hyperlink\": \"http://...\" }`` where hyperlink contains the hyperlink if the cell contains one.\n  - ``dynamic``: Returns the row fields as ``complex`` if the cell contains a hyperlink, otherwise as ``simple``.\n\n## 💻 Install\n\n### Via Go\n\nInstall teburu via ``go install`` and then run it with ``teburu``.\n\n```bash\ngo install github.com/BigJk/teburu/cmd/teburu@latest\n```\n\n### Docker\n\nYou can also run teburu with docker. You can use the following command to run teburu with docker. Use the environment variables or the config.yaml file to configure teburu:\n\n```bash \ndocker run -p 8753:8753 \\\\\n-v /location/sheet_creds.json:/creds.json \\\\\n-e TEBURU_CACHE=1 \\\\\n-e TEBURU_CACHE_TTL=5m0s \\\\\nghcr.io/bigjk/teburu:latest \n```\n\n\u003cdetails\u003e\n\u003csummary\u003edocker-compose.yml example\u003c/summary\u003e\n\n```yaml\nversion: \"3.8\"\n\nservices:\n  teburu:\n    image: ghcr.io/bigjk/teburu:latest\n    ports:\n      - 8753:8753\n    volumes:\n      - /location/sheet_creds.json:/creds.json\n    environment:\n      - TEBURU_CACHE=1\n      - TEBURU_CACHE_TTL=5m0s\n```\n\n\u003c/details\u003e\n\n## config.yaml\n\nAfter starting teburu for the first time, a config.yaml file will be created in the current directory. You can use this file to configure teburu.\n\n```yaml\nbind: :8753 # The address to bind the webserver to\ncache: false # Whether to cache the requests\ncache_ttl: 5m0s # The time to cache the requests for\ncors: true # Whether to enable CORS\ncredentials_file: ./creds.json # The path to the credentials file from Google Cloud\nrate_limit: 5 # The number of requests per minute to allow, 0 for no limit\nrequest_timeout: 10s # The timeout for requests to the webserver, 0 for no timeout\ngzip: true # Whether to enable gzip compression\n```\n\n### Environment Variables\n\nAlternatively you can also use environment variables to configure teburu. The environment variables are prefixed with ``TEBURU_`` and are all uppercase. For example ``TEBURU_BIND`` or ``TEBURU_CACHE``.\n\n## TODO\n\n- [ ] Updating rows\n- [ ] Deleting rows\n- [ ] Adding rows\n- [ ] Filtering rows\n- [x] Docker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigjk%2Fteburu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigjk%2Fteburu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigjk%2Fteburu/lists"}