Segmentation
Numerically Bucket
Bucket a numeric event property into ranges via the legacy Segmentation API, now in maintenance mode; use Insights instead
GET
/
segmentation
/
numeric
Numerically Bucket
curl --request GET \
--url https://{regionAndDomain}.com/api/query/segmentation/numeric \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://{regionAndDomain}.com/api/query/segmentation/numeric"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://{regionAndDomain}.com/api/query/segmentation/numeric', 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://{regionAndDomain}.com/api/query/segmentation/numeric",
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: Basic <encoded-value>"
],
]);
$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://{regionAndDomain}.com/api/query/segmentation/numeric"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{regionAndDomain}.com/api/query/segmentation/numeric")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{regionAndDomain}.com/api/query/segmentation/numeric")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": {
"series": [
"2011-08-08",
"2011-08-09",
"2011-08-06",
"2011-08-07"
],
"values": {
"2,000 - 2,100": {
"2011-08-06": 1,
"2011-08-07": 5,
"2011-08-08": 4,
"2011-08-09": 15
},
"2,100 - 2,200": {
"2011-08-07": 2,
"2011-08-08": 7,
"2011-08-09": 15
},
"2,200 - 2,300": {
"2011-08-06": 1,
"2011-08-08": 6,
"2011-08-09": 5
},
"2,300 - 2,400": {
"2011-08-06": 4,
"2011-08-08": 1,
"2011-08-09": 12
},
"2,400 - 2,500": {
"2011-08-08": 2,
"2011-08-09": 5
}
}
},
"legend_size": 5
}❗️The Segmentation Query API is in maintenance mode. We recommend discontinuing new use of this endpoint. To break down and filter event data, build an Insights report in-app and query it programmatically with the Insights Query API. For raw event data, see export methods. If you need help choosing the best method, reach out to support.
Query Parameters
The property expression to segment the event on. This expression must be a numeric property. See the expressions section below.
An expression to filter events by. See the expression to segment below.
Was this page helpful?
Numerically Bucket
curl --request GET \
--url https://{regionAndDomain}.com/api/query/segmentation/numeric \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://{regionAndDomain}.com/api/query/segmentation/numeric"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://{regionAndDomain}.com/api/query/segmentation/numeric', 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://{regionAndDomain}.com/api/query/segmentation/numeric",
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: Basic <encoded-value>"
],
]);
$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://{regionAndDomain}.com/api/query/segmentation/numeric"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{regionAndDomain}.com/api/query/segmentation/numeric")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{regionAndDomain}.com/api/query/segmentation/numeric")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": {
"series": [
"2011-08-08",
"2011-08-09",
"2011-08-06",
"2011-08-07"
],
"values": {
"2,000 - 2,100": {
"2011-08-06": 1,
"2011-08-07": 5,
"2011-08-08": 4,
"2011-08-09": 15
},
"2,100 - 2,200": {
"2011-08-07": 2,
"2011-08-08": 7,
"2011-08-09": 15
},
"2,200 - 2,300": {
"2011-08-06": 1,
"2011-08-08": 6,
"2011-08-09": 5
},
"2,300 - 2,400": {
"2011-08-06": 4,
"2011-08-08": 1,
"2011-08-09": 12
},
"2,400 - 2,500": {
"2011-08-08": 2,
"2011-08-09": 5
}
}
},
"legend_size": 5
}