Get metrics using event name
curl --request GET \
--url https://statsigapi.net/console/v1/events/{eventName}/metrics \
--header 'STATSIG-API-KEY: <api-key>'import requests
url = "https://statsigapi.net/console/v1/events/{eventName}/metrics"
headers = {"STATSIG-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'STATSIG-API-KEY': '<api-key>'}};
fetch('https://statsigapi.net/console/v1/events/{eventName}/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://statsigapi.net/console/v1/events/{eventName}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"STATSIG-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://statsigapi.net/console/v1/events/{eventName}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("STATSIG-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://statsigapi.net/console/v1/events/{eventName}/metrics")
.header("STATSIG-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/events/{eventName}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Metrics listed successfully.",
"data": [
{
"id": "add_to_cart::event_count",
"name": "add_to_cart",
"directionality": "increase",
"type": "event_count",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"dashboard_test"
],
"createdTime": 1678165878415,
"lineage": {
"events": [
"add_to_cart"
],
"metrics": []
},
"team": null
},
{
"id": "add_to_cart::event_dau",
"name": "add_to_cart",
"directionality": "increase",
"type": "event_dau",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"asdf",
"dashboard_test"
],
"createdTime": 1680128775716,
"lineage": {
"events": [
"add_to_cart"
],
"metrics": []
},
"team": null
},
{
"id": "test funnel 1::funnel",
"name": "test funnel 1",
"directionality": "increase",
"type": "funnel",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [],
"creatorName": "Test User",
"creatorEmail": "test@statsig.com",
"createdTime": 1695253296002,
"owner": {
"name": "Test User"
},
"lineage": {
"events": [],
"metrics": [
"add_to_cart::event_count",
"add_to_cart_games::event_count_custom"
]
},
"team": null,
"funnelCountDistinct": "events",
"funnelEventList": [
{
"name": "add_to_cart",
"type": "event_count"
},
{
"name": "add_to_cart_games",
"type": "event_count_custom"
}
]
},
{
"id": "super_long_metric_nameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_thing::funnel",
"name": "super_long_metric_nameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_thing",
"directionality": "increase",
"type": "funnel",
"description": "test",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"Funnels"
],
"creatorName": "Test User ",
"creatorEmail": "test@statsig.com",
"createdTime": 1698427486777,
"owner": {
"name": "Test User"
},
"lineage": {
"events": [],
"metrics": [
"add_to_cart::event_dau",
"new_custom_metric::event_user"
]
},
"team": null,
"funnelCountDistinct": "users",
"funnelEventList": [
{
"name": "add_to_cart",
"type": "event_dau"
},
{
"name": "new_custom_metric",
"type": "event_user"
}
]
},
{
"id": "test_funnel_metric::funnel",
"name": "test_funnel_metric",
"directionality": "decrease",
"type": "funnel",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"Funnels"
],
"creatorName": "Test User",
"creatorEmail": "test@statsig.com",
"createdTime": 1701984009755,
"owner": {
"name": "Test User"
},
"lineage": {
"events": [],
"metrics": [
"add_to_cart::event_dau"
]
},
"team": null,
"funnelCountDistinct": "users",
"funnelEventList": [
{
"name": "add_to_cart",
"type": "event_dau"
}
]
}
],
"pagination": {
"itemsPerPage": 5,
"pageNumber": 1,
"totalItems": 1254,
"nextPage": "?page=2&limit=5",
"previousPage": null,
"all": ""
}
}{
"status": 400,
"message": "Invalid request. Please check the request input and try again."
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}Events
Get metrics using event name
GET
/
console
/
v1
/
events
/
{eventName}
/
metrics
Get metrics using event name
curl --request GET \
--url https://statsigapi.net/console/v1/events/{eventName}/metrics \
--header 'STATSIG-API-KEY: <api-key>'import requests
url = "https://statsigapi.net/console/v1/events/{eventName}/metrics"
headers = {"STATSIG-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'STATSIG-API-KEY': '<api-key>'}};
fetch('https://statsigapi.net/console/v1/events/{eventName}/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://statsigapi.net/console/v1/events/{eventName}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"STATSIG-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://statsigapi.net/console/v1/events/{eventName}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("STATSIG-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://statsigapi.net/console/v1/events/{eventName}/metrics")
.header("STATSIG-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/events/{eventName}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Metrics listed successfully.",
"data": [
{
"id": "add_to_cart::event_count",
"name": "add_to_cart",
"directionality": "increase",
"type": "event_count",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"dashboard_test"
],
"createdTime": 1678165878415,
"lineage": {
"events": [
"add_to_cart"
],
"metrics": []
},
"team": null
},
{
"id": "add_to_cart::event_dau",
"name": "add_to_cart",
"directionality": "increase",
"type": "event_dau",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"asdf",
"dashboard_test"
],
"createdTime": 1680128775716,
"lineage": {
"events": [
"add_to_cart"
],
"metrics": []
},
"team": null
},
{
"id": "test funnel 1::funnel",
"name": "test funnel 1",
"directionality": "increase",
"type": "funnel",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [],
"creatorName": "Test User",
"creatorEmail": "test@statsig.com",
"createdTime": 1695253296002,
"owner": {
"name": "Test User"
},
"lineage": {
"events": [],
"metrics": [
"add_to_cart::event_count",
"add_to_cart_games::event_count_custom"
]
},
"team": null,
"funnelCountDistinct": "events",
"funnelEventList": [
{
"name": "add_to_cart",
"type": "event_count"
},
{
"name": "add_to_cart_games",
"type": "event_count_custom"
}
]
},
{
"id": "super_long_metric_nameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_thing::funnel",
"name": "super_long_metric_nameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_thing",
"directionality": "increase",
"type": "funnel",
"description": "test",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"Funnels"
],
"creatorName": "Test User ",
"creatorEmail": "test@statsig.com",
"createdTime": 1698427486777,
"owner": {
"name": "Test User"
},
"lineage": {
"events": [],
"metrics": [
"add_to_cart::event_dau",
"new_custom_metric::event_user"
]
},
"team": null,
"funnelCountDistinct": "users",
"funnelEventList": [
{
"name": "add_to_cart",
"type": "event_dau"
},
{
"name": "new_custom_metric",
"type": "event_user"
}
]
},
{
"id": "test_funnel_metric::funnel",
"name": "test_funnel_metric",
"directionality": "decrease",
"type": "funnel",
"description": "",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [
"Funnels"
],
"creatorName": "Test User",
"creatorEmail": "test@statsig.com",
"createdTime": 1701984009755,
"owner": {
"name": "Test User"
},
"lineage": {
"events": [],
"metrics": [
"add_to_cart::event_dau"
]
},
"team": null,
"funnelCountDistinct": "users",
"funnelEventList": [
{
"name": "add_to_cart",
"type": "event_dau"
}
]
}
],
"pagination": {
"itemsPerPage": 5,
"pageNumber": 1,
"totalItems": 1254,
"nextPage": "?page=2&limit=5",
"previousPage": null,
"all": ""
}
}{
"status": 400,
"message": "Invalid request. Please check the request input and try again."
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}Authorizations
Headers
Optional header to respect review settings for mutation endpoints.
Path Parameters
Response
Get metrics from events response
⌘I

