Python SDK
Use the official venym-search client for synchronous and asynchronous Search, Scrape, and health calls.
Install
Python 3.10+ is required. The client defaults to
https://search.venym.io and sends Authorization: Bearer <your-api-key>.Typed models
Pydantic request and response types.
Sync + async
Use VenymSearch or AsyncVenymSearch.
Contract aligned
Search, Scrape, and health only.
Installation
pipcURL
pip install venym-searchSynchronous Search
VenymSearch.search()Python
import os
from venym_search import VenymSearch
with VenymSearch(api_key=os.environ["VENYM_SEARCH_API_KEY"]) as client:
result = client.search(
"latest AI developments",
max_results=5,
)
for item in result.search_results:
print(item.title, item.link)
print(result.credits_used, result.remaining_credits)Synchronous Scrape
VenymSearch.scrape()Python
from venym_search import VenymSearch
with VenymSearch(api_key=os.environ["VENYM_SEARCH_API_KEY"]) as client:
result = client.scrape(
"https://example.com",
extract_options=["title", "text", "links", "metadata"],
)
print(result.primary_content.title)
print(result.primary_content.text)The response is nested under primary_content. There is no batch-scrape method in v2; coordinate bounded scrape() calls yourself.
Async Usage
AsyncVenymSearchPython
import asyncio
import os
from venym_search import AsyncVenymSearch
async def main():
async with AsyncVenymSearch(api_key=os.environ["VENYM_SEARCH_API_KEY"]) as client:
result = await client.search("python async tutorial", max_results=5)
print(result.search_results[0].title)
asyncio.run(main())Error Handling
Typed errorsPython
from venym_search import (
AuthenticationError,
RateLimitError,
VenymSearch,
VenymSearchError,
)
try:
with VenymSearch(api_key=os.environ["VENYM_SEARCH_API_KEY"]) as client:
client.search("test")
except AuthenticationError:
print("Invalid API key")
except RateLimitError as error:
print("Retry after:", error.retry_after)
except VenymSearchError as error:
print(error.status_code, error)For raw HTTP examples and the validation endpoint, see the REST reference.