Skip to main content
Session retrieval is now available in both the Python and TypeScript client SDKs. You can fetch individual sessions by ID or list all sessions for a project — with automatic pagination, async support, and DataFrame export built in.

Python

The client.sessions resource adds three methods:
  • get(session_id) — Fetch a single session with all its traces
  • list(project_name, limit) — List sessions for a project with automatic pagination
  • get_sessions_dataframe(project_name) — Return sessions as a pandas DataFrame
from phoenix.client import Client

client = Client()

# Get a session
session = client.sessions.get(session_id="my-session-id")

# List recent sessions
sessions = client.sessions.list(project_name="my-chatbot", limit=10)

# Analyze in pandas
df = client.sessions.get_sessions_dataframe(project_name="my-chatbot")
Async variants are available on AsyncClient with the same interface.

TypeScript

Two new functions are exported from @arizeai/phoenix-client/sessions:
  • getSession({ sessionId }) — Fetch a single session with all its traces
  • listSessions({ projectName }) — List all sessions for a project with automatic pagination
import { getSession, listSessions } from "@arizeai/phoenix-client/sessions";

const session = await getSession({ sessionId: "my-session-id" });
const sessions = await listSessions({ projectName: "my-chatbot" });

Return Types

Both SDKs return the same shape: each session includes sessionId, projectId, startTime, endTime, and a traces array. Each trace contains traceId, startTime, and endTime.