Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.71 KB

File metadata and controls

91 lines (63 loc) · 2.71 KB

openapi_client.SearchApi

All URIs are relative to https://kagi.com/api/v1

Method HTTP request Description
search POST /search Perform a web search

search

Search200Response search(search_request)

Perform a web search

Example

  • 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 | 

    try:
        # Perform a web search
        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)

Parameters

Name Type Description Notes
search_request SearchRequest

Return type

Search200Response

Authorization

kagi

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/markdown

HTTP response details

Status code Description Response headers
200 Success -
400 Invalid request parameters -
401 Access token is missing or invalid -
403 Forbidden - IP address not authorized -
429 Rate limited or usage limit exhausted -
500 Internal server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]