> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatGPT scraper quickstart

> Set up the Bright Data ChatGPT Scraper API and send your first prompt to receive structured JSON with search results and citations in under 5 minutes.

This tutorial shows you how to send a search prompt to ChatGPT and get structured JSON data using the Bright Data ChatGPT Scraper API.

## Prerequisites

* A [Bright Data account](https://brightdata.com/products/web-scraper/chatgpt?hs_signup=1\&utm_source=docs)
* cURL, Python 3.9+, or Node.js 18+ installed

<Steps>
  <Step title="Get your API key">
    Go to the [user settings page](https://brightdata.com/cp/setting/users) in your Bright Data account and create an API key, or use one you already have.

    If you don't have an account yet, [sign up at brightdata.com](https://brightdata.com/products/web-scraper/chatgpt?hs_signup=1\&utm_source=docs). New accounts get 5,000 free credits every month, no credit card required. See the [free tier](/general/account/billing-and-pricing/free-tier).

    <Warning>
      Your API key is shown only once when created. Copy and store it securely.
    </Warning>
  </Step>

  <Step title="Send a request">
    We'll use the **ChatGPT Search endpoint**. The quickest route is the Bright Data Python SDK (`pip install brightdata-sdk`), which waits for the result for you. The other tabs call the API directly with a synchronous request. Replace `YOUR_API_KEY` with your API key:

    <CodeGroup>
      ```python Python SDK theme={null}
      # pip install brightdata-sdk
      from brightdata import SyncBrightDataClient

      # The Scraper API uses no zones, so skip the SDK's zone setup
      with SyncBrightDataClient(token="YOUR_API_KEY", auto_create_zones=False) as client:
          result = client.scrape.chatgpt.prompt("Top hotels in New York")
          print(result.data)
      ```

      ```bash cURL theme={null}
      curl -X POST \
        "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m7aof0k82r803d5bjm&format=json" \
        -H "Authorization: Bearer YOUR_API_KEY" \
        -H "Content-Type: application/json" \
        -d '[{"url": "https://chatgpt.com/", "prompt": "Top hotels in New York"}]'
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://api.brightdata.com/datasets/v3/scrape",
          params={"dataset_id": "gd_m7aof0k82r803d5bjm", "format": "json"},
          headers={
              "Authorization": "Bearer YOUR_API_KEY",
              "Content-Type": "application/json",
          },
          json=[{"url": "https://chatgpt.com/", "prompt": "Top hotels in New York"}],
      )

      data = response.json()
      if response.status_code == 202:
          print(f"Job running. Snapshot ID: {data['snapshot_id']}")
      else:
          print(data)
      ```

      ```javascript Node.js theme={null}
      const response = await fetch(
        "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m7aof0k82r803d5bjm&format=json",
        {
          method: "POST",
          headers: {
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json",
          },
          body: JSON.stringify([
            { url: "https://chatgpt.com/", prompt: "Top hotels in New York" }
          ]),
        }
      );

      const data = await response.json();
      if (response.status === 202) {
        console.log(`Job running. Snapshot ID: ${data.snapshot_id}`);
      } else {
        console.log(data);
      }
      ```
    </CodeGroup>

    The SDK prints the returned records from `result.data`. It waits up to 120 seconds for the result, so you don't handle a `202` yourself. With cURL, Python or Node.js you should see a `200` status code and a JSON array. A `202` means the scrape needs longer than 1 minute; see the note below. Processing time varies with target-site conditions and scraper workload.

    <Note>
      A synchronous request waits up to 1 minute. If the Bright Data ChatGPT Scraper API needs longer, the response is HTTP `202` with a `snapshot_id` instead of search results, and collection continues asynchronously. Fetch the result with the [async workflow](/products/scrapers/scrapers-library/async-requests) or have it pushed to you with [webhook delivery](/products/scrapers/scrapers-library/data-delivery).
    </Note>
  </Step>

  <Step title="Review the response">
    The Bright Data ChatGPT Scraper API returns a JSON array with structured search data:

    ```json theme={null}
    [
      {
        "url": "https://chatgpt.com/?q=Top%20hotels%20in%20New%20York",
        "prompt": "Top hotels in New York",
        "answer_text": "Map data is currently unavailable Aman New York 4.3 Отель 2 450 $ The Plaza Hotel The Carlyle, A Rosewood Hotel 4.5 Отель 1 359 $ The Mark Hotel 4.5 Отель 2...",
        "model": null,
        "web_search_triggered": true,
        "citations": [
          {
            "url": "https://www.timeout.com/newyork/hotels/best-luxury-hotels-in-nyc?utm_source=chatgpt.com",
            "title": "16 Best Luxury Hotels in New York City For 2026 | World-Class Hotels in NYC",
            "description": "Time Out Worldwide",
            "icon": null
          }
        ],
        "search_sources": [
          {
            "url": "https://www.timeout.com/newyork/hotels/best-luxury-hotels-in-nyc?utm_source=chatgpt.com",
            "title": "16 Best Luxury Hotels in New York City For 2026 | World-Class Hotels in NYC",
            "snippet": null,
            "rank": 1
          }
        ],
        "prompt_sent_at": "2026-09-06T10:22:47.311Z",
        "answer_html": "<html lang=\"en-US\" dir=\"ltr\" data-theme=\"light\" data-contrast=\"default\" data-build=\"prod-4ec31e730ff961987ab0f9a7e9dd6248f66da3b0\" data-close-image-viewer=\"C...",
        "is_map": true
      }
    ]
    ```

    Each result object includes the answer text, citations with source URLs, and metadata. See the [full response schema](/api-reference/scrapers/ai-search-apis/chatgpt-search-by-prompt).
  </Step>
</Steps>

You've successfully searched ChatGPT with your first prompt using the Bright Data ChatGPT Scraper API.

## Common questions

### Can I send multiple prompts in one request?

Yes. Add more objects to the input array. Bright Data recommends 20 inputs or fewer per synchronous request, a best practice rather than a hard limit. For larger batches, use the [async `/trigger` endpoint](/products/scrapers/scrapers-library/async-requests).

```json theme={null}
[
  {"url": "https://chatgpt.com/", "prompt": "Top hotels in New York"},
  {"url": "https://chatgpt.com/", "prompt": "Best restaurants in Paris"},
  {"url": "https://chatgpt.com/", "prompt": "Things to do in Tokyo"}
]
```

### Getting a 401 or 403 error?

Verify your API key is correct and hasn't expired. Create a new API key in [Account settings](https://brightdata.com/cp/setting/users). See the [authentication guide](/api-reference/authentication) for details.

### Request is timing out?

Synchronous requests have a 1-minute timeout. If the request exceeds this limit, the API returns HTTP `202` with a `snapshot_id` and finishes the job asynchronously. Use the [async workflow](/products/scrapers/scrapers-library/async-requests) for large batches.

### Empty or partial response data?

Verify that the `url` field is set to `https://chatgpt.com/` and the `prompt` field is not empty. Prompts must be 4,096 characters or fewer.

## Do I have to call the API directly?

No. The Bright Data SDKs, the CLI and coding-agent tools call the same Scraper API, so you can start from whichever fits your stack.

| Client | Install | First call |
| :- | :- | :- |
| **Python and Node.js SDK** | `pip install brightdata-sdk` or `npm install @brightdata/sdk` | `client.scrape.chatgpt.prompt(prompt="Top hotels in New York", web_search=True)`; see the [Python SDK](/api-reference/SDK) and [JavaScript SDK](/api-reference/SDK-JS) |
| **CLI** | `npm install -g @brightdata/cli`, then `bdata login` | `bdata pipelines list` prints every pipeline name, then run `bdata pipelines <pipeline> "<url>" --pretty`; see the [CLI commands](/products/cli/commands) |
| **Coding agents** | `npx skills add brightdata/skills` installs the skills; the [Bright Data MCP](/products/mcp-server/overview) server exposes the scrapers as tools | See the [coding agent quickstart](/quickstart-coding-agent) |

## Next steps

<CardGroup cols={3}>
  <Card title="Endpoints" icon="bolt" href="/products/scrapers/chatgpt/send-first-request">
    One request per endpoint, each with a captured response.
  </Card>

  <Card title="Async batch requests" icon="layer-group" href="/products/scrapers/scrapers-library/async-requests">
    Search ChatGPT with hundreds of prompts in a single batch job.
  </Card>

  <Card title="Set up webhooks" icon="webhook" href="/products/scrapers/scrapers-library/data-delivery">
    Receive results automatically when scraping completes.
  </Card>
</CardGroup>
