Usage by token
curl --request GET \
--url https://api.generect.com/api/v1/accounts/tokens/analytics/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.generect.com/api/v1/accounts/tokens/analytics/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.generect.com/api/v1/accounts/tokens/analytics/', 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.generect.com/api/v1/accounts/tokens/analytics/",
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.generect.com/api/v1/accounts/tokens/analytics/"
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.generect.com/api/v1/accounts/tokens/analytics/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.generect.com/api/v1/accounts/tokens/analytics/")
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{
"data": {
"period": {
"start": "2026-05-01T00:00:00",
"end": "2026-05-31T23:59:59"
},
"total_requests": 1840,
"tokens": [
{
"token": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Acme Corp",
"client_id": "acme-corp",
"is_active": true,
"created_at": "2026-04-02T09:15:00",
"total_requests": 1200,
"by_endpoint": {
"/api/v1/search/database/leads/": 900,
"/api/v1/email/find/": 300
},
"by_status": {
"2xx": 1180,
"4xx": 20
}
},
{
"token": "c9f0f895fb98ab9159f51fd0297e236d",
"name": "Globex",
"client_id": "globex",
"is_active": false,
"created_at": "2026-04-18T14:02:00",
"total_requests": 640,
"by_endpoint": {
"/api/v1/search/realtime/leads/": 640
},
"by_status": {
"2xx": 640
}
}
]
}
}{
"status": "error",
"status_code": 400,
"detail": "Person does not exist"
}{
"status": "error",
"status_code": 401,
"detail": "Authentication credentials were not provided."
}{
"status": "error",
"status_code": 403,
"detail": "You do not have permission to perform this action."
}Account
Usage by token
The same usage figures as /accounts/usage/, split by API token instead of totalled for the account.
This is for platforms that hand each of their own customers a separate Generect token. You get, per token: how many requests it made, which endpoints it called, and how many of those succeeded or failed — enough to attribute cost to the customer who caused it, or to spot the one client whose integration is retrying in a loop.
You only ever see your own tokens, never another account’s. If you do not pass dates, the report covers the last 30 days.
GET
/
api
/
v1
/
accounts
/
tokens
/
analytics
/
Usage by token
curl --request GET \
--url https://api.generect.com/api/v1/accounts/tokens/analytics/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.generect.com/api/v1/accounts/tokens/analytics/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.generect.com/api/v1/accounts/tokens/analytics/', 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.generect.com/api/v1/accounts/tokens/analytics/",
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.generect.com/api/v1/accounts/tokens/analytics/"
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.generect.com/api/v1/accounts/tokens/analytics/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.generect.com/api/v1/accounts/tokens/analytics/")
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{
"data": {
"period": {
"start": "2026-05-01T00:00:00",
"end": "2026-05-31T23:59:59"
},
"total_requests": 1840,
"tokens": [
{
"token": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Acme Corp",
"client_id": "acme-corp",
"is_active": true,
"created_at": "2026-04-02T09:15:00",
"total_requests": 1200,
"by_endpoint": {
"/api/v1/search/database/leads/": 900,
"/api/v1/email/find/": 300
},
"by_status": {
"2xx": 1180,
"4xx": 20
}
},
{
"token": "c9f0f895fb98ab9159f51fd0297e236d",
"name": "Globex",
"client_id": "globex",
"is_active": false,
"created_at": "2026-04-18T14:02:00",
"total_requests": 640,
"by_endpoint": {
"/api/v1/search/realtime/leads/": 640
},
"by_status": {
"2xx": 640
}
}
]
}
}{
"status": "error",
"status_code": 400,
"detail": "Person does not exist"
}{
"status": "error",
"status_code": 401,
"detail": "Authentication credentials were not provided."
}{
"status": "error",
"status_code": 403,
"detail": "You do not have permission to perform this action."
}Use Case:
If you resell Generect inside your own product, you probably issue one token per customer. This endpoint tells you what each of those tokens actually did, so you can bill the right customer, see who is close to their limit, and catch a broken integration before it shows up on your invoice. Ask for a single client withclient_id, or leave it off to get every token at once. Tokens with no traffic in the period are still listed, at zero — useful for spotting a customer who has stopped using you.Authorizations
Query Parameters
Was this page helpful?