> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jo-inc/camofox-browser/llms.txt
> Use this file to discover all available pages before exploring further.

# Get tab statistics

> Retrieve usage statistics and metadata for a specific tab

## GET /tabs/:id/stats

Returns detailed statistics about a tab's activity, including tool call count, visited URLs, and session information.

## Authentication

Requires `userId` as a query parameter. Returns 404 if the tab doesn't exist or belongs to a different user.

## Request

### Path parameters

<ParamField path="id" type="string" required>
  The `tabId` returned when creating the tab via `POST /tabs`.
</ParamField>

### Query parameters

<ParamField query="userId" type="string" required>
  User identifier. Must match the user who owns the tab.
</ParamField>

## Response

<ResponseField name="tabId" type="string">
  UUID identifier for the tab.
</ResponseField>

<ResponseField name="sessionKey" type="string">
  Session key (task/conversation group) this tab belongs to.
</ResponseField>

<ResponseField name="listItemId" type="string">
  **Deprecated.** Same as `sessionKey`. Included for backward compatibility.
</ResponseField>

<ResponseField name="url" type="string">
  Current URL of the tab.
</ResponseField>

<ResponseField name="visitedUrls" type="array">
  Array of all URLs visited in this tab (chronological order). Includes URLs from navigation, clicks, and redirects.
</ResponseField>

<ResponseField name="toolCalls" type="number">
  Number of API operations performed on this tab. Includes navigate, click, type, scroll, snapshot, and other actions.
</ResponseField>

<ResponseField name="refsCount" type="number">
  Number of interactive element references currently available on the page. Refs are generated by `/snapshot` and reset on navigation.
</ResponseField>

## Example

```bash theme={null}
curl http://localhost:9377/tabs/f47ac10b-58cc-4372-a567-0e02b2c3d479/stats?userId=agent1
```

**Response:**

```json theme={null}
{
  "tabId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "sessionKey": "task123",
  "listItemId": "task123",
  "url": "https://example.com/page2",
  "visitedUrls": [
    "https://example.com",
    "https://example.com/page1",
    "https://example.com/page2"
  ],
  "toolCalls": 7,
  "refsCount": 42
}
```

## Error responses

| Status | Error                 | Cause                                                       |
| ------ | --------------------- | ----------------------------------------------------------- |
| 400    | `userId required`     | Missing `userId` query parameter                            |
| 404    | `Tab not found`       | Tab doesn't exist, was closed, or belongs to different user |
| 500    | Internal server error | Tab state retrieval failure                                 |

## Notes

* Tool calls increment on every API operation: navigate, snapshot, click, type, scroll, back, forward, refresh, links, and press
* Visited URLs are tracked in a Set (duplicates removed) and returned as an array
* `refsCount` reflects the number of interactive elements (buttons, links, inputs) on the current page
* Refs reset to 0 after navigation until the next `/snapshot` call
* Tab not found errors occur if:
  * The tab was explicitly closed via `DELETE /tabs/:id`
  * The tab's session expired (30 minutes of inactivity)
  * The `userId` doesn't match the tab owner
