Get project usage
curl --request GET \
--url https://test-api.segmnt.cloud/v1/projects/{projectId}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://test-api.segmnt.cloud/v1/projects/{projectId}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://test-api.segmnt.cloud/v1/projects/{projectId}/usage', 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://test-api.segmnt.cloud/v1/projects/{projectId}/usage",
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: Bearer <token>"
],
]);
$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://test-api.segmnt.cloud/v1/projects/{projectId}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test-api.segmnt.cloud/v1/projects/{projectId}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/projects/{projectId}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"projectId": "<string>",
"from": "2023-12-25",
"to": "2023-12-25",
"storedSeconds": 123,
"watchedMinutes": 123
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Usage
Get project usage
Account totals and plan limits are in GET /v1/billing/plan.
GET
/
v1
/
projects
/
{projectId}
/
usage
Get project usage
curl --request GET \
--url https://test-api.segmnt.cloud/v1/projects/{projectId}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://test-api.segmnt.cloud/v1/projects/{projectId}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://test-api.segmnt.cloud/v1/projects/{projectId}/usage', 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://test-api.segmnt.cloud/v1/projects/{projectId}/usage",
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: Bearer <token>"
],
]);
$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://test-api.segmnt.cloud/v1/projects/{projectId}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test-api.segmnt.cloud/v1/projects/{projectId}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/projects/{projectId}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"projectId": "<string>",
"from": "2023-12-25",
"to": "2023-12-25",
"storedSeconds": 123,
"watchedMinutes": 123
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Authorizations
apiKeysession
Project API key. Server-side only.
Path Parameters
Pattern:
^prj_[A-Za-z0-9]+$Query Parameters
Start of the period (inclusive). Default is the start of the current billing period.
End of the period (inclusive). Default is today.
Response
Usage of the project.
Total stored length of the project's videos, weighted by quality (1 h of 1440p counts as 2 h, 1 h of 4K counts as 4 h), which is what counts against the plan's stored-hours limit.
Minutes watched by viewers in the period.