Rybbit
APIStats

Events

Retrieve event data including custom events, pageviews, and outbound links

See the API Reference for authentication, common parameters, and filters.

Endpoints


Get Events

GET /api/events/:site

Returns a paginated list of events (pageviews, custom events, and outbound clicks).

Path Parameters

Prop

Type

Query Parameters

Accepts all Common Parameters plus the following:

Prop

Type

Response

Prop

Type

Event Object

Prop

Type

Request
curl -X GET "https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

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

response = requests.get(
    'https://api.rybbit.io/api/events/123',
    params={
        'page': 1,
        'page_size': 20,
        'start_date': '2024-01-01',
        'end_date': '2024-01-31'
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31');
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'

uri = URI('https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31')
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
req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31", 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 client = reqwest::Client::new();
let res = client
    .get("https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

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

var response = await client.GetAsync("https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "data": [
    {
      "timestamp": "2024-01-31T14:22:00.000Z",
      "type": "custom_event",
      "event_name": "signup",
      "properties": "{\"plan\":\"pro\",\"source\":\"homepage\"}",
      "user_id": "user_abc123",
      "pathname": "/signup",
      "hostname": "example.com",
      "page_title": "Sign Up",
      "browser": "Chrome",
      "operating_system": "macOS",
      "country": "US",
      "device_type": "desktop"
    },
    {
      "timestamp": "2024-01-31T14:21:00.000Z",
      "type": "pageview",
      "event_name": "",
      "properties": "{}",
      "user_id": "user_abc123",
      "pathname": "/pricing",
      "hostname": "example.com",
      "page_title": "Pricing",
      "browser": "Chrome",
      "operating_system": "macOS",
      "country": "US",
      "device_type": "desktop"
    }
  ],
  "pagination": {
    "total": 48933,
    "page": 1,
    "pageSize": 20,
    "totalPages": 2447
  }
}

Get Event Names

GET /api/events/names/:site

Returns a list of unique custom event names with their occurrence counts.

Path Parameters

Prop

Type

Query Parameters

Accepts all Common Parameters (time and filters).

Response

Prop

Type

EventName Object

Prop

Type

Request
curl -X GET "https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

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

response = requests.get(
    'https://api.rybbit.io/api/events/names/123',
    params={
        'start_date': '2024-01-01',
        'end_date': '2024-01-31'
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31');
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'

uri = URI('https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31')
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
req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31", 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 client = reqwest::Client::new();
let res = client
    .get("https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

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

var response = await client.GetAsync("https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "data": [
    {
      "eventName": "signup",
      "count": 1250
    },
    {
      "eventName": "purchase",
      "count": 320
    },
    {
      "eventName": "add_to_cart",
      "count": 890
    },
    {
      "eventName": "newsletter_subscribe",
      "count": 456
    }
  ]
}

Get Event Properties

GET /api/events/properties/:site

Returns property key-value pairs for a specific event name with their occurrence counts.

Path Parameters

Prop

Type

Query Parameters

Accepts all Common Parameters plus the following:

Prop

Type

Response

Prop

Type

EventProperty Object

Prop

Type

Request
curl -X GET "https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

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

response = requests.get(
    'https://api.rybbit.io/api/events/properties/123',
    params={
        'event_name': 'signup',
        'start_date': '2024-01-01',
        'end_date': '2024-01-31'
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31');
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'

uri = URI('https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31')
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
req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31", 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 client = reqwest::Client::new();
let res = client
    .get("https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

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

var response = await client.GetAsync("https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "data": [
    {
      "propertyKey": "plan",
      "propertyValue": "pro",
      "count": 520
    },
    {
      "propertyKey": "plan",
      "propertyValue": "starter",
      "count": 430
    },
    {
      "propertyKey": "plan",
      "propertyValue": "enterprise",
      "count": 300
    },
    {
      "propertyKey": "source",
      "propertyValue": "homepage",
      "count": 650
    },
    {
      "propertyKey": "source",
      "propertyValue": "pricing",
      "count": 600
    }
  ]
}

GET /api/events/outbound/:site

Returns a list of outbound link clicks with their occurrence counts.

Path Parameters

Prop

Type

Query Parameters

Accepts all Common Parameters (time and filters).

Response

Prop

Type

Prop

Type

Request
curl -X GET "https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

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

response = requests.get(
    'https://api.rybbit.io/api/events/outbound/123',
    params={
        'start_date': '2024-01-01',
        'end_date': '2024-01-31'
    },
    headers={
        'Authorization': 'Bearer your_api_key_here'
    }
)

data = response.json()
Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31');
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'

uri = URI('https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31')
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
req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31", 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 client = reqwest::Client::new();
let res = client
    .get("https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31")
    .header("Authorization", "Bearer your_api_key_here")
    .send()
    .await?;

let data: serde_json::Value = res.json().await?;
Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31"))
    .header("Authorization", "Bearer your_api_key_here")
    .GET()
    .build();

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

var response = await client.GetAsync("https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31");
var data = await response.Content.ReadAsStringAsync();
Response
{
  "data": [
    {
      "url": "https://github.com/example/repo",
      "count": 245,
      "lastClicked": "2024-01-31T14:22:00.000Z"
    },
    {
      "url": "https://twitter.com/example",
      "count": 189,
      "lastClicked": "2024-01-31T12:15:00.000Z"
    },
    {
      "url": "https://docs.example.com",
      "count": 156,
      "lastClicked": "2024-01-31T10:30:00.000Z"
    }
  ]
}