Archive and export your AI chat conversations as JSON and Markdown.
Project description
open-export
Download and archive all your ChatGPT conversations as JSON and Markdown files.
BEFORE YOU USE THIS TOOL, READ THIS.
Why does this tool exist? ChatGPT does not provide an API to export your conversation history. The built-in "Export data" feature emails you a zip file hours later and cannot be automated. Many users on enterprise, university, or managed accounts have this option disabled entirely. This tool gives you a way to programmatically back up your own conversations.
How does it work? It connects to your browser through the Chrome DevTools Protocol (CDP). You open your browser with a special flag (
--remote-debugging-port=9222), and the tool reads your ChatGPT data through that browser session. It never sees your password or login credentials.What is the risk? While port 9222 is open, any program running on your computer can access your browser session -- your cookies, your tabs, your logged-in accounts. This is the same mechanism used by browser developer tools, but it also means malicious software on your machine could exploit it.
How to stay safe:
- Only run this tool on a machine you trust
- Do not run untrusted software while port 9222 is open
- Close your browser completely as soon as the export finishes -- this kills the debugging port
- Review the source code yourself: the entire tool is ~400 lines across 4 Python files — view source on GitHub
Installation
pip install open-export
Usage
1. Close all browser windows
Fully quit your browser first (check the system tray on Windows). The debugging flag is ignored if the browser is already running.
2. Relaunch with remote debugging enabled
Edge (Windows):
& "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222
Chrome (Windows):
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
Chrome (macOS/Linux):
google-chrome --remote-debugging-port=9222
3. Log into ChatGPT
Navigate to chatgpt.com in that browser window and make sure you're logged in.
4. Run the exporter
open-export -o ./my_chats
Or:
python -m open_export.cli -o ./my_chats
5. Close your browser
Once the export finishes, close all browser windows immediately to shut down the debugging port.
Options
| Option | Default | Description |
|---|---|---|
--output, -o |
./open_export_output |
Output directory |
--cdp-url |
http://localhost:9222 |
Chrome DevTools Protocol URL |
--delay |
1.0 |
Seconds between API requests |
--page-size |
100 |
Conversations per page |
--verbose, -v |
off | Debug logging |
--version |
Show version |
Output
my_chats/
json/ # Raw API responses (one file per conversation)
markdown/ # Human-readable formatted conversations
How it works
- Connects to your running browser via CDP (
connect_over_cdp) - Finds an open ChatGPT tab (or navigates to one)
- Fetches an access token from ChatGPT's session endpoint
- Paginates through the conversation list API
- Downloads each conversation's full data
- Exports as JSON (raw) and Markdown (readable)
The access token is used only during the session and cleared from memory on exit. No credentials are stored on disk.
Security details
- No network calls are made to any server other than
chatgpt.com. The tool writes files locally and does not transmit your data anywhere. - Fully open source. Every line of code is in this repository.
- Access tokens are ephemeral. The token is fetched from ChatGPT's own session endpoint, used for the download, and cleared from memory on exit. It is never written to disk or logged.
- No credentials stored. The tool does not ask for, store, or transmit your username or password.
Development
pip install -e ".[dev]"
pytest tests/ -v
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_export-0.1.5.tar.gz.
File metadata
- Download URL: open_export-0.1.5.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72d8baca69fc04917ee7a36c82fd0e6b659dd20f2e81ede372be5a02116a0c31
|
|
| MD5 |
e96bdacf9cc00b88c17b4b21be9997a6
|
|
| BLAKE2b-256 |
f534d7d6ae1fc3c495c29d8407fd71e59a4c7ffa64b8111eacca2a54230cee22
|
File details
Details for the file open_export-0.1.5-py3-none-any.whl.
File metadata
- Download URL: open_export-0.1.5-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e733c926189baa5e56af841c499cc0330742882836bba821f43c6c711436226f
|
|
| MD5 |
09c570d44d89d35ca4b688b028bdc1d9
|
|
| BLAKE2b-256 |
55c503a33559287063539066d2c978dd59586be01bb0fbca935264fb87f46f89
|