curl --request GET \
--url https://api.pictor.cloud/api/analytics/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pictor.cloud/api/analytics/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pictor.cloud/api/analytics/events', 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.pictor.cloud/api/analytics/events",
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://api.pictor.cloud/api/analytics/events"
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://api.pictor.cloud/api/analytics/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictor.cloud/api/analytics/events")
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[
{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"score": 123,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ts_start": "2023-11-07T05:31:56Z",
"type": "<string>",
"alarm_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bbox": {
"[0]": 123,
"[1]": 123,
"[2]": 123,
"[3]": 123
},
"camera_name": "<string>",
"clip_path": "<string>",
"model_id": "<string>",
"payload": {},
"review_reason": "<string>",
"review_status": "unreviewed",
"reviewed_at": "2023-11-07T05:31:56Z",
"reviewed_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"snapshot_annotated_path": "<string>",
"snapshot_annotated_url": "<string>",
"snapshot_path": "<string>",
"snapshot_url": "<string>",
"track_id": "<string>",
"ts_end": "2023-11-07T05:31:56Z"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Os eventos de IA da janela
Os eventos que a análise de vídeo gerou na janela — o que foi visto, quando, em qual câmera, com que confiança, e a foto.
snapshot_url e snapshot_annotated_url são endereços assinados e temporários
(o segundo traz a marcação sobre a imagem). Como toda URL assinada aqui: guarde
os bytes, não o link.
Filtre no servidor, não depois. min_score e review_status entram na
consulta antes do limite de linhas. Filtrar confiança do seu lado, sobre a
página que chegou, produz um número que parece total e não é: “12 eventos acima
de 90%” viraria “12 entre os últimos 50”, não 12 no período.
Como avançar sem reler. A resposta vem do mais recente para o mais antigo,
limitada a limit. Para acompanhar sem varrer, guarde o ts_start do último
evento que você já tem e use-o como since na próxima chamada. Se uma janela
devolveu exatamente limit linhas, ela transbordou: estreite com until e
caminhe para trás até esvaziar, senão os eventos mais antigos da janela ficam
para trás em silêncio.
Sem since, a janela padrão é de 24 horas.
curl --request GET \
--url https://api.pictor.cloud/api/analytics/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pictor.cloud/api/analytics/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pictor.cloud/api/analytics/events', 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.pictor.cloud/api/analytics/events",
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://api.pictor.cloud/api/analytics/events"
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://api.pictor.cloud/api/analytics/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictor.cloud/api/analytics/events")
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[
{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"score": 123,
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ts_start": "2023-11-07T05:31:56Z",
"type": "<string>",
"alarm_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bbox": {
"[0]": 123,
"[1]": 123,
"[2]": 123,
"[3]": 123
},
"camera_name": "<string>",
"clip_path": "<string>",
"model_id": "<string>",
"payload": {},
"review_reason": "<string>",
"review_status": "unreviewed",
"reviewed_at": "2023-11-07T05:31:56Z",
"reviewed_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"snapshot_annotated_path": "<string>",
"snapshot_annotated_url": "<string>",
"snapshot_path": "<string>",
"snapshot_url": "<string>",
"track_id": "<string>",
"ts_end": "2023-11-07T05:31:56Z"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Chave de API da conta, no formato pct_<prefixo>_<segredo>.
Query Parameters
Confiança mínima (0..1). Filtra NO BANCO, antes do limite.
0 <= x <= 1Recorte pelo veredito do operador.
^(unreviewed|true_positive|false_positive|reviewed)$1 <= x <= 500Response
Successful Response
Show child attributes
Show child attributes
unreviewed, true_positive, false_positive