# ChatGPT Conversation Scraper (`maximedupre/chatgpt-conversation-scraper`) Actor

Scrape public ChatGPT shared links. Export full conversations with messages, roles, timestamps, model metadata, code blocks, and source evidence.

- **URL**: https://apify.com/maximedupre/chatgpt-conversation-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 scraped conversations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### 💬 ChatGPT conversation scraper for shared links

ChatGPT Conversation Scraper extracts complete public shared conversations from [ChatGPT](https://chatgpt.com/) share links. Paste one or more `chatgpt.com/share/...` or `chat.openai.com/share/...` URLs and get a clean dataset with conversation title, share ID, model, timestamps, full messages, roles, message IDs, statuses, and code blocks.

Use this ChatGPT conversation scraper when you need to archive public shared chats, review prompt and response patterns, collect examples for documentation, or export conversations into your own database, spreadsheet, API workflow, or analysis pipeline. The Actor reads public shared links only. It does not ask for ChatGPT cookies, credentials, login details, or private conversation access.

For a quick first run, keep the prefilled public ChatGPT shared URL. It returns a complete conversation row with nested messages so you can review the output shape before adding your own links.

### ✅ What this Actor does

- Scrapes public ChatGPT shared conversation URLs.
- Accepts both `chatgpt.com/share/...` and old `chat.openai.com/share/...` links.
- Saves one dataset row per successfully scraped shared conversation.
- Returns the full visible message list in source order.
- Preserves message roles such as user, assistant, system, or tool when ChatGPT exposes them.
- Extracts readable message text and code blocks.
- Adds source-backed conversation metadata such as title, share ID, model, created time, updated time, and message count when available.
- Optionally attaches rendered HTML and source conversation JSON for audit workflows.
- Skips unusable links without creating placeholder error rows.
- Works with Apify exports, API access, schedules, webhooks, and integrations.

### 📊 ChatGPT data you can export

Each dataset item is one public shared ChatGPT conversation.

| Data group | Fields |
| --- | --- |
| Conversation identity | `shareId`, `title`, `model` |
| Timing | `createdAt`, `updatedAt` |
| Completeness | `messageCount`, `messages` |
| Message details | `messageId`, `role`, `index`, `text`, `createdAt`, `status` |
| Code blocks | `codeBlocks[].language`, `codeBlocks[].text` |
| Extra source metadata | `gizmoId`, `plugins` |
| Optional audit evidence | `sourceContent.renderedHtml`, `sourceContent.conversationJson` |

ChatGPT may not expose every metadata field on every shared link. Nullable fields are returned as `null` when the public share page does not provide them.

### 🚀 How to run it

1. Open the Input tab.
2. Add one or more public ChatGPT shared conversation URLs.
3. Keep `Preserve source content` off for normal exports.
4. Turn `Preserve source content` on only when you need rendered HTML and source JSON attached to each saved conversation.
5. Start the Actor and open the dataset.

You control the run size by submitting fewer or more shared URLs. Invalid, private, expired, deleted, or unsupported links are reported in the run log and do not create dataset rows.

### 🧾 Input example

```json
{
  "startUrls": [
    {
      "url": "https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51"
    }
  ],
  "preserveSourceContent": false
}
````

### 📦 Output example

```json
{
  "shareId": "693011c8-0a3c-8006-b6cf-77d844d1bb51",
  "title": "TikTok script creation",
  "model": "gpt-5-1",
  "createdAt": "2025-12-03T10:32:40.044Z",
  "updatedAt": "2025-12-03T10:32:45.106Z",
  "messageCount": 45,
  "messages": [
    {
      "messageId": "msg_abc123",
      "role": "user",
      "index": 0,
      "text": "Create a TikTok script for a product launch.",
      "createdAt": "2025-12-03T10:32:40.044Z",
      "status": "finished_successfully",
      "codeBlocks": []
    },
    {
      "messageId": "msg_def456",
      "role": "assistant",
      "index": 1,
      "text": "Here is a concise launch script...",
      "createdAt": "2025-12-03T10:32:45.106Z",
      "status": "finished_successfully",
      "codeBlocks": [
        {
          "language": "python",
          "text": "print(\"launch\")"
        }
      ]
    }
  ],
  "gizmoId": null,
  "plugins": [],
  "sourceContent": null
}
```

### 💳 Pricing

This Actor uses pay-per-event pricing.

- `Scraped conversation` is charged once for each usable public shared conversation saved to the dataset.
- `Preserved source content` is charged only when `Preserve source content` is enabled and source evidence is attached to a saved conversation.
- Invalid, private, deleted, expired, unsupported, or source-unavailable links do not create primary result rows.

See the Pricing tab for the current per-event prices for your Apify plan.

### ⚠️ Limits and caveats

This Actor works with public ChatGPT shared links only. It cannot read private ChatGPT history, send prompts, continue conversations, log in to ChatGPT, use your ChatGPT account, or recover a share link that ChatGPT no longer exposes publicly.

The output is extracted data, not an AI summary. If you need summarization, classification, scoring, or rewriting, run that as a separate step after exporting the dataset.

### ❓ FAQ

#### 🔐 Do I need a ChatGPT token or cookies?

No. The Actor reads public shared conversation pages and does not ask for ChatGPT credentials.

#### 🧵 Does it scrape the full conversation?

Yes, for usable public shared links it saves the visible message list in source order, including roles, text, message IDs, statuses, and code blocks when ChatGPT exposes them.

#### 🧹 Why are failed links not in the dataset?

The dataset contains successful conversation rows only. Bad links are easier to handle in logs than as placeholder rows mixed into your exports.

#### 🧾 When should I preserve source content?

Use it when you need audit evidence or want to review the source HTML and conversation JSON later. Leave it off for smaller, cleaner datasets.

### 📝 Changelog

- 0.0: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~chatgpt-conversation-scraper/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [Reddit Comments Search Scraper ↗](https://apify.com/maximedupre/reddit-comments-search-scraper) - Search public Reddit comments by keyword, subreddit, and freshness window.
- [Reddit Scraper ↗](https://apify.com/maximedupre/reddit-scraper) - Export Reddit posts and comments around a topic or brand.
- [Twitter Scraper ↗](https://apify.com/maximedupre/twitter-scraper) - Collect public X/Twitter posts, profiles, and trends.
- [TikTok Transcript Scraper ↗](https://apify.com/maximedupre/tiktok-transcript-scraper) - Extract public TikTok captions, transcript text, and timed segments.
- [Website URL Crawler ↗](https://apify.com/maximedupre/website-url-crawler) - Crawl rendered public websites and export a link map.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `startUrls` (type: `array`):

Paste public ChatGPT share links such as https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51.

## `preserveSourceContent` (type: `boolean`):

Attach raw source content for audit workflows. This adds a separate paid event per saved conversation.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51"
    },
    {
      "url": "https://chatgpt.com/share/6a34732c-0fa4-83e8-aae1-95c25dd117c9"
    },
    {
      "url": "https://chatgpt.com/share/6a33fce3-27e4-83eb-8913-a2b5a97ff5ba"
    },
    {
      "url": "https://chatgpt.com/share/6a2d8c75-56f4-83e8-a61a-301e4c62b123"
    },
    {
      "url": "https://chatgpt.com/share/6a2d06a3-a3b4-83ed-9e0a-8ec07e05e34f"
    }
  ],
  "preserveSourceContent": false
}
```

# Actor output Schema

## `results` (type: `string`):

Successful public ChatGPT shared conversations with messages, metadata, code blocks, and optional source evidence.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51"
        },
        {
            "url": "https://chatgpt.com/share/6a34732c-0fa4-83e8-aae1-95c25dd117c9"
        },
        {
            "url": "https://chatgpt.com/share/6a33fce3-27e4-83eb-8913-a2b5a97ff5ba"
        },
        {
            "url": "https://chatgpt.com/share/6a2d8c75-56f4-83e8-a61a-301e4c62b123"
        },
        {
            "url": "https://chatgpt.com/share/6a2d06a3-a3b4-83ed-9e0a-8ec07e05e34f"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/chatgpt-conversation-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": [
        { "url": "https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51" },
        { "url": "https://chatgpt.com/share/6a34732c-0fa4-83e8-aae1-95c25dd117c9" },
        { "url": "https://chatgpt.com/share/6a33fce3-27e4-83eb-8913-a2b5a97ff5ba" },
        { "url": "https://chatgpt.com/share/6a2d8c75-56f4-83e8-a61a-301e4c62b123" },
        { "url": "https://chatgpt.com/share/6a2d06a3-a3b4-83ed-9e0a-8ec07e05e34f" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/chatgpt-conversation-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51"
    },
    {
      "url": "https://chatgpt.com/share/6a34732c-0fa4-83e8-aae1-95c25dd117c9"
    },
    {
      "url": "https://chatgpt.com/share/6a33fce3-27e4-83eb-8913-a2b5a97ff5ba"
    },
    {
      "url": "https://chatgpt.com/share/6a2d8c75-56f4-83e8-a61a-301e4c62b123"
    },
    {
      "url": "https://chatgpt.com/share/6a2d06a3-a3b4-83ed-9e0a-8ec07e05e34f"
    }
  ]
}' |
apify call maximedupre/chatgpt-conversation-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/chatgpt-conversation-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ChatGPT Conversation Scraper",
        "description": "Scrape public ChatGPT shared links. Export full conversations with messages, roles, timestamps, model metadata, code blocks, and source evidence.",
        "version": "0.0",
        "x-build-id": "gZ2rt4f4JjL32P7zN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~chatgpt-conversation-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-chatgpt-conversation-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/maximedupre~chatgpt-conversation-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-chatgpt-conversation-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/maximedupre~chatgpt-conversation-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-chatgpt-conversation-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "ChatGPT shared URLs",
                        "minItems": 1,
                        "maxItems": 500,
                        "type": "array",
                        "description": "Paste public ChatGPT share links such as https://chatgpt.com/share/693011c8-0a3c-8006-b6cf-77d844d1bb51.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "title": "URL",
                                    "type": "string",
                                    "description": "A public ChatGPT shared conversation URL.",
                                    "pattern": "^https?:\\/\\/(chatgpt\\.com|chat\\.openai\\.com)\\/share\\/.+"
                                }
                            }
                        }
                    },
                    "preserveSourceContent": {
                        "title": "Preserve source content",
                        "type": "boolean",
                        "description": "Attach raw source content for audit workflows. This adds a separate paid event per saved conversation.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
