Search graph
curl --request POST \
--url https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"mode": "lexical",
"resource_kinds": [
"node",
"edge"
],
"types": [
"<string>"
],
"resource_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"property_filters": [],
"limit": 20,
"rerank": "auto"
}
'import requests
url = "https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search"
payload = {
"query": "<string>",
"mode": "lexical",
"resource_kinds": ["node", "edge"],
"types": ["<string>"],
"resource_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"property_filters": [],
"limit": 20,
"rerank": "auto"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
mode: 'lexical',
resource_kinds: ['node', 'edge'],
types: ['<string>'],
resource_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
property_filters: [],
limit: 20,
rerank: 'auto'
})
};
fetch('https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/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://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'mode' => 'lexical',
'resource_kinds' => [
'node',
'edge'
],
'types' => [
'<string>'
],
'resource_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'property_filters' => [
],
'limit' => 20,
'rerank' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"mode\": \"lexical\",\n \"resource_kinds\": [\n \"node\",\n \"edge\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"resource_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"property_filters\": [],\n \"limit\": 20,\n \"rerank\": \"auto\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"mode\": \"lexical\",\n \"resource_kinds\": [\n \"node\",\n \"edge\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"resource_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"property_filters\": [],\n \"limit\": 20,\n \"rerank\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"mode\": \"lexical\",\n \"resource_kinds\": [\n \"node\",\n \"edge\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"resource_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"property_filters\": [],\n \"limit\": 20,\n \"rerank\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"mode": "lexical",
"effective_mode": "lexical",
"lexical": {
"readiness": "ready",
"coverage": "full",
"eligible_resources": 4503599627370495,
"ready_resources": 4503599627370495,
"excluded_resources": 4503599627370495,
"degradation": "none"
},
"semantic": {
"profile": {
"key": "<string>",
"digest": "<string>",
"provider": "<string>",
"model": "<string>",
"dimensions": 1536
},
"readiness": "ready",
"coverage": "full",
"eligible_resources": 4503599627370495,
"ready_resources": 4503599627370495,
"excluded_resources": 4503599627370495,
"query_embedding": "not_requested",
"degradation": "none"
},
"warnings": [
"lexical_coverage_partial"
],
"reranker": {
"requested": "auto",
"profile_revision": "<string>",
"applied": true,
"partial": true,
"provider": "<string>",
"model": "<string>",
"submitted_count": 4503599627370495,
"returned_count": 4503599627370495,
"fallback_reason": "reranker_disabled",
"fallback_cause": "rate_limited"
},
"hits": [
{
"resource_kind": "node",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 123,
"type": "<string>",
"display": "<string>",
"snippet": "<string>",
"rank": 123,
"lexical_rank": 4503599627370495,
"lexical_score": 1,
"semantic_rank": 4503599627370495,
"semantic_score": 123,
"rrf_score": 1,
"fallback_provenance": "deterministic_source_text",
"resource_url": "<string>",
"base_rank": 123,
"rerank_score": 123
}
]
}
}Search and citations
Search graph
Search the project graph for nodes and edges.
Search graph
curl --request POST \
--url https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"mode": "lexical",
"resource_kinds": [
"node",
"edge"
],
"types": [
"<string>"
],
"resource_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"property_filters": [],
"limit": 20,
"rerank": "auto"
}
'import requests
url = "https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search"
payload = {
"query": "<string>",
"mode": "lexical",
"resource_kinds": ["node", "edge"],
"types": ["<string>"],
"resource_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"property_filters": [],
"limit": 20,
"rerank": "auto"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
mode: 'lexical',
resource_kinds: ['node', 'edge'],
types: ['<string>'],
resource_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
property_filters: [],
limit: 20,
rerank: 'auto'
})
};
fetch('https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/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://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'mode' => 'lexical',
'resource_kinds' => [
'node',
'edge'
],
'types' => [
'<string>'
],
'resource_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'property_filters' => [
],
'limit' => 20,
'rerank' => 'auto'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"mode\": \"lexical\",\n \"resource_kinds\": [\n \"node\",\n \"edge\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"resource_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"property_filters\": [],\n \"limit\": 20,\n \"rerank\": \"auto\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"mode\": \"lexical\",\n \"resource_kinds\": [\n \"node\",\n \"edge\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"resource_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"property_filters\": [],\n \"limit\": 20,\n \"rerank\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pnbr.io/v1/orgs/{org}/projects/{project}/graph/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"mode\": \"lexical\",\n \"resource_kinds\": [\n \"node\",\n \"edge\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"resource_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"property_filters\": [],\n \"limit\": 20,\n \"rerank\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"mode": "lexical",
"effective_mode": "lexical",
"lexical": {
"readiness": "ready",
"coverage": "full",
"eligible_resources": 4503599627370495,
"ready_resources": 4503599627370495,
"excluded_resources": 4503599627370495,
"degradation": "none"
},
"semantic": {
"profile": {
"key": "<string>",
"digest": "<string>",
"provider": "<string>",
"model": "<string>",
"dimensions": 1536
},
"readiness": "ready",
"coverage": "full",
"eligible_resources": 4503599627370495,
"ready_resources": 4503599627370495,
"excluded_resources": 4503599627370495,
"query_embedding": "not_requested",
"degradation": "none"
},
"warnings": [
"lexical_coverage_partial"
],
"reranker": {
"requested": "auto",
"profile_revision": "<string>",
"applied": true,
"partial": true,
"provider": "<string>",
"model": "<string>",
"submitted_count": 4503599627370495,
"returned_count": 4503599627370495,
"fallback_reason": "reranker_disabled",
"fallback_cause": "rate_limited"
},
"hits": [
{
"resource_kind": "node",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 123,
"type": "<string>",
"display": "<string>",
"snippet": "<string>",
"rank": 123,
"lexical_rank": 4503599627370495,
"lexical_score": 1,
"semantic_rank": 4503599627370495,
"semantic_score": 123,
"rrf_score": 1,
"fallback_provenance": "deterministic_source_text",
"resource_url": "<string>",
"base_rank": 123,
"rerank_score": 123
}
]
}
}Operation ID:
http.graph.search
POST /v1/orgs/{org}/projects/{project}/graph/search
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required string length:
1 - 512Available options:
lexical, semantic, hybrid Required array length:
1 - 2 elementsAvailable options:
node, edge Required array length:
1 - 50 elementsRequired string length:
1 - 256Required array length:
1 - 100 elementsPattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Maximum array length:
8- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Required range:
1 <= x <= 100Available options:
auto, off, required Response
2XX - application/json
Success.
Show child attributes
Show child attributes