Skip to main content
This example runs two tasks in the same browser session. The first finds a fact. The second uses that fact to find a source. Both return validated JSON.
  • You create the session yourself and pass its id to each task, so the second task starts where the first one stopped.
  • The second prompt is built from the first result.
Before you run it, set ANCHORBROWSER_API_KEY and install the SDK. The Node.js version also needs zod 4, and the Python version needs pydantic.

Output

Both scripts on this page were run against the live API on November 27, 2026. This is the output of one of those runs. Your values will differ.

Notes

  • Two runs found different articles about the same game. Treat the second result as one valid source, not the only one.
  • The output above shows the two results together. The code prints them one after the other.
  • The task result is checked: a status other than success raises an error instead of printing a failure as if it worked.
  • The session is ended in a finally block. A task does not end the session it runs in.