メインコンテンツへスキップ
GET
/
v2
/
apps
/
{app_id}
/
network
/
analytics
ウェブサイトアナリティクス
curl --request GET \
  --url https://api.squarecloud.app/v2/apps/{app_id}/network/analytics \
  --header 'Authorization: <authorization>'
import requests

url = "https://api.squarecloud.app/v2/apps/{app_id}/network/analytics"

headers = {"Authorization": "<authorization>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};

fetch('https://api.squarecloud.app/v2/apps/{app_id}/network/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.squarecloud.app/v2/apps/{app_id}/network/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: <authorization>"
],
]);

$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.squarecloud.app/v2/apps/{app_id}/network/analytics"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "<authorization>")

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.squarecloud.app/v2/apps/{app_id}/network/analytics")
.header("Authorization", "<authorization>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.squarecloud.app/v2/apps/{app_id}/network/analytics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "response": {
    "visits": [
      { "visits": 1024, "requests": 1247, "bytes": 8421000, "date": "2026-05-21T10:00:00Z" }
    ],
    "countries": [
      { "type": "BR", "visits": 612, "requests": 743, "bytes": 5012000, "date": "2026-05-21T10:00:00Z" }
    ],
    "devices": [
      { "type": "desktop", "visits": 820, "requests": 998, "bytes": 6700000, "date": "2026-05-21T10:00:00Z" }
    ],
    "os": [
      { "type": "Windows", "visits": 540, "requests": 651, "bytes": 4400000, "date": "2026-05-21T10:00:00Z" }
    ],
    "browsers": [
      { "type": "Chrome", "visits": 720, "requests": 870, "bytes": 5800000, "date": "2026-05-21T10:00:00Z" }
    ],
    "protocols": [
      { "type": "HTTP/2", "visits": 900, "requests": 1100, "bytes": 7400000, "date": "2026-05-21T10:00:00Z" }
    ],
    "methods": [
      { "type": "GET", "visits": 850, "requests": 1020, "bytes": 6900000, "date": "2026-05-21T10:00:00Z" }
    ],
    "paths": [
      { "type": "/", "visits": 410, "requests": 498, "bytes": 3320000, "date": "2026-05-21T10:00:00Z" }
    ],
    "referers": [
      { "type": "Direct", "visits": 380, "requests": 462, "bytes": 3100000, "date": "2026-05-21T10:00:00Z" }
    ],
    "providers": [
      { "type": "AS15169 (GOOGLE)", "visits": 210, "requests": 254, "bytes": 1700000, "date": "2026-05-21T10:00:00Z" }
    ],
    "ips": [
      { "type": "203.0.113.45", "visits": 40, "requests": 3120, "bytes": 2100000 }
    ],
    "status_codes": [
      { "type": "200", "visits": 950, "requests": 1180, "bytes": 8100000 }
    ],
    "bots": [
      { "type": "Search Engine Crawler", "visits": 0, "requests": 84, "bytes": 410000 }
    ],
    "content_types": [
      { "type": "json", "visits": 310, "requests": 720, "bytes": 4200000 }
    ]
  }
}
Authorization
string
必須
アカウントの API キーです。これはアカウント設定で確認できます。

パラメータ

app_id
string
必須
アプリケーションの ID。アプリケーションのダッシュボードの URL から確認できます。
start
string
必須
分析ウィンドウの ISO 8601 開始タイムスタンプ。最大保持期間は 7 日間で、開始日時はアプリケーションの作成日にクランプされます。
end
string
必須
ISO 8601 終了タイムスタンプ。start より後である必要があります。

ドリルダウンフィルター

すべてのブレークダウンを一致するトラフィックに絞り込むオプションのフィルター。前回のレスポンスで対応するブレークダウンから返された正確な type の値をそのまま渡してください。フィルターは AND で結合されます。
country
string
単一のクライアント国(2 文字コード)。countries ブレークダウンで返される値。
ip
string
単一のクライアント IP(IPv4/IPv6 の完全一致)。ips ブレークダウンで返される値。
path
string
このプレフィックスで始まるリクエストパス(例: /api/api/* を対象とする)。最大 256 文字。
status
string
単一のエッジレスポンスステータスコード(3 桁)。status_codes ブレークダウンで返される値。
os
string
単一のクライアント OS。os ブレークダウンで返される値。
browser
string
単一のクライアントブラウザ。browsers ブレークダウンで返される値。
protocol
string
単一の HTTP プロトコル。protocols ブレークダウンで返される値。
referer
string
単一のリファラーホスト。referers ブレークダウンで返される値(Direct = リファラーなし)。
provider
string
単一のクライアントネットワーク。providers ブレークダウンで返される値。例: GOOGLE (15169)、単なる ASN 番号、または SQUARE-CLOUD-PLATFORM
content_type
string
単一のレスポンスコンテンツタイプ。content_types ブレークダウンで返される値(Unknown = 未分類)。
bot
string
単一の検証済みボットカテゴリ。bots ブレークダウンで返される値(Unverified = 通常の非ボットトラフィック)。

レスポンス

このルートは、データ転送を最適化するため圧縮形式でレスポンスを送信する場合があります。
status
string
呼び出しが成功したかどうかを示します。成功した場合は success、失敗した場合は error です。
response
object
各ブレークダウンはバケットの配列です。type はディメンションを識別し、visits はユニーク訪問者数、requests はリクエスト数、bytes は提供されたレスポンスのバイト数、date は 15 分ウィンドウの開始時刻です。ipsstatus_codesbotscontent_types の各ブレークダウンはウィンドウ全体の合計(ウィンドウ全体での上位 N 件)であり、date フィールドを持ちません。要求されたウィンドウがアプリケーションの作成日より前に始まる場合は、空のオブジェクト({})を返します。
{
  "status": "success",
  "response": {
    "visits": [
      { "visits": 1024, "requests": 1247, "bytes": 8421000, "date": "2026-05-21T10:00:00Z" }
    ],
    "countries": [
      { "type": "BR", "visits": 612, "requests": 743, "bytes": 5012000, "date": "2026-05-21T10:00:00Z" }
    ],
    "devices": [
      { "type": "desktop", "visits": 820, "requests": 998, "bytes": 6700000, "date": "2026-05-21T10:00:00Z" }
    ],
    "os": [
      { "type": "Windows", "visits": 540, "requests": 651, "bytes": 4400000, "date": "2026-05-21T10:00:00Z" }
    ],
    "browsers": [
      { "type": "Chrome", "visits": 720, "requests": 870, "bytes": 5800000, "date": "2026-05-21T10:00:00Z" }
    ],
    "protocols": [
      { "type": "HTTP/2", "visits": 900, "requests": 1100, "bytes": 7400000, "date": "2026-05-21T10:00:00Z" }
    ],
    "methods": [
      { "type": "GET", "visits": 850, "requests": 1020, "bytes": 6900000, "date": "2026-05-21T10:00:00Z" }
    ],
    "paths": [
      { "type": "/", "visits": 410, "requests": 498, "bytes": 3320000, "date": "2026-05-21T10:00:00Z" }
    ],
    "referers": [
      { "type": "Direct", "visits": 380, "requests": 462, "bytes": 3100000, "date": "2026-05-21T10:00:00Z" }
    ],
    "providers": [
      { "type": "AS15169 (GOOGLE)", "visits": 210, "requests": 254, "bytes": 1700000, "date": "2026-05-21T10:00:00Z" }
    ],
    "ips": [
      { "type": "203.0.113.45", "visits": 40, "requests": 3120, "bytes": 2100000 }
    ],
    "status_codes": [
      { "type": "200", "visits": 950, "requests": 1180, "bytes": 8100000 }
    ],
    "bots": [
      { "type": "Search Engine Crawler", "visits": 0, "requests": 84, "bytes": 410000 }
    ],
    "content_types": [
      { "type": "json", "visits": 310, "requests": 720, "bytes": 4200000 }
    ]
  }
}