Statistics

Keeping track of your API credits ensures you're always prepared for your scraping tasks without interruptions. Rayobyte’s API provides two straightforward endpoints to check your current balance and review daily usage stats. Let’s dive into how to use them!


1. Get Your Credit Balance

This endpoint provides an instant overview of how many credits you have remaining in your account.

API Call Examples

curl 'https://api.scraping.rayobyte.com/balance?token=<API-KEY>'

Output Example

{
  "status": "SUCCESS",
  "date": "Fri, 01 May 2020 00:00:00 GMT",
  "token": "abcdef-0123-4567-89ab-cdef01234567",
  "credits": 120
}

What It Means

  • status: Indicates if the request succeeded.

  • date: Timestamp of the API response.

  • token: Your account’s unique identifier.

  • credits: Your remaining API credits.


2. Get Daily Usage Statistics

Want to see how you're doing? The stats endpoint provides a breakdown of your credit usage over a specified time period. You can customize the report by setting the type parameter to one of the following values:

  • daily: Retrieves usage data for each day.

  • weekly: Retrieves usage data for each week.

  • monthly: Retrieves usage data for each month.

API Call Example:

curl 'https://api.scrapingrobot.com/stats?token=<API-KEY>&type=daily'

Output Example

{
  "status": "SUCCESS",                      
  "date": "Fri, 01 May 2024 00:00:00 GMT",  
  "token": "abcdef-0123-4567-89ab-cdef01234567",                 
  "result": {                               
    "Sat May 09 2024": 0,
    "Fri May 08 2024": 3,
    "Thu May 07 2024": 0,
    "Wed May 06 2024": 144,
    "Tue May 05 2024": 12,
    "Mon May 04 2024": 43,
    "Sun May 03 2024": 1
  }
}

Support

Need help or have questions about these calls? Reach out via our support portal. We're here to help!

Last updated