Usage Data

Retrieve simple usage metrics associated with your API credential.

GET /api/usage

Note: This endpoint requires only X-ROLLI-TOKEN. X-ROLLI-USER-ID is not required for usage data requests.

Parameters

month String (optional)
Format: YYYY-MM
If provided, returns usage only for that month.
If null or omitted, returns usage for the last 12 months.

Request Example

curl -X GET "https://rolli.ai/api/usage?month=2024-06" \
  -H "X-ROLLI-TOKEN: your_token" \
  -H "X-ROLLI-USER-ID: your_user_id" \
  -H "Content-Type: application/json"
    
fetch("https://rolli.ai/api/usage?month=2024-06", {
  method: "GET",
  headers: {
    "X-ROLLI-TOKEN": "your_token",
    "X-ROLLI-USER-ID": "your_user_id",
    "Content-Type": "application/json"
  },
})
  .then(res => res.json())
  .then(console.log);
    
require "net/http"
require "uri"
require "json"

uri = URI("https://rolli.ai/api/usage?month=2024-06")
req = Net::HTTP::Get.new(uri)
req["X-ROLLI-TOKEN"] = "your_token"
req["X-ROLLI-USER-ID"] = "your_user_id"
req["Content-Type"] = "application/json"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(req)
end

puts res.body
    
import requests
import json

url = "https://rolli.ai/api/usage?month=2024-06"
headers = {
    "X-ROLLI-TOKEN": "your_token",
    "X-ROLLI-USER-ID": "your_user_id",
    "Content-Type": "application/json"
}response = requests.get(url, headers=headers)

print(response.json())
    

Response Example

Returns overall usage counts and detailed per-user usage linked to the provided credential.

{
    "searches_count": 17,
    "total_iq_searches_count": 18,
    "usage_by_user": [
      {
        "user": "john.doe",
        "searches_count": 12,
        "total_iq_searches_counts": 8,
        "iq_keywords_searches_count": 5,
        "iq_users_searches_count": 3,
        "last_search": "2024-06-11T22:01:07.322Z"
      },
      {
        "user": "jane.doe",
        "searches_count": 5,
        "total_iq_searches_counts": 10,
        "iq_keywords_searches_count": 6,
        "iq_users_searches_count": 4,
        "last_search": "2024-06-10T22:01:07.322Z"
      }
    ]
  }