Skip to main content
POST
/
ai-agents
/
agent-builder
/
knowledge-base
/
website
/
individual-page
Scrape Single Page
curl --request POST \
  --url https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "url": "https://docs.example.com/getting-started",
  "timeout": 30000,
  "format": "markdown"
}
'
import requests

url = "https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page"

payload = {
"url": "https://docs.example.com/getting-started",
"timeout": 30000,
"format": "markdown"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://docs.example.com/getting-started',
timeout: 30000,
format: 'markdown'
})
};

fetch('https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page', 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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page",
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://docs.example.com/getting-started',
'timeout' => 30000,
'format' => 'markdown'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page"

payload := strings.NewReader("{\n \"url\": \"https://docs.example.com/getting-started\",\n \"timeout\": 30000,\n \"format\": \"markdown\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("apikey", "<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://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://docs.example.com/getting-started\",\n \"timeout\": 30000,\n \"format\": \"markdown\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/website/individual-page")

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

request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://docs.example.com/getting-started\",\n \"timeout\": 30000,\n \"format\": \"markdown\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Page scraped successfully",
  "data": {
    "url": "https://docs.example.com/getting-started",
    "title": "Getting Started Guide",
    "description": "Learn how to get started with our platform",
    "content": "# Getting Started\n\nWelcome to our platform...",
    "metadata": {
      "og": {},
      "twitter": {},
      "canonical": "",
      "language": "en"
    },
    "scraper": "Firecrawl",
    "crawlDuration": 2500,
    "contentLength": 1024,
    "timestamp": "2025-12-05T17:30:00Z"
  }
}
For the complete error reference, see Error Guide.

Authorizations

apikey
string
header
required

API Key (i.e. Rest API Key from the Dashboard).

Body

application/json

Single page scraping configuration

url
string
required

Target page URL to crawl and extract content from

Example:

"https://docs.example.com/getting-started"

timeout
number
default:30000

Request timeout in milliseconds

Required range: 5000 <= x <= 120000
Example:

30000

format
enum<string>
default:markdown

Extract content in specific format

Available options:
markdown,
html,
text
Example:

"markdown"

Response

200 - application/json

Page scraped successfully

success
boolean
Example:

true

message
string
Example:

"Page scraped successfully"

data
object