An unofficial gem to access the SpyFu API. It requires a SpyFu account.
Here is a simple example on how to make a request to the API. A full listing of available params on available on official site.
spyfu = SpyFu.client('1234-12345-12345-1234', 'YOURSECRETKEY')
result = spyfu.kss_api.get_term_page_keywords(:q => 'spyfu api', :r => 100)
result.body # API returns a JSON object with results
Get started by gem install spyfu
or in your Gemfile:
gem 'spyfu'
You can access the Core API.
spyfu.ad_history_api.domain_ad_history(...)
spyfu.ad_history_api.domain_ad_history_with_metrics(...)
spyfu.ad_history_api.term_ad_history(...)
You can access the Core API.
spyfu.core_api.get_domain_metrics_us(...)
spyfu.core_api.get_domain_metrics_uk(...)
spyfu.core_api.get_domain_budget_history_us(...)
spyfu.core_api.get_domain_budget_history_uk(...)
spyfu.core_api.get_domain_competitors_us(...)
spyfu.core_api.get_domain_competitors_uk(...)
You can access the Keyword SmartSearch API.
spyfu.kss_api.related_keywords(:q => 'spyfu api', :r => 100)
spyfu.kss_api.domain_related_keywords(:q => 'spyfu api', :r => 100)
You can access the Leads API.
spyfu.leads_api.get_contact_card(...)
spyfu.leads_api.get_grid(...)
spyfu.leads_api.get_top_list(...)
You can access the URL API.
spyfu.url_api.organic_kws(:q => "http://resources.spyfu.com/blog/", :r => 100)
spyfu.url_api.paid_kws(:q => "http://resources.spyfu.com/blog/", :r => 100)
spyfu.url_api.paid_estimates(...)
spyfu.url_api.organic_estimates(...)
You can access the Weekly Tracking API.
spyfu.weekly_tracking_api.add_terms(...)
spyfu.weekly_tracking_api.get_groups(...)
spyfu.weekly_tracking_api.get_terms(...)
spyfu.weekly_tracking_api.get_term_data(...)
spyfu.weekly_tracking_api.delete_terms(...)
- Parameter values are not properly encoded. Doing so break the request signature.
- Multiple parameters with the same name and different values are not handled. I don't see where this is used but comments in SpyFu's sample code mentions it.
- Allow paramers to be more ruby like (:maxRows becomes :max_rows)
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright (c) 2014 Robert Graff. See LICENSE.txt for further details.