How brightdata/chatgpt-scraper works
This is a small Python client for Bright Data’s ChatGPT Scraper API. The main workflow accepts prompts and options, submits an asynchronous job, polls for completion, fetches answer rows, and returns them to a Python caller or writes them to JSON through the CLI. The API supports country, web search, citations, and follow-up prompts. The sampled source shows the HTTP and CLI paths; README statements support the documented result capabilities. Unsampled tests and peripheral files are omitted.
Main entry points: __main__.py Bulk CLI · scrape.py HTTP transport · __init__.py Python API
Components 13
User interfaces
- Python API
src/chatgpt_scraper/__init__.py - Bulk CLI
src/chatgpt_scraper/__main__.py - Answer rows
Scraper client
- Prompt options
src/chatgpt_scraper/scrape.py - Job lifecycle
src/chatgpt_scraper/scrape.py - HTTP transport
src/chatgpt_scraper/scrape.py - Credential lookup
src/chatgpt_scraper/scrape.py - Outcome handling
src/chatgpt_scraper/scrape.py - JSON writer
src/chatgpt_scraper/scrape.py
External service
- Bright Data API
Other components
- Python caller
- CLI user
- JSON file
Connections 15
- Python caller → Python API: calls
README.md - CLI user → Bulk CLI: runs
README.md - Python API → Prompt options: exposes
src/chatgpt_scraper/__init__.py - Bulk CLI → Outcome handling: asks prompts
src/chatgpt_scraper/__main__.py - Bulk CLI → Credential lookup: checks token
src/chatgpt_scraper/__main__.py - Bulk CLI → JSON writer: writes results
src/chatgpt_scraper/__main__.py - Prompt options → Job lifecycle: submits inputs
src/chatgpt_scraper/scrape.py - Job lifecycle → HTTP transport: sends requests
src/chatgpt_scraper/scrape.py - HTTP transport → Credential lookup: gets token
src/chatgpt_scraper/scrape.py - HTTP transport → Bright Data API: calls endpoints
src/chatgpt_scraper/scrape.py - Bright Data API → HTTP transport: returns job data
src/chatgpt_scraper/scrape.py - Job lifecycle → Answer rows: fetches rows
src/chatgpt_scraper/scrape.py - Prompt options → Outcome handling: normalizes results
src/chatgpt_scraper/scrape.py - Outcome handling → Answer rows: returns outcomes
README.md - JSON writer → JSON file: writes JSON
src/chatgpt_scraper/scrape.py