Skip to main content
No LangSearch-specific SDK is needed for a direct HTTP request. Select Python below, save the example as search.py, replace the key, and run python3 search.py.

Handle request failures

urlopen raises HTTPError for non-success HTTP responses. Read the response body for the error message and log_id; do not log request headers.
Use bounded retries for transient failures.