API & CLI

Public read API (v1): all public prompts, versions, tags, and profiles as JSON. No API key required, CORS enabled, limit 120 requests/minute.

CLI

The fastest way to get a prompt into your project:

Recommended – with integrity check (SHA-256):

curl -fsSLO https://promthub.org/cli/releases/v1.0.0/prompthub
curl -fsSLO https://promthub.org/cli/releases/v1.0.0/prompthub.sha256
sha256sum -c prompthub.sha256
install -m 0755 prompthub /usr/local/bin/prompthub

Short form without verification (for quick trials only):

curl -fsSL https://promthub.org/cli/prompthub -o /usr/local/bin/prompthub
chmod +x /usr/local/bin/prompthub

prompthub pull alice/email-summarizer          # → PROMPT.md
prompthub cat alice/email-summarizer           # → stdout
prompthub pull alice/email-summarizer --version 1.0.0 -o prompts/summarizer.md
prompthub search "code review"
prompthub versions alice/email-summarizer

Requires only curl (search/versions additionally need python3).

Endpoints

GET /api/v1/repos                     list; parameters: page, sort=top|trending|new, q, tag
GET /api/v1/repos/{owner}/{name}               detail incl. content, variables, parameters
GET /api/v1/repos/{owner}/{name}/versions      version list
GET /api/v1/repos/{owner}/{name}/versions/{v}  content of one version
GET /api/v1/repos/{owner}/{name}/raw           text/plain, optional ?version=x.y.z
GET /api/v1/tags                               all tags with counts
GET /api/v1/users/{handle}                     profile incl. repo list

Example

curl -s https://promthub.org/api/v1/repos?q=email | python3 -m json.tool

curl -s https://promthub.org/api/v1/repos/alice/email-summarizer/raw

Response format: lists come as {"data": […], "meta": {"page", "pages", "total"}}, single objects as {"data": {…}}, errors as {"error": {"code", "message"}}.

Write API (tokens)

With a personal token (under account settings) you can publish new versions via the API – e.g. from CI pipelines:

curl -X POST https://promthub.org/api/v1/repos/DEIN-HANDLE/DEIN-REPO/versions \
  -H "Authorization: Bearer ph_…" -H "Content-Type: application/json" \
  -d '{"content": "…", "changelog": "Feinschliff", "bump": "patch"}'

Or via CLI: PROMPTHUB_TOKEN=ph_… prompthub push owner/repo prompt.txt "Feinschliff" patch

MCP

PromptHub is also an MCP server (streamable HTTP): Claude Code, Claude Desktop, and other MCP clients can search and fetch prompts directly.

claude mcp add --transport http prompthub https://promthub.org/mcp

Tools: search_prompts, get_prompt, list_versions, list_tags – read-only access to public data, no API key required.

Fair use

The API serves public data only. Please send a descriptive user agent and cache responses (Cache-Control is set). Write access will follow in a later version with API tokens.