Get API & WebSocket usage
curl --request GET \
--url https://demo-api.mobula.io/api/2/usageimport requests
url = "https://demo-api.mobula.io/api/2/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/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://demo-api.mobula.io/api/2/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://demo-api.mobula.io/api/2/usage"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"source": "api",
"apiKey": "<string>",
"from": "<string>",
"to": "<string>",
"finalizedThrough": "<string>",
"nextCursor": "<string>",
"totals": {
"credits": 1,
"requestCalls": 1
},
"rows": [
{
"timestamp": "<string>",
"credits": 1,
"requestCalls": 1,
"metrics": {}
}
]
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Usage Data
Get API & WebSocket Usage
A single API key’s consumption over a time window — REST usage (source=api) or WebSocket usage (source=wss) — with per-endpoint / per-event breakdown, totals, and cursor pagination.
GET
/
2
/
usage
Get API & WebSocket usage
curl --request GET \
--url https://demo-api.mobula.io/api/2/usageimport requests
url = "https://demo-api.mobula.io/api/2/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/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://demo-api.mobula.io/api/2/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://demo-api.mobula.io/api/2/usage"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"source": "api",
"apiKey": "<string>",
"from": "<string>",
"to": "<string>",
"finalizedThrough": "<string>",
"nextCursor": "<string>",
"totals": {
"credits": 1,
"requestCalls": 1
},
"rows": [
{
"timestamp": "<string>",
"credits": 1,
"requestCalls": 1,
"metrics": {}
}
]
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Choose one
source per call:
api— REST usage:credits,requestCalls, and per-endpointmetrics.wss— WebSocket usage:events, with a per-servicebreakdown.
apiKey and exactly one of customerId or organizationId — find these on your dashboard settings page. Rows are newest-first — paginate with nextCursor.