API_Consumption
Purpose
The API_Consumption collection tracks aggregated API usage statistics for different applications and SDKs. Each document contains arrays of monthly call counts, grouped by service (such as 3D Viewer, ARPD Meter, or VTO).
It is important to note that the documents in this collection may have different structures: some documents contain fields for certain services, while others contain fields for different services. This allows the collection to flexibly store usage data for various APIs, even if not all services are present in every document.
Document schema
{
"APP_3DViewer_sdk": [
{
"calls": "number",
"month": "number",
"year": "number"
}
],
"APP_ARPD_meter_sdk": [
{
"calls": "number",
"month": "number",
"year": "number"
}
],
"APP_vto_sdk": [
{
"calls": "number",
"month": "number",
"year": "number"
}
],
"ARPD_meter_app_sdk": [
{
"calls": "number",
"month": "number",
"year": "number"
}
],
"ARPD_meter_web": [
{
"calls": "number",
"month": "number",
"year": "number"
}
],
"ARPD_meter_web_sdk": [
{
"calls": "number",
"month": "number",
"year": "number"
}
]
}
Indexes
This collection does not have external indexes.
Query examples
// Fetch the Reference Doc from Firebase
const apiConsumptionReqRef = doc(db, "API_Consumption", apiConsumptionId);
// Get the Document Snapshot from the Reference Doc
const apiConsumptionReqSnap = await getDoc(apiConsumptionReqRef);