---
title: List recent events for the Logs Explorer
description: List recent events for the Logs Explorer
product: general
token_estimate: 1911
---
# List recent events for the Logs Explorer

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## List recent events for the Logs Explorer

**GET** `/console/v1/logs`

Full URL: `https://statsigapi.net/console/v1/logs`

List recent events for the Logs Explorer

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| query (query) | string | No | service:console AND @status:error | Logs Explorer filter syntax (same as the console filter bar), e.g. `service:console AND @status:error` or `event_name:add_to_cart`. Do not start the filter with `#`; use the `source` param to choose logs, events, or spans. Constraints: min length: 1 |
| source (query) | string | No | logs | Data source for `query`. Default: `logs`. Use `events` for custom events or `spans` for traces. Allowed values: logs, events, spans |
| columns (query) | string | No | timestamp,user.service,metadata.body,value | Comma-separated Logs Explorer column ids to include in each row's `fields` map (e.g. `timestamp`, `user.service`, `metadata.body`, `custom_id:my_id_type`, `rule`). Constraints: min length: 1 |
| start_ts (query) | integer | No | 1736208000000 | Start of the time window, in milliseconds since epoch. Defaults to one hour before `end_ts` when omitted. Constraints: min: 0 |
| end_ts (query) | integer | No | 1736294400000 | End of the time window, in milliseconds since epoch. Defaults to the current time when omitted. Constraints: min: 0 |
| limit (query) | integer | No | 100 | Maximum number of events to return. Default: 100. Max: 1000. Constraints: min: 0 |
| after (query) | string | No | — | Opaque cursor from `pagination.next_cursor` in a previous response. Pass it back verbatim as `after` to fetch the next page. Cursors deeper than 100000 rows are rejected with a 400; narrow the time window with `start_ts`/`end_ts` instead of paginating deeper. Constraints: min length: 1 |

## Response (application/json)

**200** — Paginated event feed

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object[] | Yes | — | — |
| data.id | string | Yes | — | Stable identifier for the event. Used internally to derive pagination cursors. |
| data.timestamp | string | Yes | — | When the event occurred (ISO 8601). Null when unavailable. Constraints: nullable |
| data.event_name | string | Yes | — | Name of the event, e.g. "add_to_cart". Constraints: nullable |
| data.user_id | string | Yes | — | User ID associated with the event, when present. Constraints: nullable |
| data.value | string | Yes | — | Free-form value attached to the event. Constraints: nullable |
| data.sdk_type | string | Yes | — | SDK that emitted the event, e.g. "javascript-client". Constraints: nullable |
| data.sdk_version | string | Yes | — | SDK version string. Constraints: nullable |
| data.fields | object | No | — | Present when the `columns` query param is set. Maps each requested column id to its string value. |
| pagination | object | Yes | — | Opaque cursor pagination metadata. |
| pagination.next_cursor | string | Yes | — | Constraints: nullable |
| pagination.has_more | boolean | Yes | — | — |
| columns | string[] | No | — | Echoes the column ids requested via the `columns` query param, in order. |

```json
{
  "message": "Logs listed successfully.",
  "data": [
    {
      "id": "1736208000000||abc123||add_to_cart",
      "timestamp": "2025-01-06T16:00:00.000Z",
      "event_name": "add_to_cart",
      "user_id": "user_1",
      "value": "1",
      "sdk_type": "js-client",
      "sdk_version": "4.0.0"
    },
    {
      "id": "1736207999000||def456||add_to_cart",
      "timestamp": "2025-01-06T15:59:59.000Z",
      "event_name": "add_to_cart",
      "user_id": "user_2",
      "value": null,
      "sdk_type": "js-client",
      "sdk_version": "4.0.0"
    }
  ],
  "pagination": {
    "next_cursor": "eyJpbmRleCI6Mn0",
    "has_more": true
  }
}
```

## Code samples

### cURL

```bash
curl -X GET "https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/logs?query=service%3Aconsole+AND+%40status%3Aerror&source=logs&columns=timestamp%2Cuser.service%2Cmetadata.body%2Cvalue&start_ts=1736208000000&end_ts=1736294400000&limit=100")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

