Train Neo4J Website
curl --request POST \
--url https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"urls": [
"https://example.com"
],
"source": "website",
"max_crawl_pages": 1,
"max_crawl_depth": 0,
"dynamic_content_wait_secs": 5,
"actor": "apify/website-content-crawler",
"crawler_type": "cheerio"
}
'import requests
url = "https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/"
payload = {
"urls": ["https://example.com"],
"source": "website",
"max_crawl_pages": 1,
"max_crawl_depth": 0,
"dynamic_content_wait_secs": 5,
"actor": "apify/website-content-crawler",
"crawler_type": "cheerio"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
urls: ['https://example.com'],
source: 'website',
max_crawl_pages: 1,
max_crawl_depth: 0,
dynamic_content_wait_secs: 5,
actor: 'apify/website-content-crawler',
crawler_type: 'cheerio'
})
};
fetch('https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/', 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://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/",
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([
'urls' => [
'https://example.com'
],
'source' => 'website',
'max_crawl_pages' => 1,
'max_crawl_depth' => 0,
'dynamic_content_wait_secs' => 5,
'actor' => 'apify/website-content-crawler',
'crawler_type' => 'cheerio'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/"
payload := strings.NewReader("{\n \"urls\": [\n \"https://example.com\"\n ],\n \"source\": \"website\",\n \"max_crawl_pages\": 1,\n \"max_crawl_depth\": 0,\n \"dynamic_content_wait_secs\": 5,\n \"actor\": \"apify/website-content-crawler\",\n \"crawler_type\": \"cheerio\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"https://example.com\"\n ],\n \"source\": \"website\",\n \"max_crawl_pages\": 1,\n \"max_crawl_depth\": 0,\n \"dynamic_content_wait_secs\": 5,\n \"actor\": \"apify/website-content-crawler\",\n \"crawler_type\": \"cheerio\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"https://example.com\"\n ],\n \"source\": \"website\",\n \"max_crawl_pages\": 1,\n \"max_crawl_depth\": 0,\n \"dynamic_content_wait_secs\": 5,\n \"actor\": \"apify/website-content-crawler\",\n \"crawler_type\": \"cheerio\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Website training complete",
"rag_id": "6848ff3c4c291b4bef798e0c",
"pages_trained": 12
}{
"detail": "Invalid permission"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}API Reference
Train Neo4J Website
Crawl websites and generate a knowledge graph using Neo4J based on the provided URLs and crawl settings.
POST
/
knowledge_graph
/
neo4j
/
website
/
Train Neo4J Website
curl --request POST \
--url https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"urls": [
"https://example.com"
],
"source": "website",
"max_crawl_pages": 1,
"max_crawl_depth": 0,
"dynamic_content_wait_secs": 5,
"actor": "apify/website-content-crawler",
"crawler_type": "cheerio"
}
'import requests
url = "https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/"
payload = {
"urls": ["https://example.com"],
"source": "website",
"max_crawl_pages": 1,
"max_crawl_depth": 0,
"dynamic_content_wait_secs": 5,
"actor": "apify/website-content-crawler",
"crawler_type": "cheerio"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
urls: ['https://example.com'],
source: 'website',
max_crawl_pages: 1,
max_crawl_depth: 0,
dynamic_content_wait_secs: 5,
actor: 'apify/website-content-crawler',
crawler_type: 'cheerio'
})
};
fetch('https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/', 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://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/",
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([
'urls' => [
'https://example.com'
],
'source' => 'website',
'max_crawl_pages' => 1,
'max_crawl_depth' => 0,
'dynamic_content_wait_secs' => 5,
'actor' => 'apify/website-content-crawler',
'crawler_type' => 'cheerio'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/"
payload := strings.NewReader("{\n \"urls\": [\n \"https://example.com\"\n ],\n \"source\": \"website\",\n \"max_crawl_pages\": 1,\n \"max_crawl_depth\": 0,\n \"dynamic_content_wait_secs\": 5,\n \"actor\": \"apify/website-content-crawler\",\n \"crawler_type\": \"cheerio\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"urls\": [\n \"https://example.com\"\n ],\n \"source\": \"website\",\n \"max_crawl_pages\": 1,\n \"max_crawl_depth\": 0,\n \"dynamic_content_wait_secs\": 5,\n \"actor\": \"apify/website-content-crawler\",\n \"crawler_type\": \"cheerio\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rag-prod.studio.lyzr.ai/v4/knowledge_graph/neo4j/website/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"urls\": [\n \"https://example.com\"\n ],\n \"source\": \"website\",\n \"max_crawl_pages\": 1,\n \"max_crawl_depth\": 0,\n \"dynamic_content_wait_secs\": 5,\n \"actor\": \"apify/website-content-crawler\",\n \"crawler_type\": \"cheerio\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Website training complete",
"rag_id": "6848ff3c4c291b4bef798e0c",
"pages_trained": 12
}{
"detail": "Invalid permission"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Query Parameters
The ID of the RAG system to train
Body
application/json
List of website URLs to crawl
Example:
["https://example.com"]
Data source identifier
Example:
"website"
Maximum number of pages to crawl
Example:
1
Maximum crawl depth
Example:
0
Time to wait for dynamic content to load (in seconds)
Example:
5
Apify actor used for crawling
Example:
"apify/website-content-crawler"
Type of crawler used
Example:
"cheerio"
⌘I