Typescript (SDK)
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.sites.listExperiments({
id: "<id>",
});
console.log(result);
}
run();curl --request GET \
--url https://api.crevio.co/v1/sites/{id}/experiments \
--header 'Authorization: <api-key>'import requests
url = "https://api.crevio.co/v1/sites/{id}/experiments"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.crevio.co/v1/sites/{id}/experiments', 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://api.crevio.co/v1/sites/{id}/experiments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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://api.crevio.co/v1/sites/{id}/experiments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://api.crevio.co/v1/sites/{id}/experiments")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crevio.co/v1/sites/{id}/experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "<string>",
"id": "<string>",
"site_id": "<string>",
"key": "<string>",
"name": "<string>",
"hypothesis": "<string>",
"path": "<string>",
"goal": "<string>",
"primary_metric": "conversion_rate",
"status": "draft",
"shipped_variant": "<string>",
"variants": [
{
"key": "<string>",
"name": "<string>",
"weight": 50
}
],
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"results": {
"verdict": "collecting",
"winner": "<string>",
"primary_metric": "conversion_rate",
"goal": "<string>",
"summary": "<string>",
"window": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"truncated": true
},
"currency": "<string>",
"sample_ratio_p_value": 123,
"variants": [
{
"key": "<string>",
"name": "<string>",
"visitors": 123,
"buyers": 123,
"orders": 123,
"revenue": 123,
"conversion_rate": 123,
"revenue_per_visitor": 123,
"vs_control": {
"lift": 123,
"ci_low": 123,
"ci_high": 123,
"chance_to_beat_control": 123
}
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true,
"url": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "bad_request",
"message": "The request was malformed or contained invalid parameters"
}
}{
"error": {
"type": "invalid_request_error",
"code": "authentication_required",
"message": "You did not provide an API key."
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "The requested resource was not found"
}
}{
"error": {
"type": "invalid_request_error",
"code": "rate_limit_exceeded",
"message": "Too many requests. Please retry later."
}
}Sites
List a site's A/B tests
Returns the site’s A/B tests, newest first. Filter with status. Results are left out here (results is null); get one test to read them.
GET
/
sites
/
{id}
/
experiments
Typescript (SDK)
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.sites.listExperiments({
id: "<id>",
});
console.log(result);
}
run();curl --request GET \
--url https://api.crevio.co/v1/sites/{id}/experiments \
--header 'Authorization: <api-key>'import requests
url = "https://api.crevio.co/v1/sites/{id}/experiments"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.crevio.co/v1/sites/{id}/experiments', 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://api.crevio.co/v1/sites/{id}/experiments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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://api.crevio.co/v1/sites/{id}/experiments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://api.crevio.co/v1/sites/{id}/experiments")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crevio.co/v1/sites/{id}/experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "<string>",
"id": "<string>",
"site_id": "<string>",
"key": "<string>",
"name": "<string>",
"hypothesis": "<string>",
"path": "<string>",
"goal": "<string>",
"primary_metric": "conversion_rate",
"status": "draft",
"shipped_variant": "<string>",
"variants": [
{
"key": "<string>",
"name": "<string>",
"weight": 50
}
],
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"results": {
"verdict": "collecting",
"winner": "<string>",
"primary_metric": "conversion_rate",
"goal": "<string>",
"summary": "<string>",
"window": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"truncated": true
},
"currency": "<string>",
"sample_ratio_p_value": 123,
"variants": [
{
"key": "<string>",
"name": "<string>",
"visitors": 123,
"buyers": 123,
"orders": 123,
"revenue": 123,
"conversion_rate": 123,
"revenue_per_visitor": 123,
"vs_control": {
"lift": 123,
"ci_low": 123,
"ci_high": 123,
"chance_to_beat_control": 123
}
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true,
"url": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "bad_request",
"message": "The request was malformed or contained invalid parameters"
}
}{
"error": {
"type": "invalid_request_error",
"code": "authentication_required",
"message": "You did not provide an API key."
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "The requested resource was not found"
}
}{
"error": {
"type": "invalid_request_error",
"code": "rate_limit_exceeded",
"message": "Too many requests. Please retry later."
}
}Query Parameters
Only return objects created in this window. Pass a Unix timestamp in seconds for an exact match, or bound it with created[gt], created[gte], created[lt] and created[lte], which combine: created[gte]=1735689600&created[lt]=1738368000 is January 2025. ISO 8601 times work too (created[gte]=2025-01-01T00:00:00Z), so a created_at from a response can be passed back as is.
Unix seconds, exact match
Was this page helpful?

