## GET /api/v2/shared-hosting/{accountId}/traffic

**Read who requested what on a website**

Read what reached one website on a web hosting account in the last hours, from the website's own access log on the server. `senders` lists who asked (search engines, AI crawlers, link previews, monitoring, visitors), with the paths each one requested, how the server answered and any per-site limit that applies. `answers` lists each HTTP status with the paths behind it and who asked for them. `crawlerLimits` is the server's list of per-site crawler limits, and `serverFilter` is what the server's own filter stopped on the domain, by reason. Requests the CDN stopped or answered from its cache are not counted, and a subdomain is a website of its own that you read by its own name. Paths are returned without their query string, with the names of the most used parameters; parameter values, visitor addresses and user agents are never returned. A result is reused for up to five minutes.

### Related Endpoints

- `GET /api/v2/shared-hosting/{accountId}`: Get a web hosting account
- `PATCH /api/v2/shared-hosting/{accountId}`: Rename a web hosting account
- `GET /api/v2/shared-hosting/{accountId}/php`: Get PHP versions per website

### Headers

- `Authorization`: Bearer $HOSTUP_API_KEY
- Scopes: `read:hosting`, `console:services`

### Parameters

- `accountId` (path, string, required): The web hosting account ID (`acct_…`). Example: `acct_01hxa3b4c5d6e7f8g9h0j1k2m3`
- `domain` (query, string, required): A domain on the account. `www.` is ignored. Example: `example.com`
- `hours` (query, integer) [min: 1, max: 48]: How many hours back to read, 1 to 48. Default 24. `coveredFrom` shows how far back the answer reaches. The server empties its logs once a day and reads the time before that from the account's log archive, so an account that has switched log archiving off in cPanel only gets the time since the last emptying.

### Request Example

```bash
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/traffic?domain=example.com" \
  -H "Authorization: Bearer $HOSTUP_API_KEY"
```

### Response Schema

- `domain` (string, required) Example: `example.com`
- `windowHours` (integer, required) Example: `24`
- `coveredFrom` (string, required, nullable): The first request in the window.
- `coveredTo` (string, required, nullable): The last request in the window.
- `partial` (boolean, required): True when the log was too large to read in full. The counts are then a floor.
- `sharedLogDomain` (string, required, nullable): Set when the domain is an alias that shares its log with another domain. The numbers then cover both.
- `totalRequests` (integer, required)
- `statusMix` (object, required): HTTP status → number of requests.
- `hourStartsAt` (string, required, nullable): Start of the first bucket in each sender's `hourly`.
- `senders` (array<object>, required): The 20 senders with the most requests.
- `senders[].id` (string, required): Stable key, for example `Googlebot`, `browser` (visitors in web browsers), `other-bot` (crawlers without a known name) or `empty-user-agent`. Example: `Googlebot`
- `senders[].name` (string, required) Example: `Googlebot`
- `senders[].kind` (string, required)
  Allowed values: search, ai, seo, social, monitoring, site, script, visitors, other_crawlers, unnamed
- `senders[].requests` (integer, required)
- `senders[].refused` (integer, required): Requests answered 429 because a per-site limit was passed.
- `senders[].statusMix` (object, required): HTTP status → number of requests.
- `senders[].hourly` (array<integer>, required): Requests per hour, starting at `hourStartsAt`.
- `senders[].limitPerMinute` (integer, required, nullable): The per-site limit for this sender in requests per minute. `null` when no limit applies, `0` when every request is refused.
- `senders[].paths` (array<object>, required): The most requested paths, at most 25.
- `senders[].paths[].method` (string, required) Example: `GET`
- `senders[].paths[].path` (string, required): The path without its query string. Example: `/shop/`
- `senders[].paths[].requests` (integer, required)
- `senders[].paths[].variants` (integer, required): How many different query strings were used on this path.
- `senders[].paths[].variantsCapped` (boolean, required): True when `variants` reached the counting cap of 2,000.
- `senders[].paths[].queryKeys` (array<string>, required): The most used query parameter names. Values are never returned.
- `senders[].paths[].statusMix` (object, required): HTTP status → number of requests.
- `answers` (array<object>, required): The eight most common HTTP statuses.
- `answers[].status` (integer, required) Example: `404`
- `answers[].requests` (integer, required)
- `answers[].paths` (array<object>, required): The most requested paths with this answer, at most 15.
- `answers[].paths[].method` (string, required)
- `answers[].paths[].path` (string, required)
- `answers[].paths[].requests` (integer, required)
- `answers[].paths[].senders` (array<object>, required)
- `answers[].paths[].senders[].id` (string, required)
- `answers[].paths[].senders[].name` (string, required)
- `answers[].paths[].senders[].requests` (integer, required)
- `crawlerLimits` (object, required)
- `crawlerLimits.available` (boolean, required): False when the server's limit list could not be read.
- `crawlerLimits.limits` (array<object>, required)
- `crawlerLimits.limits[].name` (string, required) Example: `GPTBot`
- `crawlerLimits.limits[].perMinute` (integer, required): Requests per site per minute. `0` means refused. Example: `20`
- `serverFilter` (object, required)
- `serverFilter.available` (boolean, required)
- `serverFilter.total` (integer, required): Requests the server's own filter stopped on the domain in the window.
- `serverFilter.partial` (boolean, required): True when there were more incidents than are read in one call.
- `serverFilter.rules` (array<object>, required)
- `serverFilter.rules[].name` (string, required) Example: `WordPress login attempt blocked`
- `serverFilter.rules[].incidents` (integer, required)

### Responses

#### 200 - The website's traffic for the window.
```json
{
  "domain": "example.com",
  "windowHours": 24,
  "coveredFrom": "2026-11-18T10:17:00.000Z",
  "coveredTo": "2026-11-19T10:16:00.000Z",
  "partial": false,
  "sharedLogDomain": null,
  "totalRequests": 2988,
  "statusMix": {
    "200": 2079,
    "404": 97,
    "429": 812
  },
  "hourStartsAt": "2026-11-18T10:17:00.000Z",
  "senders": [
    {
      "id": "GPTBot",
      "name": "GPTBot",
      "kind": "ai",
      "requests": 2940,
      "refused": 812,
      "statusMix": {
        "200": 2031,
        "404": 97,
        "429": 812
      },
      "hourly": [
        60,
        72,
        84,
        96,
        120,
        180,
        260,
        320,
        280,
        200,
        140,
        100,
        80,
        70,
        66,
        64,
        62,
        60,
        60,
        58,
        58,
        56,
        48,
        46
      ],
      "limitPerMinute": 20,
      "paths": [
        {
          "method": "GET",
          "path": "/shop/",
          "requests": 1128,
          "variants": 1128,
          "variantsCapped": false,
          "queryKeys": [
            "filter_cat",
            "orderby",
            "filter_color"
          ],
          "statusMix": {
            "200": 402,
            "429": 726
          }
        }
      ]
    },
    {
      "id": "Googlebot",
      "name": "Googlebot",
      "kind": "search",
      "requests": 48,
      "refused": 0,
      "statusMix": {
        "200": 48
      },
      "hourly": [
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        2
      ],
      "limitPerMinute": null,
      "paths": [
        {
          "method": "GET",
          "path": "/product/winter-jacket/",
          "requests": 38,
          "variants": 1,
          "variantsCapped": false,
          "queryKeys": [],
          "statusMix": {
            "200": 38
          }
        }
      ]
    }
  ],
  "answers": [
    {
      "status": 429,
      "requests": 812,
      "paths": [
        {
          "method": "GET",
          "path": "/shop/",
          "requests": 726,
          "senders": [
            {
              "id": "GPTBot",
              "name": "GPTBot",
              "requests": 726
            }
          ]
        }
      ]
    }
  ],
  "crawlerLimits": {
    "available": true,
    "limits": [
      {
        "name": "GPTBot",
        "perMinute": 20
      }
    ]
  },
  "serverFilter": {
    "available": true,
    "total": 33,
    "partial": false,
    "rules": [
      {
        "name": "WordPress login attempt blocked",
        "incidents": 33
      }
    ]
  }
}
```

#### 400 - `domain` is missing or not a domain name, or `hours` is not between 1 and 48 (`invalid_request`).
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/name",
      "detail": "`name` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 401 - Unauthorized. Authentication is required.
```json
{
  "type": "https://developer.hostup.se/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication is required.",
  "code": "unauthorized",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 403 - The key lacks a scope or the account is not active. `domain_not_owned`: the domain is not on this account.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/name",
      "detail": "`name` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 404 - The domain is not a website on this account, or its traffic could not be read right now (`not_found`).
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/name",
      "detail": "`name` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 409 - The account is not on cPanel (`account_not_eligible_cpanel`).
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/name",
      "detail": "`name` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Rate limit exceeded. Please try again later.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 502 - The hosting server does not provide per-sender traffic, or could not be reached (`upstream_failed`).
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Validation failed",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/name",
      "detail": "`name` is required.",
      "code": "invalid_request"
    }
  ]
}
```
