The Linkup Python SDK provides a client for interacting with the Linkup API, enabling capabilities like web search and content fetching for AI workflows. It supports both synchronous and asynchronous calls, manages authentication, and offers integration with the x402 payment protocol. The library is actively maintained with frequent releases, currently at version 0.13.0.
pip install linkup-sdkVerified import paths — ran on the pinned version, not inferred.
Initializes the LinkupClient and performs a basic search query, retrieving a sourced answer. It demonstrates how to handle the API key, preferably from an environment variable.
Review your exception handling blocks. Ensure you are catching `linkup.exceptions.LinkupAPIError` or more specific `linkup.exceptions` classes, and adapt to the new error structures if necessary.
Refactor your code to only use documented public interfaces (e.g., `from linkup import LinkupClient`). Avoid importing from modules prefixed with an underscore or located in internal subdirectories.
Use `async def` functions and `await client.async_search(...)` in an `asyncio` event loop for non-blocking operations.
Set `export LINKUP_API_KEY='your_api_key'` in your shell, or ensure `os.environ['LINKUP_API_KEY'] = 'your_api_key'` is called before `LinkupClient()`, or initialize with `LinkupClient(api_key='your_api_key')`.
Change the import statement to `from linkup import LinkupClient`.
Set the `LINKUP_API_KEY` environment variable, or pass `api_key='your_key_here'` when creating `LinkupClient`.
Implement exponential backoff and retry logic in your application. Review Linkup's rate limit documentation for details, or contact Linkup support to request a higher rate limit.
Consult the official Linkup SDK documentation or the GitHub repository's `CHANGELOG.md` for the correct parameter names and usage for your installed version. Parameter names and available options (e.g., `depth`, `output_type`) can evolve.