Official Python SDK for the Peep web scraping API — scrape, crawl, map, search, extract, and agent.
Project description
peep-sdk (Python)
Official Python SDK for the Peep web scraping API. Scrape, crawl, map, search, extract, and run autonomous agents. Every call draws from your shared Peep Card credit balance.
Install
From PyPI with pip, Poetry, or uv:
pip install peep-sdk
poetry add peep-sdk
uv add peep-sdk
Usage
import os
from peep import Peep
peep = Peep(api_key=os.environ["PEEP_API_KEY"])
# Scrape a page to markdown
res = peep.scrape("https://example.com", formats=["markdown"])
print(res["data"]["markdown"])
print(peep.last_credits) # {"used": 1, "remaining": 499}
# Crawl a site and wait for completion
crawl = peep.crawl_and_wait("https://example.com", limit=50)
# Search the web
hits = peep.search("best web scraping api", limit=10)
# AI structured extraction
data = peep.extract_and_wait(
["https://example.com"],
prompt="Extract the company name and pricing tiers.",
)
# Autonomous harvesting
leads = peep.agent_and_wait(
"Find flats for rent in Vivek Vihar with phone numbers and photos",
maxSources=10,
)
# Check your balance
print(peep.credits()["balance"])
Option keyword arguments are passed through verbatim — use the API's camelCase names, e.g.
peep.scrape(url, onlyMainContent=True).
Methods
| Method | Endpoint | Notes |
|---|---|---|
scrape(url, **options) |
POST /scrape |
Sync. Pass a YouTube URL for video intelligence. |
youtube(url) |
POST /scrape |
Sugar for YouTube videos. |
map(url, **options) |
POST /map |
Sync URL discovery. |
search(query, **options) |
POST /search |
Sync. |
crawl(...) / crawl_and_wait(...) |
POST /crawl |
Async; *_and_wait polls to completion. |
batch_scrape(...) / batch_scrape_and_wait(...) |
POST /batch/scrape |
Async. |
extract(...) / extract_and_wait(...) |
POST /extract |
Async. |
agent(...) / agent_and_wait(...) |
POST /agent |
Async. |
credits() |
GET /credits |
Free. Balance + ledger. |
Non-2xx responses raise PeepError with .status and .code. After every
call, peep.last_credits holds {"used", "remaining"} from the response
headers.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file peep_sdk-0.1.0.tar.gz.
File metadata
- Download URL: peep_sdk-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e77cb54fc031feeaa93fa61cdcebf2355870fe6ed2dc55a503adf43a5b532b21
|
|
| MD5 |
5b9f00b99be9d35613544eaeba6c7ea1
|
|
| BLAKE2b-256 |
47ea7275a4ec689b86083123ec0f3207c39f69b60fe125630d22f6d25c22ace0
|
File details
Details for the file peep_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: peep_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
857933c81fd3a9b3cb55f4d58f46535c25f8e781ef5fb7886c6e4285892b5d42
|
|
| MD5 |
80306f4fc290d99500ea73b36cc35b54
|
|
| BLAKE2b-256 |
b5978eb11c835966ab06489c3013b927b31645c60416b658e14513a4d298526a
|