Sitelet https://urlpipe.dev/docs/client-libraries
Skip to main content

Client libraries

Official clients for Python, JavaScript and TypeScript, Ruby and Go. Each is a thin layer over the HTTP API with typed results and errors, and the same behaviour in every language.

You don't need one: every endpoint is a single POST, and the code recipes show it in eight languages with nothing but an HTTP client. A library saves you the parts around that POST — retries, long analyses, error types and webhook signatures.

Install

LanguageInstallPackageSourceNotes
Pythonpip install urlpipePyPIGitHubPython 3.9+, sync and async clients, one dependency (httpx)
JavaScriptnpm install @urlpipe/sdknpmGitHubTypeScript types, no dependencies; Node 18+, Bun, Deno and Cloudflare Workers
Rubygem install urlpipeRubyGemsGitHubRuby 3.1+, no dependencies
Gogo get github.com/URLpipe/urlpipe-gopkg.go.devGitHubGo 1.21+, standard library only

Your first call

Each client reads the project API key from URLPIPE_API_KEY (or takes it as an argument) and waits for the result, so a call returns the page:

import urlpipe

client = urlpipe.Client()  # reads URLPIPE_API_KEY

page = client.markdown("https://example.com")
print(page.data)

What every client does

  • Waits for the result. Calls send sync: true by default. When a page outlives the 60-second sync window, the API answers 504 with a token and the client polls GET /result/:token until the result lands, so your code sees one call. Pass sync: false for a token straight away, and wait(token) to collect it.
  • Retries without paying twice. Connection errors, 5xx answers, rate_limited and concurrency_limit are retried with backoff, and every retried request carries an Idempotency-Key, so a retry can never run or bill the work twice.
  • Types every error. Each documented error — invalid key, unconfirmed email, invalid request, failed analysis, out of credits, too many in parallel, rate limited, not found, expired — is its own type, with the API's code, message and fields.
  • Reads the metadata. The response headers — cache status and age, processing time, credits spent and left — come back parsed on every response.
  • Verifies webhooks. A helper checks a delivery's HMAC signature against the raw body, accepts either secret during a rotation, and refuses stale timestamps.
Every option the API takes can be passed, including ones newer than your client version: each client has an extra map that is merged into the request body as it is.

LangChain and LlamaIndex

  • LangChain: pip install langchain-urlpipe — four agent tools, a toolkit and a document loader. Setup and examples.
  • LlamaIndex: pip install llama-index-readers-urlpipe — a reader that loads pages as Markdown Documents. Setup and examples.

n8n

The community node n8n-nodes-urlpipe adds every operation to your workflows, and doubles as a tool for n8n's AI Agent. On a self-hosted n8n, install it from Settings → Community Nodes. Setup and examples.

Command-line tool

The urlpipe command puts every operation in your terminal and your scripts: results go to stdout and everything else to stderr, so they pipe cleanly. It is built on the Go client and released with it.

Install
# macOS and Linux (Homebrew)
brew install urlpipe/tap/urlpipe

# Windows (Scoop)
scoop bucket add urlpipe https://github.com/URLpipe/scoop-bucket
scoop install urlpipe

# Go
go install github.com/URLpipe/urlpipe-go/cmd/urlpipe@latest
Use
urlpipe login                                  # save your API key once
urlpipe markdown example.com > page.md
urlpipe screenshot https://example.com --width 390 --scale 2 -o mobile.png
urlpipe meta example.com | jq .title
urlpipe console "$PREVIEW_URL" --fail-on-errors    # exits 3 on a console error
urlpipe lighthouse "$PREVIEW_URL" --min-score 90    # exits 3 below the score

The last two make a CI check out of a deploy preview. Every command, flag and exit code is in the README, and binaries for every platform are on the releases page.

From an AI agent

Agents don't need a library at all: the hosted MCP server gives Claude, Cursor, VS Code and other clients the same operations as tools, with one token.