Search API Documentation
This page documents the usage of the LLM search API endpoint.
Endpoint: `/api/search-llms`
Method: GET
This endpoint allows you to search through the available LLM metadata based on a query string.
Query Parameters
-
q
(required): The search term to query against LLM titles and summaries. -
fileType
(optional): Filters the search based on source file type. Allowed values:'llms.txt'
,'llms-full.txt'
,'both'
. Defaults to'both'
. (Note: Current implementation searches all JSON data regardless of this parameter, but it is validated). -
page
(optional): The page number for pagination. Must be a positive integer. Defaults to1
. -
limit
(optional): The maximum number of results per page. Must be a positive integer. Defaults to10
, maximum allowed is50
.
Example Request
Search for "example model" on page 2 with 5 results per page:
GET /api/search-llms?q=example%20model&page=2&limit=5
Example Response (Success - 200 OK)
{
"totalResults": 15,
"page": 2,
"limit": 5,
"results": [
{
"url": "https://example.com/model-a",
"domain": "example.com",
"title": "Example Model A",
"summary": "An example language model.",
"last_updated": "2024-01-15"
},
{
"url": "https://example.org/model-b",
"domain": "example.org",
"title": "Example Model B",
"summary": "Another example language model.",
"last_updated": "2024-02-20"
}
// ... more results up to the limit
]
}
Example Response (Error - 400 Bad Request)
{
"error": "Missing or empty search query parameter "q"."
}
{
"error": "Invalid page parameter. Must be a positive integer."
}