> ## Documentation Index
> Fetch the complete documentation index at: https://syteca.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# URL Statistics

> Syteca Data Connector REST API endpoint returning the total time spent visiting each website during each hour of each session.

Returns time spent on each URL broken down by hour and session — useful for "which sites did the user visit during work hours?" style analytics. Same structural shape as [Application statistics](/docs/api/data-connector/endpoints/get-application-statistics), but the `key` field contains a URL instead of an application name.

```http theme={"system"}
GET https://<hostname>/ekranapi/statistics/geturl
```

## Authentication

<ParamField header="ApiKey" type="string" required>
  Your Active API Key from the Management Tool.
</ParamField>

## Query parameters

<ParamField query="start" type="string">
  Sessions that were started or finished **after this time** are included.

  Accepted formats: `2021-04-01`, `2021-04-01T12:00`, `2021-04-01T12:00:00`.
</ParamField>

<ParamField query="end" type="string">
  Sessions that were started or finished **before this time** are included.
</ParamField>

<Note>
  If both `start` and `end` are omitted, statistics for all sessions in the database are returned. See [Time parameter conventions](/docs/api/data-connector/api-reference#time-parameter-conventions) for full rules.
</Note>

## Response (200 OK)

<ResponseField name="data" type="array">
  Array of per-URL time records for this `(session, hour)`:

  <Expandable title="Per-URL record">
    <ResponseField name="duration" type="timespan">
      Total time spent on this URL during this hour of this session.
    </ResponseField>

    <ResponseField name="key" type="string">
      The URL of the website visited (e.g. `help.com`, `new.net`).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="sessionId" type="int32">
  The ID of the session this block belongs to.
</ResponseField>

<ResponseField name="timeOfDay" type="date-time">
  The hour of the day.
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X GET "https://<hostname>/ekranapi/statistics/geturl?start=2021-09-01&end=2021-09-02" \
    -H "ApiKey: xJ)tsCNcpj)l+]}(@_|lt!t………"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={"system"}
  [
    {
      "data": [
        {
          "duration": "00:02:50.3010000",
          "key": "help.com"
        },
        {
          "duration": "00:02:50.3010000",
          "key": "new.net"
        }
      ],
      "sessionId": 134,
      "timeOfDay": "2021-09-01T17:00:00+03:00"
    },
    {
      "data": [
        {
          "duration": "01:02:50.3010000",
          "key": "test.com"
        },
        {
          "duration": "00:01:00.3010000",
          "key": "blog"
        }
      ],
      "sessionId": 431,
      "timeOfDay": "2022-02-01T17:00:00+07:00"
    }
  ]
  ```
</ResponseExample>

<Note>
  URL monitoring must be enabled on the Client for it to record URL data — see [user activity recording parameters](/docs/session-monitoring/recording/user-activity-recording). Sessions without URL monitoring enabled won't return URL records here.
</Note>

## Errors

See [Status codes](/docs/api/data-connector/api-reference#status-codes). Common errors:

* **400 Bad Request** — invalid `start` or `end` format.
* **403 Forbidden** — Data Connector not registered.

## Related

<CardGroup cols={2}>
  <Card title="Application statistics" icon="app-window" href="/docs/api/data-connector/endpoints/get-application-statistics">
    Same shape, but for applications instead of URLs.
  </Card>

  <Card title="User productivity" icon="user-check" href="/docs/api/data-connector/endpoints/get-user-productivity">
    Aggregate active time per user per hour.
  </Card>

  <Card title="List sessions with productivity" icon="bar-chart-3" href="/docs/api/data-connector/endpoints/post-sessions">
    Session-level duration and productivity.
  </Card>

  <Card title="API reference" icon="square-code" href="/docs/api/data-connector/api-reference">
    Base URL, authentication, status codes.
  </Card>
</CardGroup>
