← all repositories
taranjeet/unofficial-chatgpt-api

ChatGPT API by way of browser automation

A single-endpoint Flask server that scrapes ChatGPT's web UI because there was no public API yet.

unofficial-chatgpt-api
Velocity · 7d
+0.5
★ / day
Trend
steady
collecting data…
star history

What it does

Spins up a local Flask server on port 5001 with one endpoint: /chat?q=your prompt here. Under the hood, Playwright drives a Chromium browser, logs into ChatGPT’s web interface, and parses the HTML response. It’s essentially a headless browser wrapped in a GET request.

The interesting bit

This was built in the limbo period after ChatGPT launched but before OpenAI released their official API — a stopgap that treats the web UI as an accidental interface. The author extracted and documented Daniel Gross’s WhatsApp-GPT script for easier standalone use.

Key highlights

  • Single dependency stack: Python, Flask, Playwright, Chromium
  • One endpoint, no auth complexity beyond whatever ChatGPT’s web login requires
  • Explicitly labeled “for development purpose only”
  • Parsing logic was updated once (Dec 2022) to handle ChatGPT frontend changes
  • 702 stars suggests it filled a real gap at the time

Caveats

  • Fragile by design: any change to ChatGPT’s HTML breaks the scraper
  • Requires manual browser installation (playwright install)
  • No rate limiting, retry logic, or session management visible in the README
  • The repo hasn’t been updated since late 2022; the official API has since launched

Verdict

A useful historical artifact if you’re studying how people bridged API gaps, or if you need to automate a web-only service without an SDK. Skip it if you want production reliability — use OpenAI’s official API instead.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.