Search API
The Search API allows you to perform a semantic search on relevant chunks of data within your project. By using the search endpoint, you can retrieve a specified number of search results that match your query string.
Search
The Search endpoint provides a list of search results based on the query string provided.
API Route
GET /query/v1/search/
Example Usage
CURL
curl -X GET \
'<KAPA_API_ENDPOINT>/query/v1/search/' \
-H 'X-API-TOKEN: <KAPA_API_TOKEN>' \
-d 'query=<QUERY_STRING>&num_results=<NUMBER_OF_RESULTS>'
Request Parameters
Parameter | Type | Description |
---|---|---|
query | string | The query string to be searched |
num_results | int | The number of search results to return (optional, default is 10, must be between 1 and 50) |
include_source_names | string[] | The list of source names that should be included in the search result |
Response Structure
The response will be a JSON object with a key search_results
containing an array of search result objects. Each search result object will have the following keys:
Key | Type | Description |
---|---|---|
content | string | The content of the search result |
source_url | string | The URL of the source of the search result |
title | string | The title of the search result |
source_type | string | The type of the source of the search result |
These example requests demonstrate how to use the Search API to perform a semantic search within your project. By analyzing the search results, you can gain a better understanding of the data within your project.