Back to changelog

Trace API for agents

Currents has a trace API made for agents. Instead of downloading a Playwright trace, an agent reads it one part at a time and picks each next call from what it just read.

Trace API for agents

Currents now has a trace API, made for agents. A Playwright trace is a zip of several megabytes with every action, the page after each action, every network request and the screen. Instead of downloading it, an agent asks the trace API for one part at a time: the summary first, then only what the summary points to.

Each answer is small, so the agent spends few tokens and picks its next call from what it just read. Here an agent finds why a checkout freezes:

A terminal agent and the trace API exchange four calls: the summary, the network requests, the page right after the error, and the screen at the end. The agent then names the cause.
Four calls and about 1,600 tokens. Every file in the trace together is about 20,000.

The trace API returns any part of the trace:

  • Steps — each action with its time, the failed action and its error, page errors, console errors and failed requests
  • DOM snapshots — the page at any moment, as text, as the accessibility tree, or as HTML that opens in a browser
  • Network requests — filter by status, URL or request body, then read the body the page sent and the response
  • Frames — the screen at the failure or at any time
  • Filmstrip — frames of the run in one image, up to the failure
  • Animation — the recording as a GIF or WebP, rendered when you ask for it
  • Files — the files the test saved in the trace, such as Playwright's error context
Three frames of the checkout in one row: save10 typed into the discount field with a total of $229.50, then the same, then outlined in red: SAVE10 applied: 10% off, a discount of −$22.95 and a total of $183.60
/filmstrip?end=failure&layout=row: the failed test up to the failure
The checkout page rebuilt from the DOM snapshot at the failure: save10 in the discount field, SAVE10 applied: 10% off, a discount of −$22.95 and a total of $183.60
/snapshots/failure?format=html: the page when the test failed, opened in a browser

Every Playwright trace in Currents, from a CI test or a session, has a trace API link. The link is public: an agent opens it without a Currents login or an API key. Get one from:

Learn more: