{"id":16647953,"url":"https://github.com/xavierchanth/dart-gsheets-api","last_synced_at":"2026-04-25T19:31:51.376Z","repository":{"id":104741469,"uuid":"381129990","full_name":"XavierChanth/dart-gsheets-api","owner":"XavierChanth","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-01T13:58:46.000Z","size":39,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T09:01:52.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XavierChanth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-06-28T18:42:27.000Z","updated_at":"2021-11-20T00:41:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"55814671-ac56-4d22-aa64-b2bdee4f2c77","html_url":"https://github.com/XavierChanth/dart-gsheets-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XavierChanth%2Fdart-gsheets-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XavierChanth%2Fdart-gsheets-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XavierChanth%2Fdart-gsheets-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XavierChanth%2Fdart-gsheets-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XavierChanth","download_url":"https://codeload.github.com/XavierChanth/dart-gsheets-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243204477,"owners_count":20253414,"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":[],"created_at":"2024-10-12T08:46:14.056Z","updated_at":"2026-04-25T19:31:51.370Z","avatar_url":"https://github.com/XavierChanth.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dart GSheets Api\n\nDynamically generates api routes for google sheets.\n\n## Creating a Route\n\nThe routes API automatically generates routes to get the rows and columns of a spreadsheet. See how to create one below.\n\n```dart\n//GSheetRoute\nGSheetRoute(String spreadsheetId, Map\u003cint, int\u003e worksheets)\n```\n\n\u003e `String spreadsheetId`: ID of the spreadsheet (can be found in the URL)  \n\u003e `Map\u003cint, int\u003e worksheets`: ID of the worksheet mapped to first row of data\n\n## Mounting your Route\n\nTo mount your route, simply place it in the body of routes.dart:\n\n```dart\n//routes.dart\nrouter.mount('/example/', GSheetRoute(...).router);\n```\n\nNote: The route must start and end with a slash, as `/example/` does.\n\n## Exposed Endpoints\n\nIn this case `/example` stands for the route you chose when you mounted it.\n\n`GET /example/refresh`\n\nThe server automatically caches the spreadsheet data for one hour.  \nThis endpoint manually updates the cache.\n\n`GET /example/\u003cworksheetId\u003e/column/\u003ccolumnId\u003e`\n\nReturns a JSON object in the format of `{'rowIndex': 'cellValue'}`  \nNote: Both the key and value are a string.\n\n`GET /example/\u003cworksheetId\u003e/row/\u003crowId\u003e`\n\nReturns a JSON list, containing each cell value in order.  \nNote: all values in the list are strings.\n\n## Sheet Format\n\nThe first column of the sheet must contain an index in ascending order to map the rows to.\nThe first row containing data must start at 1 to map rows correctly.\n\n![image](https://user-images.githubusercontent.com/33691921/123737165-7b35eb00-d870-11eb-9b5a-80933ba5e7ba.png)\n\n## Example\n```dart\nrouter.mount(\n  '/example/',\n  GSheetRoute('mySpreadsheetId', {0:2}).router\n);\n```\n`'/example/'`  \n\u003e The route for this spreadsheet.\n\n`'mySpreadsheetId'`  \n\u003e The id of the spreadsheet can be found in the url\n\n`{0:2}`  \n\u003e 0 is the worksheet id  \nThe worksheet id is found in the url as `?gid=\u003cworksheetId\u003e`\n\n\u003e 2 is the first row of data  \nAccess data rows using positive numbers.  \ni.e /row/1 becomes the first row of data when calling the api.  \nAccess non-data rows using positive numbers.  \ni.e /row/0 is the row immediately before the first row of data  \n(you can use negative numbers as well.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavierchanth%2Fdart-gsheets-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxavierchanth%2Fdart-gsheets-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavierchanth%2Fdart-gsheets-api/lists"}