https://github.com/beyondcode/fathom-analytics-api
The unofficial Fathom Analytics API
https://github.com/beyondcode/fathom-analytics-api
Last synced: about 1 month ago
JSON representation
The unofficial Fathom Analytics API
- Host: GitHub
- URL: https://github.com/beyondcode/fathom-analytics-api
- Owner: beyondcode
- License: mit
- Archived: true
- Created: 2020-12-18T14:22:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-12T14:33:37.000Z (over 4 years ago)
- Last Synced: 2026-01-11T19:35:04.388Z (about 1 month ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 39
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# The unofficial Fathom Analytics API
This is an unofficial PHP SDK to get statistics out of Fathom Analytics, as long as it does not offer an official API.
## Installation
You can install the package via composer:
```bash
composer require beyondcode/fathom-api
```
## Usage
```php
$analytics = new BeyondCode\FathomAnalytics($email, $password);
$sites = $analytics->getSites();
$analytics->getCurrentVisitors($siteId);
// Returns the visitor data for today
$analytics->getData($siteId);
// Returns the visitor data for the whole week until today
$analytics->getData($siteId, Carbon::now()->startOfWeek());
// Returns the visitor data for two days ago until yesterday.
$analytics->getData($siteId, Carbon::now()->subDays(2), Carbon::now()->subDays(1));
```
### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker.
## Credits
- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.