{"id":13298403,"url":"https://github.com/kerolloz/kounter","last_synced_at":"2025-04-02T04:18:43.995Z","repository":{"id":98649647,"uuid":"557190356","full_name":"kerolloz/kounter","owner":"kerolloz","description":"Kounter is a tiny webservice that works as a counter 🧮","archived":false,"fork":false,"pushed_at":"2024-11-14T16:05:19.000Z","size":290,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T09:47:59.633Z","etag":null,"topics":["counter-api","deta","fastify","github","github-counter","github-profile","github-profile-counter","nodejs","profile-views","views-count","views-counter","visitor-counter"],"latest_commit_sha":null,"homepage":"https://kounter.kerolloz.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kerolloz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-10-25T08:34:45.000Z","updated_at":"2025-01-08T07:27:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"6482b0c4-daed-4bfa-852e-a8bb029fd6d9","html_url":"https://github.com/kerolloz/kounter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolloz%2Fkounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolloz%2Fkounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolloz%2Fkounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerolloz%2Fkounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kerolloz","download_url":"https://codeload.github.com/kerolloz/kounter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246752570,"owners_count":20827987,"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":["counter-api","deta","fastify","github","github-counter","github-profile","github-profile-counter","nodejs","profile-views","views-count","views-counter","visitor-counter"],"created_at":"2024-07-29T17:29:41.802Z","updated_at":"2025-04-02T04:18:43.978Z","avatar_url":"https://github.com/kerolloz.png","language":"TypeScript","readme":"\u003ch1 align=\"left\"\u003eKounter 🧮\n  \u003ca target=\"_blank\" href=\"https://fastify.io\"\u003e\n    \u003cimg alt=\"fastify\" align=\"right\" src=\"https://img.shields.io/static/v1?logo=fastify\u0026label=\u0026message=Fastify\u0026style=for-the-badge\u0026color=grey\"/\u003e\n  \u003c/a\u003e\n  \u003ca target=\"_blank\" href=\"https://railway.app/\"\u003e\n    \u003cimg alt=\"Railway\" align=\"right\" src=\"https://img.shields.io/static/v1?label=\u0026message=Railway\u0026style=for-the-badge\u0026color=grey\u0026logo=railway\" /\u003e\n  \u003c/a\u003e\n\u003c/h1\u003e\n\nKounter is a simple counter service that can be used in various ways.  \nUse cases include a profile views counter, repository visits counter, or anything you want to count.\n\n## Development\n\nFor development, you must set the `DETA_PROJECT_KEY` environment variable to your Deta project key.  \nThis project uses [Bun](bun.sh) for development.\n\n```bash\nbun dev\n```\n\n## Docs\n\nKounter is built using _Fastify_.  \nIt has a straightforward API with the following few endpoints.\n\n\u003e [!NOTE]\n\u003e You can also check the Swagger [API documentation](https://kounter.kerolloz.dev/swagger) for more details.\n\n### Endpoints\n\n\u003e Base URL: \u003chttps://kounter.kerolloz.dev\u003e\n\n#### GET `/`\n\nRedirects to this repository.\n\n---\n\n#### GET `/badge/:key`\n\n- Increments the counter by 1 if `:key` exits; creates a new counter with count initialized to 1 otherwise.\n- Returns a [shields.io](https://shields.io) badge (SVG image) for your counter.\n\n##### Parameters\n\n- `key` - The key of the counter to increment.\n\n##### Query Parameters\n\n- `silent` - Set to `true` to **disable incrementing** the counter. Defaults to `false`.\n- `style` - Set the style of the badge. Can be one of `flat`, `flat-square`, `for-the-badge`, or `plastic`. Defaults to `flat`.\n- `label` - Set the left-hand-side text. Defaults to `:key`.\n- `color` - Set the background of the right part (hex, rgb, rgba, hsl, hsla and css named colors supported). Defaults to `brightgreen`.\n- `labelColor` -  Set the background of the left part (hex, rgb, rgba, hsl, hsla and css named colors supported). Defaults to `grey`.\n- `cntPrefix` - Set prefix to display before the counter value. Defaults to `\"\"` empty string.\n- `cntSuffix` - Set suffix to display after the counter value. Defaults to `\"\"` empty string.\n\n##### Examples\n\n\u003e `![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter)`  \n\u003e ![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter)\n\n\u003e `![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter?style=flat-square\u0026color=blue\u0026silent=true)`  \n\u003e ![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter?style=flat-square\u0026color=blue\u0026silent=true)  \n\n\u003e `![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter?label=kerolloz/kounter\u0026labelColor=white\u0026cntPrefix=visits%20\u0026silent=true)`  \n\u003e ![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter?label=kerolloz/kounter\u0026labelColor=white\u0026cntPrefix=visits%20\u0026silent=true)\n\n\u003e `![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter?label=\u0026color=333\u0026style=for-the-badge\u0026cntSuffix=%20Views\u0026silent=true)`  \n\u003e ![badge](https://kounter.kerolloz.dev/badge/kerolloz.kounter?label=\u0026color=333\u0026style=for-the-badge\u0026cntSuffix=%20Views\u0026silent=true)\n\n---\n\n#### GET `/count/:key`\n\n\u003ca target=\"_blank\" href=\"https://reqbin.com/c-hzpbeh8a\"\u003e\n  \u003cimg align=\"right\" alt=\"Try it\" src=\"https://img.shields.io/badge/-Try%20it-white?style=for-the-badge\" /\u003e\n\u003c/a\u003e\n\n- Returns the current count for `:key` **without incrementing** it.\n- Returns `{ key: \":key\", count: 0 }` if the counter `:key` does not exist.\n\n##### Parameters\n\n- `key` - The key of the counter to get count value for.\n\n##### Example\n\n```bash\n$ curl -X GET https://kounter.kerolloz.dev/count/xyz\n\n{\n  \"count\": 1,\n  \"key\": \"xyz\"\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerolloz%2Fkounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerolloz%2Fkounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerolloz%2Fkounter/lists"}