JavaScript
const options = {method: 'GET', headers: {'X-Browser-Use-API-Key': '<api-key>'}}; fetch('https://api.browser-use.com/api/v3/sessions/{session_id}/messages', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
{ "messages": [ { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "role": "<string>", "data": "<string>", "createdAt": "2023-11-07T05:31:56Z", "type": "", "summary": "", "screenshotUrl": "<string>", "hidden": false } ], "hasMore": true }
Return messages for a session with cursor-based pagination (chronological order).
Cursor: return messages after this message ID
Cursor: return messages before this message ID
Maximum number of messages to return (max 100).
1 <= x <= 100
Successful Response
List of messages in chronological order.
Show child attributes
Whether there are more messages available beyond this page. Use cursor-based pagination with the after or before query parameters to fetch more.
after
before
Was this page helpful?