{"id":7373,"library":"linkup-sdk","title":"Linkup Python SDK","description":"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.","status":"active","version":"0.13.0","language":"en","source_language":"en","source_url":"https://github.com/LinkupPlatform/linkup-python-sdk","tags":["API client","web search","data extraction","AI","RAG","LLM"],"install":[{"cmd":"pip install linkup-sdk","lang":"bash","label":"Basic Installation"},{"cmd":"pip install linkup-sdk[x402]","lang":"bash","label":"With x402 Payment Protocol Support"}],"dependencies":[{"reason":"Optional: For loading API keys from .env files.","package":"python-dotenv","optional":true}],"imports":[{"note":"The top-level package for import is `linkup`, not `linkup_sdk`.","wrong":"from linkup_sdk import LinkupClient","symbol":"LinkupClient","correct":"from linkup import LinkupClient"}],"quickstart":{"code":"import os\nfrom linkup import LinkupClient\n\n# Ensure LINKUP_API_KEY environment variable is set or pass directly\napi_key = os.environ.get('LINKUP_API_KEY', '')\nif not api_key:\n    print(\"Warning: LINKUP_API_KEY environment variable not set. Please set it or pass 'api_key' to LinkupClient.\")\n    # For demonstration, you might want to exit or use a placeholder, \n    # but for actual use, a valid key is required.\n    # For example: api_key = 'YOUR_ACTUAL_API_KEY'\n\ntry:\n    client = LinkupClient(api_key=api_key)\n    response = client.search(\n        query=\"What are the benefits of using an LLM in a RAG system?\",\n        depth=\"standard\",\n        output_type=\"sourcedAnswer\"\n    )\n    print(response.answer)\n    for source in response.sources:\n        print(f\"- {source.name}: {source.url}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"Internal error handling logic was moved in v0.12.0. If you were relying on catching specific internal exceptions or inspecting their structure, your code might break.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"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.","message":"Internal modules were made private in v0.8.0. Direct imports from `linkup._internal.*` or similar paths are no longer supported and will raise an `ImportError` or `AttributeError`.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Use `async def` functions and `await client.async_search(...)` in an `asyncio` event loop for non-blocking operations.","message":"For optimal performance in production environments, especially when making multiple API calls, consider using the asynchronous client methods (e.g., `async_search` instead of `search`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"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')`.","message":"The Linkup API Key is crucial for authentication. It must be provided either via the `LINKUP_API_KEY` environment variable or passed directly as the `api_key` argument to the `LinkupClient` constructor.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change the import statement to `from linkup import LinkupClient`.","cause":"Attempting to import `LinkupClient` from `linkup_sdk` instead of `linkup`.","error":"ImportError: cannot import name 'LinkupClient' from 'linkup_sdk'"},{"fix":"Set the `LINKUP_API_KEY` environment variable, or pass `api_key='your_key_here'` when creating `LinkupClient`.","cause":"The Linkup API key was not found in environment variables nor passed during client initialization.","error":"linkup.exceptions.AuthenticationError: Missing API key. Please provide it as an environment variable (LINKUP_API_KEY) or pass it directly to the LinkupClient constructor."},{"fix":"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.","cause":"Too many API requests were made within a short period, exceeding the allocated rate limit.","error":"linkup.exceptions.LinkupAPIError: Rate limit exceeded. Please wait before making further requests or contact support for higher limits."},{"fix":"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.","cause":"Attempting to use a parameter name that either does not exist or has been renamed in a newer version of the SDK.","error":"TypeError: LinkupClient.search() got an unexpected keyword argument 'source_filter'"}]}