Rybbit
Events

Get Events

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

GET /api/sites/:site/events

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://app.rybbit.io/api/sites/1/events?page_size=50&start_date=2024-01-01&end_date=2024-01-31" \
  -H "Authorization: Bearer your_api_key_here"
Request
const response = await fetch(
  'https://app.rybbit.io/api/sites/1/events?page_size=50&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://app.rybbit.io/api/sites/1/events',
    params={
        'page_size': 50,
        '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://app.rybbit.io/api/sites/1/events?page_size=50&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://app.rybbit.io/api/sites/1/events?page_size=50&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://app.rybbit.io/api/sites/1/events?page_size=50&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://app.rybbit.io/api/sites/1/events?page_size=50&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://app.rybbit.io/api/sites/1/events?page_size=50&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://app.rybbit.io/api/sites/1/events?page_size=50&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\"}",
      "session_id": "abc123def456",
      "user_id": "user_abc123",
      "identified_user_id": "",
      "pathname": "/signup",
      "querystring": "",
      "hostname": "example.com",
      "page_title": "Sign Up",
      "referrer": "https://google.com",
      "browser": "Chrome",
      "browser_version": "120.0",
      "operating_system": "macOS",
      "operating_system_version": "14.0",
      "language": "en-US",
      "country": "US",
      "region": "California",
      "city": "San Francisco",
      "lat": 37.7749,
      "lon": -122.4194,
      "screen_width": 1920,
      "screen_height": 1080,
      "device_type": "desktop"
    },
    {
      "timestamp": "2024-01-31T14:21:00.000Z",
      "type": "pageview",
      "event_name": "",
      "properties": "{}",
      "session_id": "abc123def456",
      "user_id": "user_abc123",
      "identified_user_id": "",
      "pathname": "/pricing",
      "querystring": "",
      "hostname": "example.com",
      "page_title": "Pricing",
      "referrer": "https://example.com/",
      "browser": "Chrome",
      "browser_version": "120.0",
      "operating_system": "macOS",
      "operating_system_version": "14.0",
      "language": "en-US",
      "country": "US",
      "region": "California",
      "city": "San Francisco",
      "lat": 37.7749,
      "lon": -122.4194,
      "screen_width": 1920,
      "screen_height": 1080,
      "device_type": "desktop"
    }
  ],
  "cursor": {
    "hasMore": true,
    "oldestTimestamp": "2024-01-31T14:21:00.000Z"
  }
}