Plausible API (Work In Progress)
This is a simple wrapper to read the Plausible API with Ruby. It's based on the WIP API guide
Usage
Add this gem to your Gemfile:
gem 'plausible_api'
Then you need to initialize a Client and then call one of the available stats:
c = PlausibleApi::Client.new(site_id: 'dailytics.com', token: '123123')
c.aggregate(period: '1w', metrics: 'visitors,pageviews,bounce_rate,visit_duration')
Development
$ gem build plausible_api.gemspec
$ gem install ./plausible_api-X.X.X.gem
$ irb
irb(main) > require 'plausible_api'
irb(main) > c = PlausibleApi::Client.new(site_id: 'dailytics.com', token: '123123')
irb(main) > c.aggregate(period: '1w', metrics: 'visitors,pageviews,bounce_rate,visit_duration')
Todo
- Add support for other endpoints
- Tests