M365 Copilot Chat Exporter

Export Microsoft 365 Copilot conversations as ChatGPT-compatible conversations.json

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

نووسەر
ingo
Daily installs
1
Total installs
61
Ratings
1 0 0
وەشان
4.4
Created
2026-02-07
Updated
2026-02-07
Size
30.3 KB
مۆڵەت
MIT
Applies to

M365 Copilot Chat Exporter

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.

Features

  • Fetch All — bulk-fetches every Copilot conversation via the Substrate API (paginated, handles hundreds of chats)
  • ChatGPT-compatible export — outputs conversations.json in 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

How it works

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.

Installation

  1. Install Tampermonkey (or a compatible userscript manager)
  2. Install the script from Greasy Fork or create a new userscript and paste the contents of copilot_chat_capture.user.js

Usage

  1. Navigate to m365.cloud.microsoft/chat
  2. A floating panel appears in the bottom-right corner
  3. (Optional) Select a date range to limit which conversations are fetched
  4. Click Fetch All Conversations — the script paginates through your chat list and fetches each conversation's content
  5. Click Export conversations.json to download

Limitations

  • The Substrate API returns at most ~500 recent conversations via the GetChats pagination 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

Acknowledgements

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.