Get usage stats
Mention and keyword counts for the current billing cycle, plus plan limits. Includes flex (usage-based) state when enabled. On the Agents plan a searches block reports the lifetime search allowance (used/limit/remaining).
curl --request GET \
--url https://app.octolens.com/api/v2/org/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.octolens.com/api/v2/org/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.octolens.com/api/v2/org/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://app.octolens.com/api/v2/org/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://app.octolens.com/api/v2/org/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://app.octolens.com/api/v2/org/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.octolens.com/api/v2/org/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{
"plan": "Pro_v3",
"mentions": {
"count": 0,
"limit": 0,
"resetAt": "2023-11-07T05:31:56Z"
},
"keywords": {
"count": 0,
"limit": 0
},
"searches": {
"used": 0,
"limit": 0,
"remaining": 4503599627370495
},
"flex": {
"enabled": true,
"budgetCents": 0,
"used": 0,
"resetAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}Authorizations
Clerk API key. Create one in Settings → API Keys. Pass as Authorization: Bearer <key>.
Response
200 response
Current-cycle usage counters and plan limits.
Current subscription plan (e.g. Free_trial, Pro_v3, Enterprise). null if no active plan / free trial expired. The *.limit numbers below already reflect this plan.
"Pro_v3"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Lifetime on-demand search allowance. Only present on the Agents plan (the only plan with a lifetime search cap). Numbers come from the canonical quota read — identical to the X-Octolens-Searches-Remaining header on /api/v2/search* responses.
Show child attributes
Show child attributes
Flex (usage-based) pricing state. Only present when flex pricing is enabled for the org.
Show child attributes
Show child attributes
Was this page helpful?
curl --request GET \
--url https://app.octolens.com/api/v2/org/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.octolens.com/api/v2/org/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.octolens.com/api/v2/org/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://app.octolens.com/api/v2/org/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://app.octolens.com/api/v2/org/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://app.octolens.com/api/v2/org/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.octolens.com/api/v2/org/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{
"plan": "Pro_v3",
"mentions": {
"count": 0,
"limit": 0,
"resetAt": "2023-11-07T05:31:56Z"
},
"keywords": {
"count": 0,
"limit": 0
},
"searches": {
"used": 0,
"limit": 0,
"remaining": 4503599627370495
},
"flex": {
"enabled": true,
"budgetCents": 0,
"used": 0,
"resetAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}