{"id":13562872,"url":"https://github.com/mabasic/wakatime-php-api","last_synced_at":"2026-01-10T20:56:59.293Z","repository":{"id":24888680,"uuid":"28304815","full_name":"mabasic/wakatime-php-api","owner":"mabasic","description":"WakaTime API for PHP","archived":false,"fork":false,"pushed_at":"2024-05-20T07:40:32.000Z","size":178,"stargazers_count":51,"open_issues_count":1,"forks_count":23,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-16T22:09:04.677Z","etag":null,"topics":["php","wakatime"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/mabasic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"patreon":"laravelista"}},"created_at":"2014-12-21T16:08:42.000Z","updated_at":"2024-07-19T13:09:22.000Z","dependencies_parsed_at":"2024-06-18T22:57:42.417Z","dependency_job_id":null,"html_url":"https://github.com/mabasic/wakatime-php-api","commit_stats":{"total_commits":34,"total_committers":7,"mean_commits":4.857142857142857,"dds":"0.38235294117647056","last_synced_commit":"335d158553782ed0b19bc7b7224cc323cdd6d210"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabasic%2Fwakatime-php-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabasic%2Fwakatime-php-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabasic%2Fwakatime-php-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabasic%2Fwakatime-php-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mabasic","download_url":"https://codeload.github.com/mabasic/wakatime-php-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235399024,"owners_count":18983817,"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":["php","wakatime"],"created_at":"2024-08-01T13:01:13.050Z","updated_at":"2025-10-05T13:31:02.127Z","avatar_url":"https://github.com/mabasic.png","language":"PHP","funding_links":["https://patreon.com/laravelista","https://www.patreon.com/laravelista"],"categories":["PHP"],"sub_categories":[],"readme":"# WakaTime PHP API\n\nWakaTime API for PHP\n\n[![Become a Patron](https://img.shields.io/badge/Become%20a-Patron-f96854.svg?style=for-the-badge)](https://www.patreon.com/laravelista)\n\n## Overview\n\nThis is a PHP package for WakaTime API. It supports resource endpoints from [WakaTime API](https://wakatime.com/developers) with additional helper methods for hours logged.\n\n~~If you are using [Laravel](http://laravel.com/) check out [WakaTime Reports and Laravel](http://laravelista.com/posts/wakatime-reports-and-laravel/)~~.\n\nIf you find that some resource endpoints are missing feel free to send me a PR. *(Be sure to include tests for your code)*\n\n## Installation\n\nType this from command line:\n\n```php\ncomposer require mabasic/wakatime-php-api\n```\n\n## Usage\n\n```php\n\u003c?php\n\nuse GuzzleHttp\\Client as Guzzle;\nuse Mabasic\\WakaTime\\WakaTime;\n\n$wakatime = new WakaTime(new Guzzle, $your_api_key_for_wakatime);\n```\n\nYou can get your Api Key from your [settings page](https://wakatime.com/settings).\n\n## Resource Endpoints\n\n#### Users\n\n```php\n$wakatime-\u003ecurrentUser()\n\n// or\n\n$wakatime-\u003eusers('username');\n```\n\nSee: https://wakatime.com/developers/#users for details.\n\n#### Summaries\n\n```php\n$wakatime-\u003esummaries($startDate, $endDate, $project = null)\n```\n\nSee: https://wakatime.com/developers/#summaries for details.\n\n#### Stats\n\n```php\n$wakatime-\u003estats($range, $project = null)\n```\n\nSee: https://wakatime.com/developers/#stats for details.\n\n#### Heartbeats\n\n```php\n$date = '01/22/2016';\n\n$wakatime-\u003eheartbeats($date);\n```\n\nSee: https://wakatime.com/developers#heartbeats for details.\n\n## Helper methods aka Reports aka Shortcuts\n\n#### getHoursLoggedFor\n\n```php\n$wakatime-\u003egetHoursLoggedFor($startDate, $endDate, $project = null)\n```\n\nCalculates hours logged for a specific period.\n_You can optionally specify a project._\n\n\u003e `$startDate` must be lower than `$endDate`\n\n**Example:**\n\n```php\n$startDate = '11/21/2014';\n$endDate = '12/21/2014';\n\n$hours = $wakaTime-\u003egetHoursLoggedFor($startDate, $endDate);\n```\n\n#### getHoursLoggedForLast\n\n```php\npublic function getHoursLoggedForLast($period, $project = null)\n```\n\nCalculates hours logged in last xy days, months.\n_You can optionally specify a project._\n\n**Example:**\n\n```php\n$hours = $wakaTime-\u003egetHoursLoggedForLast('7 days');\n```\n\n#### getHoursLoggedForToday\n\n```php\npublic function getHoursLoggedForToday($project = null)\n```\n\nReturns hours logged today.\n_You can optionally specify a project._\n\n#### getHoursLoggedForYesterday\n\n```php\npublic function getHoursLoggedForYesterday($project = null)\n```\n\nReturns hours logged yesterday.\n_You can optionally specify a project._\n\n#### getHoursLoggedForLast7Days\n\n```php\npublic function getHoursLoggedForLast7Days($project = null)\n```\n\nBasic users can only see data for maximum 7 days. Become a Premium user to preserve all data history.\n_You can still use any method as long as it is under 7 days._\n\n#### getHoursLoggedForLast30Days\n\n```php\npublic function getHoursLoggedForLast30Days($project = null)\n```\n\nCalculates hours logged for last 30 days in history.\n_You can optionally specify a project._\n\n#### getHoursLoggedForThisMonth\n\n```php\npublic function getHoursLoggedForThisMonth($project = null)\n```\n\nCalculates hours logged for this month.\n_You can optionally specify a project._\n\n#### getHoursLoggedForLastMonth\n\n```php\npublic function getHoursLoggedForLastMonth($project = null)\n```\n\nCalculates hours logged for last month.\n_You can optionally specify a project._\n\n---\n\n## For developers only\n\nCopy `.env.example` file to `.env` and set your api key and project name before running tests with:\n\n```\nvendor/bin/phpunit\n```\n\n## Laravelista Sponsors \u0026 Backers\n\nI would like to extend my thanks to the following sponsors \u0026 backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Laravelista [Backers page](https://laravelista.hr/backers).\n\n## Contributing\n\nThank you for considering contributing to WakaTime PHP API! The contribution guide can be found on the [Laravelista website](https://laravelista.hr/contributing).\n\n## Code of Conduct\n\nIn order to ensure that the Laravelista community is welcoming to all, please review and abide by the [Code of Conduct](https://laravelista.hr/code-of-conduct).\n\n## License\n\nWakaTime PHP API is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabasic%2Fwakatime-php-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmabasic%2Fwakatime-php-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabasic%2Fwakatime-php-api/lists"}