SDKs
Official Node.js and Python clients for the Peep API.
Skip the boilerplate with a typed client. Both SDKs wrap every endpoint, surface your Peep Card balance after each call, and provide *AndWait helpers that poll async jobs to completion.
Node.js
Install with any package manager — they all resolve from the npm registry:
bash
npm install @shownomore/peep-sdkjavascript
import { Peep } from "@shownomore/peep-sdk";
const peep = new Peep({ apiKey: process.env.PEEP_API_KEY });
const res = await peep.scrape("https://example.com", {
formats: ["markdown"],
});
console.log(res.data.markdown);
console.log(peep.lastCredits); // { used: 1, remaining: 499 }
// Async jobs — poll to completion automatically
const crawl = await peep.crawlAndWait("https://example.com", { limit: 50 });Python
Install from PyPI with pip, Poetry, or uv:
bash
pip install peep-sdkpython
import os
from peep import Peep
peep = Peep(api_key=os.environ["PEEP_API_KEY"])
res = peep.scrape("https://example.com", formats=["markdown"])
print(res["data"]["markdown"])
print(peep.last_credits) # {"used": 1, "remaining": 499}
# Async jobs — poll to completion automatically
crawl = peep.crawl_and_wait("https://example.com", limit=50)Errors & Credits
Non-2xx responses raise a typed error (
PeepError) with a code and status. After every call, the client exposes the credits used and remaining from the response headers.