Compare a stretch of the range with the rest
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/explore/events/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selection": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"app_id": "<string>",
"filters": [],
"kinds": [],
"text": "<string>"
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/explore/events/compare"
payload = {
"selection": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"app_id": "<string>",
"filters": [],
"kinds": [],
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
selection: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
from: '2023-11-07T05:31:56Z',
to: '2023-11-07T05:31:56Z',
app_id: '<string>',
filters: [],
kinds: [],
text: '<string>'
})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/explore/events/compare', 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.apsio.io/v1/projects/{projectId}/explore/events/compare",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'selection' => [
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z'
],
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z',
'app_id' => '<string>',
'filters' => [
],
'kinds' => [
],
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apsio.io/v1/projects/{projectId}/explore/events/compare"
payload := strings.NewReader("{\n \"selection\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\",\n \"app_id\": \"<string>\",\n \"filters\": [],\n \"kinds\": [],\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apsio.io/v1/projects/{projectId}/explore/events/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"selection\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\",\n \"app_id\": \"<string>\",\n \"filters\": [],\n \"kinds\": [],\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/explore/events/compare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"selection\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\",\n \"app_id\": \"<string>\",\n \"filters\": [],\n \"kinds\": [],\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"from": "2026-10-04T10:15:00.431000000Z",
"to": "2026-10-04T10:15:00.431000000Z",
"selection": {
"from": "2026-10-04T10:15:00.431000000Z",
"to": "2026-10-04T10:15:00.431000000Z"
},
"selected": 123,
"rest": 123,
"values": [
{
"facet": "kind",
"value": "<string>",
"selected": 123,
"rest": 123,
"lift": 123
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}API reference
Compare a stretch of the range with the rest
For the same query as the search, what sets a stretch of its range apart: the events per kind and the 6 releases, devices, OS versions, screens, network types and feature flags most frequent in the selection, each counted in the selection and in the rest of the range, with its lift, the most over-represented first (a value only the selection has leads). Every filter of the query applies to both sides. One run of the project’s Explore limit.
POST
/
projects
/
{projectId}
/
explore
/
events
/
compare
Compare a stretch of the range with the rest
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/explore/events/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selection": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"app_id": "<string>",
"filters": [],
"kinds": [],
"text": "<string>"
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/explore/events/compare"
payload = {
"selection": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"app_id": "<string>",
"filters": [],
"kinds": [],
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
selection: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
from: '2023-11-07T05:31:56Z',
to: '2023-11-07T05:31:56Z',
app_id: '<string>',
filters: [],
kinds: [],
text: '<string>'
})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/explore/events/compare', 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.apsio.io/v1/projects/{projectId}/explore/events/compare",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'selection' => [
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z'
],
'from' => '2023-11-07T05:31:56Z',
'to' => '2023-11-07T05:31:56Z',
'app_id' => '<string>',
'filters' => [
],
'kinds' => [
],
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apsio.io/v1/projects/{projectId}/explore/events/compare"
payload := strings.NewReader("{\n \"selection\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\",\n \"app_id\": \"<string>\",\n \"filters\": [],\n \"kinds\": [],\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apsio.io/v1/projects/{projectId}/explore/events/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"selection\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\",\n \"app_id\": \"<string>\",\n \"filters\": [],\n \"kinds\": [],\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/explore/events/compare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"selection\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\",\n \"app_id\": \"<string>\",\n \"filters\": [],\n \"kinds\": [],\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"from": "2026-10-04T10:15:00.431000000Z",
"to": "2026-10-04T10:15:00.431000000Z",
"selection": {
"from": "2026-10-04T10:15:00.431000000Z",
"to": "2026-10-04T10:15:00.431000000Z"
},
"selected": 123,
"rest": 123,
"values": [
{
"facet": "kind",
"value": "<string>",
"selected": 123,
"rest": 123,
"lift": 123
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}Authorizations
Path Parameters
Body
application/json
Events whose text contains this, ignoring case: a log's body and exception, a span's name, route and status message. Plain text, not a pattern.
Required string length:
1 - 200Response
The values that set the selection apart.