API Reference
API reference for CloneWebsite core extension and Web Application
Extension Messaging API
If you want to interact with the CloneWebsite extension from your own scripts, you can use Chrome's message passing API.
Start Clone Request
Send a clone command to the extension to force it to start capturing the current page.
// Send message to the extension (requires knowing the extension ID)
const EXTENSION_ID = "your-extension-id";
chrome.runtime.sendMessage(EXTENSION_ID, {
type: "START_CLONE",
payload: {
options: {
extractImages: true,
removeScripts: true,
inlineStyles: true
}
}
}, (response) => {
if (response.success) {
console.log("Clone process started");
} else {
console.error("Clone failed:", response.error);
}
});Parameter Description
extractImages(boolean): Whether to convert images into independent files, default istrue.removeScripts(boolean): Whether to remove all<script>tags, default istrue.inlineStyles(boolean): Whether to force compute styles and inline them, default istrue.
Web App REST API
The Web App provides a complete REST API for managing clone history. All endpoints that require authentication need to carry a Bearer Token in the Header.
Authentication
Authorization: Bearer <your-session-token>1. Get All Clone Records
GET /api/v1/clonesResponse Example:
{
"data": [
{
"id": "cln_123456",
"url": "https://example.com",
"title": "Example Domain",
"createdAt": "2023-10-27T10:00:00Z",
"sizeBytes": 1048576,
"downloadUrl": "https://storage.clonewebsite.app/cln_123456.zip"
}
],
"meta": {
"total": 1,
"page": 1
}
}2. Get Presigned Upload URL
Used by the extension to safely upload the generated ZIP package directly to cloud storage (like AWS S3 or Cloudflare R2) without passing through the application server.
POST /api/v1/upload/requestRequest Body:
{
"filename": "example-com.zip",
"contentType": "application/zip",
"size": 1048576
}Response Example:
{
"uploadUrl": "https://s3.region.amazonaws.com/bucket/path?signature=...",
"cloneId": "cln_123456",
"expiresIn": 3600
}3. Delete a Clone Record
DELETE /api/v1/clones/:idResponse Example:
{
"success": true,
"message": "Clone record deleted successfully"
}
CloneWebsite Docs