コンテンツにジャンプ

統計

The Statistics endpoints provide detailed analytics about your apps and organizations. You can track Monthly Active Users (MAU), storage usage, and bandwidth consumption across different time periods. This data is essential for monitoring app growth, resource usage, and planning capacity.

  • MAU (Monthly Active Users):アプリにアクセスしたユニークなデバイスの数(過去30日間)
  • Storage:すべてのバンドルとリソースの合計サイズ(バイト)
  • Bandwidth:バンドルダウンロードの合計データ転送量(バイト)
  1. Regular Monitoring: __CAPGO_KEEP_0__を定期的に確認して成長と使用パターンを追跡する
  2. Resource Planning: ストレージとバンド幅のメトリクスを使用して容量計画を行う
  3. User Engagement: MAUを使用してユーザー エンゲージメントのトレンドを理解する
  4. Cost Management: リソースの使用を監視してコストを最適化する

: __CAPGO_KEEP_0__/statistics/app/:app_id/

Section titled “GET /statistics/app/:app_id/”

特定アプリの統計を取得します。このエンドポイントは、個々のアプリのパフォーマンスを監視するのに役立ちます。

interface StatsQuery {
from: Date // Start date for the statistics (format: YYYY-MM-DD)
to: Date // End date for the statistics (format: YYYY-MM-DD)
}
ターミナル画面
curl -H "authorization: your-api-key" \
"https://api.capgo.app/statistics/app/com.demo.app/?from=2024-01-01&to=2024-02-01"
[
{
"date": "2024-01-01",
"mau": 1500,
"storage": 536870912, // 512MB in bytes
"bandwidth": 1073741824 // 1GB in bytes
},
{
"date": "2024-01-02",
"mau": 1550,
"storage": 537919488, // 513MB in bytes
"bandwidth": 1074790400 // 1.01GB in bytes
}
]

GET /statistics/org/:org_id/

GET /statistics/org/:org_id/

組織の特定のIDを持つ組織の統計を取得します。組織レベルの使用状況を監視するのに役立ちます。

Query Parameters

Query Parameters
interface StatsQuery {
from: Date // Start date for the statistics (format: YYYY-MM-DD)
to: Date // End date for the statistics (format: YYYY-MM-DD)
breakdown: boolean // default false, optional if true it return the breakdown by app
noAccumulate: boolean // default false, optional if true it will not accumulate data and just return day by day result
}

Example Request

ターミナル画面
クリップボードにコピー
curl -H "authorization: your-api-key" \
"https://api.capgo.app/statistics/org/046a36ac-e03c-4590-9257-bd6c9dba9ee8/?from=2024-01-01&to=2024-02-01"

Section titled “GET /statistics/org/:org_id/”

Section titled “Query Parameters”
[
{
"date": "2024-01-01",
"mau": 10000,
"storage": 536870912, // 512MB in bytes
"bandwidth": 1073741824 // 1GB in bytes
},
{
"date": "2024-01-02",
"mau": 10200,
"storage": 537919488, // 513MB in bytes
"bandwidth": 1074790400 // 1.01GB in bytes
}
]

GET /statistics/user/

GET /statistics/user/

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

__CAPGO_KEEP_3__
interface StatsQuery {
from: Date // Start date for the statistics (format: YYYY-MM-DD)
to: Date // End date for the statistics (format: YYYY-MM-DD)
}

GET /statistics/user/

__CAPGO_KEEP_4__
__CAPGO_KEEP_5__
curl -H "authorization: your-api-key" \
"https://api.capgo.app/statistics/user/?from=2024-01-01&to=2024-02-01"

__CAPGO_KEEP_7__

例としての応答
[
{
"date": "2024-01-01",
"mau": 25000,
"storage": 1073741824, // 1GB in bytes
"bandwidth": 2147483648 // 2GB in bytes
},
{
"date": "2024-01-02",
"mau": 25500,
"storage": 1074790400, // 1.01GB in bytes
"bandwidth": 2148532224 // 2.01GB in bytes
}
]

GET /statistics/app/:app_id/bundle_usage

例としての応答

特定のアプリのバンドル使用状況の統計を取得します。使用状況は、指定された期間内にユーザーが使用したバンドル(バージョン)の分布を示します。

クエリ パラメータ

コピー
interface BundleUsageQuery {
from: Date // Start date for the statistics (format: YYYY-MM-DD)
to: Date // End date for the statistics (format: YYYY-MM-DD)
}

ターミナル

コピー
GET /statistics/app/:app_id/bundle_usage
curl -H "authorization: your-api-key" \
"https://api.capgo.app/statistics/app/com.demo.app/bundle_usage?from=2024-01-01&to=2024-02-01"
{
"labels": ["2024-01-01", "2024-01-02", "2024-01-03"],
"datasets": [
{
"label": "1.0.0",
"data": [60.5, 58.2, 55.3]
},
{
"label": "1.0.1",
"data": [39.5, 41.8, 44.7]
}
]
}

一般的なエラーのシナリオとその応答:

// Invalid body
{
"status": "Invalid body",
"error": "Invalid date format or missing parameters"
}
// Permission denied
{
"status": "You can't access this app",
"error": "Insufficient permissions to access statistics"
}
// Permission denied for organization
{
"status": "You can't access this organization",
"error": "Insufficient permissions to access organization statistics"
}
// No organizations found for user statistics
{
"status": "No organizations found",
"error": "No organizations found"
}
// Internal server error
{
"status": "Cannot get app statistics",
"error": "Internal server error message"
}
  1. 成長の追跡: 時間の経過とともにMAUの成長を監視する
  2. リソースの最適化: ストレージと帯域幅の使用状況をトラッキングしてコストを最適化する
  3. Capacity Planning: 将来のリソースのニーズを計画するためのトレンドを使用する
  4. Usage Reports: 利害関係者向けの定期的な使用状況レポートを生成する
  5. Bundle (version) Distribution Analysis: アプリケーション バンドル (バージョン) の使用状況統計とユーザー分布を理解する
  1. Compare Periods: 月間または年間のトレンドを比較する
  2. Track Ratios: ユーザーごとの帯域幅またはアプリごとのストレージを監視する
  3. Set Alerts: 不通常の使用上昇に応じてアラートを設定する
  4. Regular Backups: 過去の分析のために統計を定期的にエクスポートする
  5. Bundle (version) Adoption: バンドルの使用を使用して新しいバンドル (バージョン) の採用率を追跡する

Keep going from Statistics

: 統計から続ける

If you are using Statistics を使用してストレージとファイルの管理を計画する場合、を接続する @capgo/capacitor-data-storage-sqlite @capgo/capacitor-data-storage-sqliteの実装詳細については Capgoで@capgo/capacitor-data-storage-sqliteを使用 Capgoのネイティブ機能として@capgo/capacitor-data-storage-sqliteを使用 @capgo/capacitor-file @capgo/capacitor-fileの実装詳細については Capgoで@capgo/capacitor-fileを使用 Capgoのネイティブ機能として@capgo/capacitor-fileを使用 Capgoで@capgo/capacitor-uploaderを使用 @capgo/capacitor-uploaderの実装詳細については