Prerequisites
The following example requires therequests and openai libraries:
SERPLY_API_KEY environment variable. Get your key at serply.io; the toolkit sends it as the X-Api-Key header.
Example
cookbook/91_tools/serply_tools.py
Toolkit Params
Toolkit Functions
Every failure — a missing key, an HTTP error, or an invalid response — is returned as a JSON error string, never raised.
Serply serves about ten organic results per page for web search and does not stitch pages, so
num_results above 10 still returns roughly 10 there; Scholar accepts up to 200. Each page costs one Serply credit, and rate limits depend on your Serply plan — see Serply’s docs.