All URIs are relative to https://kagi.com/api/v1
| Method | HTTP request | Description |
|---|---|---|
| search | POST /search | Perform a search of the web. |
Search200Response search(search_request)
Perform a search of the web.
- Bearer Authentication (kagi):
import openapi_client
from openapi_client.models.search200_response import Search200Response
from openapi_client.models.search_request import SearchRequest
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://kagi.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "https://kagi.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: kagi
configuration = openapi_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.SearchApi(api_client)
search_request = {"query":"steve jobs","workflow":"search"} # SearchRequest | Contains the search query to run
try:
# Perform a search of the web.
api_response = api_instance.search(search_request)
print("The response of SearchApi->search:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SearchApi->search: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| search_request | SearchRequest | Contains the search query to run |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
| 401 | Access token is missing or invalid | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]