Discover pages
curl --request POST \
--url https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://help.example.com",
"maxDepth": 1
}
'import requests
url = "https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages"
payload = {
"url": "https://help.example.com",
"maxDepth": 1
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://help.example.com', maxDepth: 1})
};
fetch('https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages', 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.zeroruntime.ai/v1/knowledge-bases/discover-pages",
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([
'url' => 'https://help.example.com',
'maxDepth' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeroruntime.ai/v1/knowledge-bases/discover-pages"
payload := strings.NewReader("{\n \"url\": \"https://help.example.com\",\n \"maxDepth\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.zeroruntime.ai/v1/knowledge-bases/discover-pages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://help.example.com\",\n \"maxDepth\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://help.example.com\",\n \"maxDepth\": 1\n}"
response = http.request(request)
puts response.read_body{
"url": "https://help.example.com",
"maxDepth": 1,
"pages": [
{
"url": "https://help.example.com/",
"title": "Help center",
"depth": 0
},
{
"url": "https://help.example.com/billing",
"title": "Billing",
"depth": 1
}
],
"truncated": false,
"limit": 100
}{
"message": "Invalid payload",
"errors": {
"formErrors": [
"<string>"
],
"fieldErrors": {}
}
}{
"error": "<string>"
}{
"message": "URL is unreachable"
}Knowledge bases
Discover pages
Lists the pages on a site without creating anything. Pass the ones you want as source.config.pages to Create knowledge base.
POST
/
v1
/
knowledge-bases
/
discover-pages
Discover pages
curl --request POST \
--url https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://help.example.com",
"maxDepth": 1
}
'import requests
url = "https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages"
payload = {
"url": "https://help.example.com",
"maxDepth": 1
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://help.example.com', maxDepth: 1})
};
fetch('https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages', 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.zeroruntime.ai/v1/knowledge-bases/discover-pages",
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([
'url' => 'https://help.example.com',
'maxDepth' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zeroruntime.ai/v1/knowledge-bases/discover-pages"
payload := strings.NewReader("{\n \"url\": \"https://help.example.com\",\n \"maxDepth\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.zeroruntime.ai/v1/knowledge-bases/discover-pages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://help.example.com\",\n \"maxDepth\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeroruntime.ai/v1/knowledge-bases/discover-pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://help.example.com\",\n \"maxDepth\": 1\n}"
response = http.request(request)
puts response.read_body{
"url": "https://help.example.com",
"maxDepth": 1,
"pages": [
{
"url": "https://help.example.com/",
"title": "Help center",
"depth": 0
},
{
"url": "https://help.example.com/billing",
"title": "Billing",
"depth": 1
}
],
"truncated": false,
"limit": 100
}{
"message": "Invalid payload",
"errors": {
"formErrors": [
"<string>"
],
"fieldErrors": {}
}
}{
"error": "<string>"
}{
"message": "URL is unreachable"
}Authorizations
Your API token, sent raw (no Bearer prefix).
Body
application/json