# oxylabs/chatgpt-scraper architecture

> Architecture diagram of the GitHub repository oxylabs/chatgpt-scraper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oxylabs/chatgpt-scraper
- Repository: https://github.com/oxylabs/chatgpt-scraper

## Overview

1. **What this repository is**
   - This is a sample/integration repository for Oxylabs’ ChatGPT Scraper, not an application or backend service.
   - Its purpose is to show how different clients can call a single external scraping API and consume the returned JSON.

2. **Primary external dependency**
   - The core architectural boundary is the Oxylabs Web Scraper API endpoint at `https://realtime.oxylabs.io/v1/queries`.
   - All examples authenticate with API credentials and send a request there; the repository itself does not host scraping logic, proxy management, or browser automation.

3. **Client-facing entry points**
   - The `Code examples/` folder contains equivalent request examples in multiple languages: C#, curl, Go, HTTP, Java, JSON, Node.js, PHP, and Python.
   - These files represent alternative client adapters around the same API contract rather than separate subsystems.

4. **Request construction flow**
   - Each example builds a POST payload with the same key fields: `source: chatgpt`, `prompt`, `parse`, `search`, and optional `geo_location` or `callback_url`.
   - The prompt is the main user input; the other fields control how the external API executes and parses the ChatGPT session.

5. **Authentication and transport**
   - Authentication is done via username/password credentials passed with the request.
   - The interaction is direct HTTP over TLS, so the repo’s integration boundary is a standard request/response API call.

6. **Execution model**
   - The default usage shown in the README is synchronous: send a POST request and immediately read the JSON response.
   - The presence of `callback_url` indicates the API can also support asynchronous completion, but that is still managed by the external service, not this repo.

7. **Response shape and parsing**
   - The repository includes an `output-chatgpt-scraper.json` sample showing the API’s returned structure.
   - The payload contains a top-level `results` array with metadata such as job timing, status codes, parser type, and the scraped content object.

8. **Content layer returned by the API**
   - The `content` object is the important data product: it includes the submitted prompt, model identifier, plain text response, Markdown response, structured Markdown JSON, and parse status.
   - Conditional fields such as citations, search queries, links, shopping products, and ads appear only when the ChatGPT response contains them.

9. **Operational features exposed through the API**
   - The README highlights built-in scraping infrastructure handled upstream: JS rendering, geo-targeting, anti-bot handling, CAPTCHA bypass, and proxy rotation.
   - These are architectural capabilities of the external service, which means the repository acts as a thin consumer rather than an operator of scraping infrastructure.

10. **Repository composition for diagrams**
   - For an architecture diagram, this repo should be shown as a documentation-and-samples layer containing multiple language clients on one side and the Oxylabs ChatGPT Scraper API on the other.
   - The only meaningful data flow is: user prompt and credentials in, API request to Oxylabs, parsed JSON response back, with the sample output file illustrating the downstream contract.

Main entry points: [`README.md`](https://github.com/oxylabs/chatgpt-scraper/blob/main/README.md) (README), [`Code examples/curl-chatgpt-scraper.sh`](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/curl-chatgpt-scraper.sh) (curl), [`Code examples/python-chatgpt-scraper.py`](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/python-chatgpt-scraper.py) (Python), [`Code examples/nodejs-chatgpt-scraper.js`](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/nodejs-chatgpt-scraper.js) (Node.js)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_samples["Code examples"]
  node_readme["README<br/>docs<br/>[README.md]"]
  node_sample_output["Sample output<br/>response example"]
  node_curl_example["curl<br/>client example"]
  node_python_example["Python<br/>client example"]
  node_node_example["Node.js<br/>client example"]
  node_go_example["Go<br/>client example"]
  node_java_example["Java<br/>client example"]
  node_csharp_example["C#<br/>client example"]
  node_php_example["PHP<br/>client example"]
  node_http_example["HTTP<br/>client example"]
  node_json_example["JSON<br/>client example"]
end

subgraph group_external["Oxylabs API"]
  node_oxylabs_api[("ChatGPT Scraper API<br/>external service")]
end

node_request_contract{{"Request shape<br/>payload contract"}}
node_auth_transport["Auth + HTTPS<br/>integration boundary"]

node_readme -->|"shows"| node_curl_example
node_readme -->|"shows"| node_python_example
node_readme -->|"shows"| node_node_example
node_readme -->|"shows"| node_go_example
node_readme -->|"shows"| node_java_example
node_readme -->|"documents"| node_sample_output
node_curl_example -->|"builds"| node_request_contract
node_python_example -->|"builds"| node_request_contract
node_node_example -->|"builds"| node_request_contract
node_go_example -->|"builds"| node_request_contract
node_java_example -->|"builds"| node_request_contract
node_csharp_example -->|"builds"| node_request_contract
node_php_example -->|"builds"| node_request_contract
node_http_example -->|"builds"| node_request_contract
node_json_example -->|"illustrates"| node_request_contract
node_curl_example -->|"uses"| node_auth_transport
node_python_example -->|"uses"| node_auth_transport
node_node_example -->|"uses"| node_auth_transport
node_go_example -->|"uses"| node_auth_transport
node_java_example -->|"uses"| node_auth_transport
node_csharp_example -->|"uses"| node_auth_transport
node_php_example -->|"uses"| node_auth_transport
node_http_example -->|"uses"| node_auth_transport
node_request_contract -->|"sent to"| node_oxylabs_api
node_auth_transport -->|"transports"| node_oxylabs_api
node_oxylabs_api -->|"returns"| node_sample_output

click node_readme "https://github.com/oxylabs/chatgpt-scraper/blob/main/README.md"
click node_sample_output "https://github.com/oxylabs/chatgpt-scraper/blob/main/output-chatgpt-scraper.json"
click node_curl_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/curl-chatgpt-scraper.sh"
click node_python_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/python-chatgpt-scraper.py"
click node_node_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/nodejs-chatgpt-scraper.js"
click node_go_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/golang-chatgpt-scraper.go"
click node_java_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/java-chatgpt-scraper.java"
click node_csharp_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/csharp-chatgpt-scraper.cs"
click node_php_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/php-chatgpt-scraper.php"
click node_http_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/http-chatgpt-scraper.http"
click node_json_example "https://github.com/oxylabs/chatgpt-scraper/blob/main/Code examples/json-chatgpt-scraper.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_sample_output,node_curl_example,node_python_example,node_node_example,node_go_example,node_java_example,node_csharp_example,node_php_example,node_http_example,node_json_example toneBlue
class node_oxylabs_api toneAmber
class node_request_contract,node_auth_transport toneNeutral
```

## Components

### Code examples

Multi-language request examples and sample output

- [README](https://github.com/oxylabs/chatgpt-scraper/blob/main/README.md): docs · Usage overview and integration guide · `README.md`
- [Sample output](https://github.com/oxylabs/chatgpt-scraper/blob/main/output-chatgpt-scraper.json): response example · Example JSON returned by the API · `output-chatgpt-scraper.json`
- [curl](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/curl-chatgpt-scraper.sh): client example · Command-line request adapter · `Code examples/curl-chatgpt-scraper.sh`
- [Python](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/python-chatgpt-scraper.py): client example · Python request adapter · `Code examples/python-chatgpt-scraper.py`
- [Node.js](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/nodejs-chatgpt-scraper.js): client example · Node.js request adapter · `Code examples/nodejs-chatgpt-scraper.js`
- [Go](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/golang-chatgpt-scraper.go): client example · Go request adapter · `Code examples/golang-chatgpt-scraper.go`
- [Java](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/java-chatgpt-scraper.java): client example · Java request adapter · `Code examples/java-chatgpt-scraper.java`
- [C#](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/csharp-chatgpt-scraper.cs): client example · C# request adapter · `Code examples/csharp-chatgpt-scraper.cs`
- [PHP](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/php-chatgpt-scraper.php): client example · PHP request adapter · `Code examples/php-chatgpt-scraper.php`
- [HTTP](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/http-chatgpt-scraper.http): client example · Raw HTTP request example · `Code examples/http-chatgpt-scraper.http`
- [JSON](https://github.com/oxylabs/chatgpt-scraper/blob/HEAD/Code%20examples/json-chatgpt-scraper.json): client example · JSON request example · `Code examples/json-chatgpt-scraper.json`

### Oxylabs API

External scraping service boundary

- **ChatGPT Scraper API**: external service · Oxylabs Web Scraper endpoint handling scraping, parsing, and delivery

### Other components

- **Request shape**: payload contract · Shared ChatGPT scraper POST fields
- **Auth + HTTPS**: integration boundary · Basic credentials over direct TLS request/response

## Connections

- README → curl: shows · Documentation points to language-specific usage examples
- README → Python: shows · Documentation points to language-specific usage examples
- README → Node.js: shows · Documentation points to language-specific usage examples
- README → Go: shows · Documentation points to language-specific usage examples
- README → Java: shows · Documentation points to language-specific usage examples
- README → Sample output: documents · README explains the response contract via the sample payload
- curl → Request shape: builds · Each client constructs the same POST payload
- Python → Request shape: builds · Each client constructs the same POST payload
- Node.js → Request shape: builds · Each client constructs the same POST payload
- Go → Request shape: builds · Each client constructs the same POST payload
- Java → Request shape: builds · Each client constructs the same POST payload
- C# → Request shape: builds · Each client constructs the same POST payload
- PHP → Request shape: builds · Each client constructs the same POST payload
- HTTP → Request shape: builds · Each client constructs the same POST payload
- JSON → Request shape: illustrates · Static request example for the same API contract
- curl → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- Python → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- Node.js → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- Go → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- Java → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- C# → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- PHP → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- HTTP → Auth + HTTPS: uses · Examples authenticate with basic credentials over HTTPS
- Request shape → ChatGPT Scraper API: sent to · POST request is delivered to the external scraping endpoint
- Auth + HTTPS → ChatGPT Scraper API: transports · Direct TLS request/response boundary to Oxylabs
- ChatGPT Scraper API → Sample output: returns · Sample JSON shows the returned results and content structure
