Account Information | Ruby

Learn how to monitor your ScraperAPI usage programmatically using the /account endpoint in Ruby. Get real-time concurrency and updated request stats in JSON format.

If you would like to monitor your account usage and limits programmatically (how many concurrent requests you’re using, how many requests you’ve made, etc.) you may use the /account endpoint, which returns JSON.

Note: the requestCount and failedRequestCount numbers only refresh once every 15 seconds, while the concurrentRequests number is available in real-time.

  • API Request

require 'net/http'
require 'json'
params = {
:api_key => "APIKEY"
}
uri = URI('https://api.scraperapi.com/account')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)
  • SDK Method

# remember to install the library: gem install scraperapi
require "scraper_api"
client = ScraperAPI::Client.new("APIKEY")
puts client.account()

Last updated

Was this helpful?