{"id":20988582,"url":"https://github.com/doorbash/sheets-api","last_synced_at":"2025-06-11T03:36:16.444Z","repository":{"id":80553593,"uuid":"266410752","full_name":"doorbash/sheets-api","owner":"doorbash","description":"Simple Google Sheets key value based API","archived":false,"fork":false,"pushed_at":"2020-06-13T09:28:08.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T11:43:57.518Z","etag":null,"topics":["google-sheets","google-sheets-api","sheets","sheets-api"],"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/doorbash.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":"2020-05-23T20:04:57.000Z","updated_at":"2024-05-08T21:14:26.000Z","dependencies_parsed_at":"2023-02-28T20:00:23.221Z","dependency_job_id":null,"html_url":"https://github.com/doorbash/sheets-api","commit_stats":null,"previous_names":["doorbash/remote-config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorbash%2Fsheets-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorbash%2Fsheets-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorbash%2Fsheets-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorbash%2Fsheets-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doorbash","download_url":"https://codeload.github.com/doorbash/sheets-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorbash%2Fsheets-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259192172,"owners_count":22819430,"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":["google-sheets","google-sheets-api","sheets","sheets-api"],"created_at":"2024-11-19T06:22:04.253Z","updated_at":"2025-06-11T03:36:16.420Z","avatar_url":"https://github.com/doorbash.png","language":"Go","readme":"# remote-config\nA simple API that reads key value config from Google Sheets.\n\n## Install:\n\n1. Create a new Google project. https://console.developers.google.com\n2. Enable Google Sheets API for you project.\n3. Add credentials to your project.\n    You need to add an authorized redirect URI like `http://example.com:4040/callback`.\n4. Download credentials file and save it as `credentials.json`.\n5. `go get github.com/doorbash/remote-config`\n6. Edit `main.go` and set `SPREADSHEET` const as your spreadsheet id.\n7. `go build`\n8. Put `credentials.json` next to `main.go`.\n9. `./remote-config`\n10. Visit `http://example.com:4040/login` and login with your Google account.\n\n## Usage:\n\nPut your data in two columns: (A=key, B=value)\n\n\u003cimg src=\"https://github.com/doorbash/remote-config/blob/master/screenshot.png?raw=true\" /\u003e\n\n### Get all configs as JSON\n\n```\nhttp://example.com:4040/Sheet1\n\n{\n   \"key1\":\"value1\",\n   \"key10\":\"t\",\n   \"key11\":false,\n   \"key2\":3.14,\n   \"key3\":4,\n   \"key4\":true,\n   \"key5\":0,\n   \"key6\":1,\n   \"key7\":\"\",\n   \"key8\":null,\n   \"key9\":\"\\\"true\\\"\"\n}\n```\n\n### Get a specific key\n\n```\nhttp://example.com:4040/Sheet1?key=key4\n\ntrue\n```\n\n### Get metrics for Prometheus\n\n```\nhttp://example.com:4040/Sheet1/metrics\n\nremote_config{key=\"key2\"} 3.14\nremote_config{key=\"key3\"} 4\nremote_config{key=\"key5\"} 0\nremote_config{key=\"key11\"} 0\nremote_config{key=\"key4\"} 1\nremote_config{key=\"key6\"} 1\n```\n\n## Example:\n\n### Android:\n\n```java\nprivate class GetConfigAsyncTask extends AsyncTask\u003cString, Integer, String\u003e {\n    protected String doInBackground(String... urls) {\n        try {\n            Log.d(TAG, \"sending get request...\");\n            URL url = new URL(urls[0]);\n            HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n            connection.setRequestMethod(\"GET\");\n            connection.setConnectTimeout(10000);\n            connection.setReadTimeout(10000);\n            connection.connect();\n            int status = connection.getResponseCode();\n            Log.d(TAG, \"status code is \" + status);\n            if (status == HttpURLConnection.HTTP_OK) {\n                InputStream is = connection.getInputStream();\n                return new BufferedReader(new InputStreamReader(is)).readLine();\n            } else {\n                InputStream is = connection.getErrorStream();\n                throw new Exception(new BufferedReader(new InputStreamReader(is)).readLine());\n            }\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        return null;\n    }\n\n    protected void onProgressUpdate(Integer... progress) {\n    }\n\n    protected void onPostExecute(String result) {\n        if (result != null) {\n            try {\n                Log.d(TAG, \"result is \" + result);\n                SharedPreferences.Editor editor = getApplicationContext()\n                        .getSharedPreferences(\"MyPref\", 0).edit();\n                JSONObject jo = new JSONObject(result);\n                Iterator\u003cString\u003e it = jo.keys();\n                while (it.hasNext()) {\n                    String key = it.next();\n                    Object value = jo.get(key);\n                    if (value instanceof Boolean) {\n                        editor.putBoolean(key, (boolean) value);\n                    } else if (value instanceof Integer) {\n                        editor.putInt(key, (int) value);\n                    } else if (value instanceof Long) {\n                        editor.putLong(key, (long) value);\n                    } else if (value instanceof Float) {\n                        editor.putFloat(key, (float) value);\n                    } else if (value instanceof Double) {\n                        editor.putFloat(key, ((Double) value).floatValue());\n                    } else if (value instanceof String) {\n                        editor.putString(key, (String) value);\n                    } else if(value.equals(JSONObject.NULL)){\n                        editor.remove(key);\n                    }\n                }\n                editor.apply();\n            } catch (Exception e) {\n                e.printStackTrace();\n            }\n        }\n    }\n}\n```\n\n```java\nnew GetConfigAsyncTask().execute(\"http://example.com:4040/Sheet1\");\n```\n\n## License\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoorbash%2Fsheets-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoorbash%2Fsheets-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoorbash%2Fsheets-api/lists"}