Skip to content

Version 0.2.0 is on PyPI

Find a website's hidden API. Get a typed, tested client.

Most websites load their data from their own JSON API. Ghost API opens the site in a real browser, records those requests, proves how they behave with direct calls, and writes a Python or TypeScript client for them.

pipx install ghost-api-cli

Python 3.11+ · MIT licence · runs on your computer

The Ghost API dashboard showing the verified /api/quotes endpoint on quotes.toscrape.com The Ghost API dashboard showing the verified /api/quotes endpoint on quotes.toscrape.com

The local dashboard after a real run on quotes.toscrape.com: one endpoint, its parameters and reply shape, verified by two live tests.

How it works

One real run, start to finish

From a run on quotes.toscrape.com, a public practice site. Nothing below is edited except for length.

ghost-api run https://quotes.toscrape.com/scroll --goal "list quotes with their authors"

1

Recorded in the browser

The page loads more quotes as you scroll. Behind it is one request to the site's own server:

GET /api/quotes?page={page}

2

Proved with direct calls

From the run's report, "Hypotheses tested":

  • Called directly, outside the browser: HTTP 200, 10 records.
  • Paginates with page: the next page returned 10 different records.
  • Needs none of its custom headers or cookies.

3

Written as a client

Models are inferred from real replies, then the client's own tests run against the live API:

class Quote(_Model):
    author: Author
    tags: list[str]
    text: str
from quotes_toscrape_client import QuotesToscrapeClient

with QuotesToscrapeClient() as api:
    for page in api.iter_get_quotes(max_pages=3):
        print(page.quotes[0].author.name)

Measured, not claimed

Why not just ask an AI assistant?

On a small site with readable JavaScript, Claude Code alone found all 5 endpoints in 7 turns; with Ghost API it took 12 turns, at a similar cost. Finding endpoints on easy sites is not where Ghost API helps. Keeping the result working is.

Re-check in 6.5 seconds

ghost-api diff --live compares the live API with the recorded one, with no LLM call.

Tests that run offline

Recorded replies are replayed in CI: 7 tests passed in 9 seconds, offline.

Know what changed

Changes are classified as breaking or added, and the client version is bumped to match.

Rules for every request

robots.txt, rate limits and team rules are enforced, and every request it sends is logged.

Read the full comparison

Assistants

Use it from your assistant

Claude Code, Cursor, VS Code and Claude Desktop can drive Ghost API as a set of tools. The assistant decides where to click; Ghost API records, checks and remembers. No second LLM key is needed.

ghost-api integrate claude-code

Set up an assistant

Safety

Polite by design

  • Follows robots.txt and limits its own request rate.
  • Stops at bot checks. When a site needs a login, you log in yourself.
  • Never sends requests that change data on a site.
  • Hides personal data (emails, phone, card and ID numbers) before storing anything.
  • Refuses to let a website steer it into your own network.
  • Sends no telemetry.

What is collected and what leaves your machine

Try it on a practice site

pipx install ghost-api-cli
ghost-api init

Read the guide See real runs