Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Get a space's analytics

Returns traffic analytics for one space over a bounded time window.

GET/v1/spaces/{spaceId}/analytics
Authorization
AuthorizationBearer token · headerrequired

Space key (sfc_…) for an unclaimed anonymous Space. Also the fragment of its claim URL and the token of its /__/<key> door. A publish without a credential returns it in claim with the claim link. With the key, getSpace extends the Space's expiry window, getSpaceVersion follows its publish, createSpaceOpenLink returns its reusable open link, and restoreSpace undoes a deleteSpace while the claim window remains open.

or
AuthorizationBearer token · headerrequired

Better Auth session, OAuth access token, OAuth client-credentials token, or sfm_ Space machine credential.

Path parameters
spaceIdstringrequired
min length 1
Query parameters
windowstring

Analytics summary window. Defaults to "7d".

Allowed:48h7d30d
Responses
200

Response for status 200

$schemastring<uri>

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

dataobjectrequired
Show properties
spaceIdstringrequired

The space id the traffic was aggregated for.

windowstringrequired

Resolved summary window.

Allowed:48h7d30d
sincestringrequired

Window start (ISO 8601).

untilstringrequired

Window end (ISO 8601).

granularitystringrequired

Series bucket size: hourly for the 48h window, daily otherwise.

Allowed:hourlydaily
viewsnumberrequired

Successful non-crawler requests (status < 400, assets included) over the window.

bandwidthBytesnumberrequired

Total response bytes in the window.

visitorsByDayobject[]required

Daily unique-visitor estimates. Daily is the provider's finest uniques resolution, and uniques are never summed across days.

Show properties
Array of object
datestringrequired

UTC day (ISO 8601).

visitorsnumberrequired
topPathsobject[]required

Most-viewed paths, capped at 10.

Show properties
Array of object
pathstringrequired
viewsnumberrequired
topHostsobject[]required

Most-viewed hostnames, capped at 10.

Show properties
Array of object
hoststringrequired
viewsnumberrequired
seriesobject[]required

Time series across the window.

Show properties
Array of object
bucketstringrequired

Bucket start (ISO 8601).

requestsnumberrequired
viewsnumberrequired
bandwidthBytesnumberrequired
default

Problem details (RFC 9457). Any 4xx/5xx response is one application/problem+json document.

$schemastring<uri>

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

typestringrequired

Problem type URI resolving to the error docs page. The server derives it mechanically from code against the docs origin.

titlestringrequired

Short human-readable summary of the problem type. The server derives it mechanically from code.

statusintegerrequired

HTTP status code of this response, repeated in the body.

min -9007199254740991 · max 9007199254740991
detailstringrequired

Human-readable failure explanation for this occurrence.

codestringrequired

Stable snake_case error code naming the failed public contract.

pointerstring

RFC 6901 JSON Pointer into the failing request field, for example "/files/37/path", on validation failures.

detailsobject

Machine-readable context for the error code.

fixstring

One sentence on what to do about this error code, the same text as the type page. Read it before retrying.

suggestionsstring[]

Actionable recovery steps safe to show in dashboards, SDKs, and CLI output.

nextstring[]

Copy-pasteable commands or API requests an agent can run next.

requestIdstringrequired

The request id to quote when contacting support.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.spacefast.com/v1/spaces/string/analytics' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "$schema": "http://example.com",
  "data": {
    "spaceId": "string",
    "window": "48h",
    "since": "string",
    "until": "string",
    "granularity": "hourly",
    "views": 0,
    "bandwidthBytes": 0,
    "visitorsByDay": [
      {
        "date": "string",
        "visitors": 0
      }
    ],
    "topPaths": [
      {
        "path": "string",
        "views": 0
      }
    ],
    "topHosts": [
      {
        "host": "string",
        "views": 0
      }
    ],
    "series": [
      {
        "bucket": "string",
        "requests": 0,
        "views": 0,
        "bandwidthBytes": 0
      }
    ]
  }
}

Was this page helpful?