Ahrefs API client library, written in Ruby.
Add this line to your application's Gemfile:
gem 'ahrefs-api-ruby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ahrefs-api-ruby
You should get access token for API Profile - Ahrefs API.
require 'ahrefs_api'
AhrefsApi.configure do |config|
config.token = 'Your access token' # required
config.timeout = 30 # optional - request timeout(s)
end
client = AhrefsApi::Client.new
client.target = 'example.com'
client.mode_subdomains
.output_json
.from_backlinks_new_lost_counters
.where('date', '>', Date.today - 1.months)
.order(new: :desc)
response = client.send_get
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
Bug reports and pull requests are welcome on GitHub at https://github.com/sainuio/ahrefs-api-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Ahrefs::Api::Ruby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.