Zum Hauptinhalt springen
GET
/
v2
/
apps
/
{app_id}
/
network
/
analytics
Website-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
erforderlich
Der API-Schlüssel für Ihr Konto. Sie finden ihn in Ihren Kontoeinstellungen.

Parameter

app_id
string
erforderlich
Die ID der Anwendung. Du findest sie in der URL des Dashboards deiner Anwendung.
start
string
erforderlich
ISO-8601-Startzeitstempel für den Analysezeitraum. Der maximale Aufbewahrungszeitraum beträgt 7 Tage; der Startwert wird auf das Erstellungsdatum der Anwendung begrenzt.
end
string
erforderlich
ISO-8601-Endzeitstempel. Muss nach start liegen.

Drilldown-Filter

Optionale Filter, die jede Aufschlüsselung auf den passenden Traffic einschränken. Gib den exakten type-Wert zurück, der von der entsprechenden Aufschlüsselung in einer vorherigen Antwort geliefert wurde. Filter werden kombiniert (AND).
country
string
Ein einzelnes Client-Land (2-stelliger Code), wie in der countries-Aufschlüsselung geliefert.
ip
string
Eine einzelne Client-IP (exakter IPv4-/IPv6-Treffer), wie in der ips-Aufschlüsselung geliefert.
path
string
Anfragepfade, die mit diesem Präfix beginnen (z. B. deckt /api auch /api/* ab). Maximal 256 Zeichen.
status
string
Ein einzelner Edge-Antwortstatuscode (3 Ziffern), wie in der status_codes-Aufschlüsselung geliefert.
os
string
Ein einzelnes Client-Betriebssystem, wie in der os-Aufschlüsselung geliefert.
browser
string
Ein einzelner Client-Browser, wie in der browsers-Aufschlüsselung geliefert.
protocol
string
Ein einzelnes HTTP-Protokoll, wie in der protocols-Aufschlüsselung geliefert.
referer
string
Ein einzelner Referer-Host, wie in der referers-Aufschlüsselung geliefert (Direct = kein Referer).
provider
string
Ein einzelnes Client-Netzwerk, wie in der providers-Aufschlüsselung geliefert — z. B. GOOGLE (15169), eine reine ASN-Nummer oder SQUARE-CLOUD-PLATFORM.
content_type
string
Ein einzelner Antwort-Content-Type, wie in der content_types-Aufschlüsselung geliefert (Unknown = nicht klassifiziert).
bot
string
Eine einzelne Kategorie verifizierter Bots, wie in der bots-Aufschlüsselung geliefert (Unverified = regulärer Nicht-Bot-Traffic).

Antwort

Diese Route kann eine Antwort in komprimiertem Format senden und so die Datenübertragung optimieren.
status
string
Gibt an, ob der Aufruf erfolgreich war. success bei Erfolg, error andernfalls.
response
object
Jede Aufschlüsselung ist ein Array von Buckets. type identifiziert die Dimension, visits sind eindeutige Besucher, requests ist die Anzahl der Anfragen, bytes sind die ausgelieferten Antwort-Bytes und date ist der Beginn des 15-Minuten-Fensters. Die Aufschlüsselungen ips, status_codes, bots und content_types sind Fenstersummen (Top-N über das gesamte Fenster) und enthalten kein date-Feld. Liefert ein leeres Objekt ({}), wenn das angeforderte Fenster vor dem Erstellungsdatum der Anwendung beginnt.
{
  "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 }
    ]
  }
}