Export Microsoft 365 Copilot conversations as ChatGPT-compatible conversations.json.
A Tampermonkey userscript that bulk-exports your Copilot Chat history from m365.cloud.microsoft/chat into the same JSON format as a ChatGPT data export, so it works with any tool that reads ChatGPT exports.
- Fetch All — bulk-fetches every Copilot conversation via the Substrate API (paginated, handles hundreds of chats)
- ChatGPT-compatible export — outputs
conversations.jsonin the same format as a ChatGPT data export - Date range filter — filter by Today, Last 7 days, Last 30 days, Last year, or a custom date range before fetching/exporting
- Raw API export — optionally export the raw Substrate API responses for debugging or custom processing
- Passive capture — also captures conversations as you browse them normally, no fetch required
- Minimize panel — collapse the floating panel to just an icon when not in use, click the icon to expand it again
- No external dependencies — single self-contained userscript, no build step, no server
The script reads your existing MSAL authentication token from the browser's localStorage (the same token Microsoft 365 already has) and calls the Substrate API endpoints that the Copilot Chat UI itself uses. No additional login or Azure AD app registration is required.
- Install Tampermonkey (or a compatible userscript manager)
- Install the script from Greasy Fork or create a new userscript and paste the contents of
copilot_chat_capture.user.js
- Navigate to m365.cloud.microsoft/chat
- A floating panel appears in the bottom-right corner
- (Optional) Select a date range to limit which conversations are fetched
- Click Fetch All Conversations — the script paginates through your chat list and fetches each conversation's content
- Click Export conversations.json to download
- The Substrate API returns at most ~500 recent conversations via the
GetChatspagination endpoint - Requires an active Microsoft 365 Copilot session (the script reuses your existing browser auth)
- If your MSAL token expires mid-fetch, refresh the page and try again
Hat tip to M365 Copilot Exporter by ganyuke — the MSAL token decryption approach and Substrate API request format were adapted from that project. This script differs by outputting ChatGPT-compatible conversations.json (instead of raw per-conversation JSON files), adding date range filtering, and running as a single zero-dependency userscript.
Below is a screenshot of the floating panel added by the script:
The panel can be minimized to just an icon:

