From 611aa518d5e06eef8bad8da35a3cd86af8e6904e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 15 Sep 2026 08:05:28 +0000 Subject: [PATCH] docs: document public API errors Co-authored-by: william --- src/linkup/_client.py | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/linkup/_client.py b/src/linkup/_client.py index e02c2a7..68166d5 100644 --- a/src/linkup/_client.py +++ b/src/linkup/_client.py @@ -268,9 +268,12 @@ def search( LinkupInvalidRequestError: If the request parameters are invalid, including an invalid or missing structured_output_schema when output_type is "structured". LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. + LinkupPaymentRequiredError: If the endpoint requires x402 payment. LinkupInsufficientCreditError: If you have run out of credit. LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. LinkupNoResultError: If the search query did not yield any result. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ params: dict[str, str | bool | int | list[str]] = self._get_search_params( @@ -467,9 +470,12 @@ async def async_search( LinkupInvalidRequestError: If the request parameters are invalid, including an invalid or missing structured_output_schema when output_type is "structured". LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. + LinkupPaymentRequiredError: If the endpoint requires x402 payment. LinkupInsufficientCreditError: If you have run out of credit. LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. LinkupNoResultError: If the search query did not yield any result. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ params: dict[str, str | bool | int | list[str]] = self._get_search_params( @@ -547,8 +553,12 @@ def research( pydantic.BaseModel when provided. LinkupInvalidRequestError: If the request parameters are invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. + LinkupPaymentRequiredError: If the endpoint requires x402 payment. LinkupInsufficientCreditError: If you have run out of credit. LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. + LinkupTasksQueueLimitExceededError: If too many tasks are already pending or processing. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ params = self._get_research_params( @@ -619,8 +629,12 @@ async def async_research( pydantic.BaseModel when provided. LinkupInvalidRequestError: If the request parameters are invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. + LinkupPaymentRequiredError: If the endpoint requires x402 payment. LinkupInsufficientCreditError: If you have run out of credit. LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. + LinkupTasksQueueLimitExceededError: If too many tasks are already pending or processing. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ params = self._get_research_params( @@ -670,6 +684,7 @@ def list_research( Raises: LinkupInvalidRequestError: If the pagination or sorting parameters are invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = self._request( @@ -712,6 +727,7 @@ async def async_list_research( Raises: LinkupInvalidRequestError: If the pagination or sorting parameters are invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = await self._async_request( @@ -740,8 +756,10 @@ def get_research(self, research_id: str, timeout: float | None = None) -> Linkup The requested research task. Raises: + LinkupInvalidRequestError: If the research identifier is not a valid UUID. LinkupTaskNotFoundError: If the research identifier does not match an existing task. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = self._request( @@ -766,8 +784,10 @@ async def async_get_research( The requested research task. Raises: + LinkupInvalidRequestError: If the research identifier is not a valid UUID. LinkupTaskNotFoundError: If the research identifier does not match an existing task. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = await self._async_request( @@ -797,8 +817,11 @@ def create_tasks( an unsupported type. LinkupInvalidRequestError: If the task payload is invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupInsufficientCreditError: If you have run out of credit. + LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. LinkupTasksQueueLimitExceededError: If too many tasks are already pending or processing. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ response = self._request( @@ -830,8 +853,11 @@ async def async_create_tasks( an unsupported type. LinkupInvalidRequestError: If the task payload is invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupInsufficientCreditError: If you have run out of credit. + LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. LinkupTasksQueueLimitExceededError: If too many tasks are already pending or processing. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ response = await self._async_request( @@ -879,6 +905,7 @@ def list_tasks( LinkupInvalidRequestError: If the filtering, pagination, or sorting parameters are invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = self._request( @@ -932,6 +959,7 @@ async def async_list_tasks( LinkupInvalidRequestError: If the filtering, pagination, or sorting parameters are invalid. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = await self._async_request( @@ -962,8 +990,10 @@ def get_task(self, task_id: str, timeout: float | None = None) -> LinkupTask: The requested task, parsed according to its task type. Raises: + LinkupInvalidRequestError: If the task identifier is not a valid UUID. LinkupTaskNotFoundError: If the task identifier does not match an existing task. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = self._request( @@ -986,8 +1016,10 @@ async def async_get_task(self, task_id: str, timeout: float | None = None) -> Li The requested task, parsed according to its task type. Raises: + LinkupInvalidRequestError: If the task identifier is not a valid UUID. LinkupTaskNotFoundError: If the task identifier does not match an existing task. LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. LinkupTimeoutError: If the request times out. """ response = await self._async_request( @@ -1039,12 +1071,18 @@ def fetch( Raises: LinkupInvalidRequestError: If the provided URL is not valid. + LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. + LinkupPaymentRequiredError: If the endpoint requires x402 payment. + LinkupInsufficientCreditError: If you have run out of credit. + LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. LinkupFailedFetchError: If the provided URL can't be fetched. LinkupFetchResponseTooLargeError: If the fetch response is too large. LinkupFetchTargetNotFoundError: If the target URL is not found. LinkupFetchTargetUnreachableError: If the target URL cannot be reached. LinkupFetchUnsupportedContentTypeError: If the URL resolves to an unsupported content type. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ params: dict[str, Any] = self._get_fetch_params( @@ -1108,12 +1146,18 @@ async def async_fetch( Raises: LinkupInvalidRequestError: If the provided URL is not valid. + LinkupAuthenticationError: If the Linkup API key is invalid. + LinkupIpNotWhitelistedError: If the request IP is not allowed by the API key. + LinkupPaymentRequiredError: If the endpoint requires x402 payment. + LinkupInsufficientCreditError: If you have run out of credit. + LinkupBudgetLimitExceededError: If the API key has reached its configured budget limit. LinkupFailedFetchError: If the provided URL can't be fetched. LinkupFetchResponseTooLargeError: If the fetch response is too large. LinkupFetchTargetNotFoundError: If the target URL is not found. LinkupFetchTargetUnreachableError: If the target URL cannot be reached. LinkupFetchUnsupportedContentTypeError: If the URL resolves to an unsupported content type. + LinkupTooManyRequestsError: If the API rate limit is exceeded. LinkupTimeoutError: If the request times out. """ params: dict[str, Any] = self._get_fetch_params(