https://github.com/9de/chatgpt-conversation-deleter
Since OpenAI doesn't support bulk deletion based on keywords, I made a mass deleter for ChatGPT conversations using keywords.
https://github.com/9de/chatgpt-conversation-deleter
Last synced: 10 months ago
JSON representation
Since OpenAI doesn't support bulk deletion based on keywords, I made a mass deleter for ChatGPT conversations using keywords.
- Host: GitHub
- URL: https://github.com/9de/chatgpt-conversation-deleter
- Owner: 9de
- License: mit
- Created: 2025-07-20T16:49:15.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-20T16:51:59.000Z (11 months ago)
- Last Synced: 2025-08-11T01:39:47.144Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChatGPT Conversation deleter
A powerful Node.js CLI tool to search and bulk delete ChatGPT conversations by keyword. Clean up your ChatGPT conversation history efficiently with an interactive command-line interface.
## Features
- 🔍 **Smart Search**: Search through all your ChatGPT conversations using keywords
- 🗑️ **Bulk Deletion**: Delete multiple conversations at once with confirmation prompts
- 📄 **Pagination Support**: Automatically handles large conversation histories
- 🔐 **Secure Authentication**: Uses your ChatGPT bearer token for API access
- 🎯 **Interactive CLI**: User-friendly command-line interface with clear prompts
- ⚡ **Native Performance**: Uses native curl and Node.js modules (no heavy dependencies)
## Prerequisites
- Node.js 16.0.0 or higher
- `curl` command available in your system PATH
- Valid ChatGPT account with conversations to Scrape it
## Installation
### Option 1: Clone and Run Locally
```bash
git clone https://github.com/9de/chatgpt-conversation-deleter.git
cd chatgpt-conversation-deleter
npm install
npm start
```
## Usage
1. **Run the application**:
```bash
npm start
```
## How to Get Your Authentication Token
1. Visit [chatgpt.com](https://chatgpt.com) and log in
2. Open your browser's Developer Tools:
- Chrome/Edge: Press `F12` or `Ctrl+Shift+I`
- Firefox: Press `F12` or `Ctrl+Shift+I`
- Safari: Press `Cmd+Option+I`
3. Go to the **Application** tab (Chrome/Edge) or **Storage** tab (Firefox)
4. Navigate to **Cookies** → `https://chatgpt.com`
5. Find the cookie named `__Secure-next-auth.session-token`
6. Copy its value (this is your bearer token)
⚠️ **Security Note**: Keep your token private and never share it publicly.
## Example Usage
```
=== ChatGPT Conversation Manager ===
Enter your GPT authentication token: eyJhbGciOiJkaXIiLCJlbmMiOi...
Verifying authentication...
Welcome, John Doe (john.doe@example.com)!
Enter a keyword to search in your chat history: javascript
Fetching your search history...
Found 15 conversations with the keyword "javascript":
1. JavaScript Array Methods (ID: abc123...)
2. React JavaScript Tutorial (ID: def456...)
3. JavaScript Debugging Tips (ID: ghi789...)
...
Do you want to delete these conversations? (yes/no): yes
Deleting conversations...
✓ Conversation "JavaScript Array Methods" deleted successfully
✓ Conversation "React JavaScript Tutorial" deleted successfully
✓ Conversation "JavaScript Debugging Tips" deleted successfully
...
✓ All conversations with the specified keyword have been deleted.
```
## API Endpoints Used
This tool interacts with the following ChatGPT API endpoints:
- `GET /backend-api/me` - Verify authentication and get user info
- `GET /backend-api/conversations/search` - Search conversations by keyword
- `PATCH /backend-api/conversation/{id}` - Delete/hide conversations
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Disclaimer
This tool is not officially affiliated with OpenAI. Use it responsibly and in accordance with ChatGPT's terms of service. The author is not responsible for any data loss or account issues that may result from using this tool.
**⭐ If this tool helped you, consider giving it a star on GitHub!**