Raj
Home/Projects/Open Export

Open Export

stable

CLI tool to download and archive all your ChatGPT conversations

ETLResearchEngineeringModelingLaunch
Python 3.10+PlaywrightClickRichhatchlingPyPIpytestpytest-asyncio
Overview

What It Is

Open Export is a Python CLI tool that enables users to download and archive all their ChatGPT conversations as JSON and Markdown files. It addresses the limitation that ChatGPT's native "Export data" feature cannot be automated and is disabled on some managed accounts. The tool connects to a running Chrome browser via Chrome DevTools Protocol to fetch conversations programmatically using the user's existing session.


Architecture

A straightforward CLI application with four modules:

  • Browser Connection (browser.py): Connects via Playwright CDP to a running Chrome instance. Extracts access tokens from ChatGPT's auth session endpoint. Handles token refresh with automatic retry on auth failures.
  • Scraper (scraper.py): Paginates through ChatGPT's conversation list API, fetches full detail for each conversation, and tracks failures per conversation.
  • Exporter (exporter.py): Linearizes ChatGPT's tree-based message structure (following the last-child branch for the primary thread), then exports to both JSON (raw API response) and Markdown (human-readable with metadata).
  • CLI (cli.py): Click-based command interface with Rich terminal formatting, progress bars, and summary statistics.

All API calls are made via in-browser fetch() through Playwright's page.evaluate() to avoid CORS issues, using the browser's existing authentication cookies.

Key Features

Data Sources

  • ChatGPT Backend APIs: Auth session endpoint for tokens, conversation list endpoint with pagination, and individual conversation detail endpoint.
  • Authentication: Browser cookies and session from a running Chrome instance with an active ChatGPT login.

Current State

Stable release v0.1.6 on PyPI. Published as wheel and source distribution. The tool is functional for full conversation archival with comprehensive error handling and progress reporting. No external dependencies beyond a running Chrome instance with ChatGPT logged in.