Skip to main content
GET
/
v2
/
libs
/
search
Search for libraries
curl --request GET \
  --url https://your-instance.example.com/api/v2/libs/search \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://your-instance.example.com/api/v2/libs/search"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://your-instance.example.com/api/v2/libs/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/v2/libs/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://your-instance.example.com/api/v2/libs/search"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://your-instance.example.com/api/v2/libs/search")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://your-instance.example.com/api/v2/libs/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "results": [
    {
      "id": "/your-org/your-repo",
      "title": "Your Repo",
      "description": "Internal tooling docs",
      "totalSnippets": 150,
      "source": "Local (Private)",
      "trustScore": 10
    }
  ]
}
{
"error": "repoUrl is required"
}
{
"error": "Authentication required"
}
{
"error": "An unexpected error occurred"
}

Authorizations

Authorization
string
header
required

API key generated from Personal Settings. See Authentication.

Query Parameters

libraryName
string
required

Library name to search for (e.g., react, nextjs)

Required string length: 1 - 500
query
string
required

User's original question or task - used for relevance ranking

Required string length: 1 - 500

Response

Search results ranked by relevance

results
object[]
required

Matching libraries ranked by relevance