Rybbit
Organizations

Get Organization Event Count

Returns daily event usage counts across an organization's sites.

GET /api/org-event-count/:organizationId

Returns daily event usage counts across an organization's sites.

Path Parameters

Prop

Type

Query Parameters

Prop

Type

Response

Prop

Type

Request
curl -X GET "https://app.rybbit.io/api/org-event-count/org_abc123?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC" \
  -H "Authorization: Bearer your_api_key_here"
Request
const organizationId = 'org_abc123';
const response = await fetch(
  `https://app.rybbit.io/api/org-event-count/${organizationId}?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC`,
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

const data = await response.json();
Request
import requests

organization_id = 'org_abc123'
response = requests.get(
    f'https://app.rybbit.io/api/org-event-count/{organization_id}',
    params={
        'start_date': '2024-01-01',
        'end_date': '2024-01-31',
        'time_zone': 'UTC'
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$organizationId = 'org_abc123';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://app.rybbit.io/api/org-event-count/{$organizationId}?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer your_api_key_here'
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
Request
require 'net/http'
require 'json'

organization_id = 'org_abc123'
uri = URI("https://app.rybbit.io/api/org-event-count/#{organization_id}?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC")
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
Request
organizationId := "org_abc123"
req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/org-event-count/"+organizationId+"?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")

client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()

var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
Request
let organization_id = "org_abc123";
let client = reqwest::Client::new();
let res = client
    .get(format!("https://app.rybbit.io/api/org-event-count/{}?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC", organization_id))
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
String organizationId = "org_abc123";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://app.rybbit.io/api/org-event-count/" + organizationId + "?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Request
var organizationId = "org_abc123";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");

var response = await client.GetAsync($"https://app.rybbit.io/api/org-event-count/{organizationId}?start_date=2024-01-01&end_date=2024-01-31&time_zone=UTC");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "data": [
    {
      "event_date": "2024-01-01",
      "pageview_count": 38900,
      "custom_event_count": 4210,
      "performance_count": 12050,
      "outbound_count": 980,
      "error_count": 145,
      "button_click_count": 6320,
      "copy_count": 410,
      "form_submit_count": 220,
      "input_change_count": 1530,
      "event_count": 64765
    },
    {
      "event_date": "2024-01-02",
      "pageview_count": 41200,
      "custom_event_count": 4560,
      "performance_count": 12880,
      "outbound_count": 1040,
      "error_count": 132,
      "button_click_count": 6710,
      "copy_count": 455,
      "form_submit_count": 248,
      "input_change_count": 1622,
      "event_count": 68847
    }
  ]
}