Index a website
Pass a page URL as content. Etoile extracts the text automatically.
import { Etoile } from "@etoile-dev/client";
const etoile = new Etoile({
apiKey: process.env.ETOILE_API_KEY,
});
await etoile.index({
id: "etoile-homepage",
collection: "pages",
title: "Etoile — AI search",
content: "https://etoile.dev",
});const response = await fetch("https://etoile.dev/api/v1/index", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ETOILE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
id: "etoile-homepage",
collection: "pages",
title: "Etoile — AI search",
content: "https://etoile.dev",
}),
});curl -X POST "https://etoile.dev/api/v1/index" \
-H "Authorization: Bearer $ETOILE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "etoile-homepage",
"collection": "pages",
"title": "Etoile — AI search",
"content": "https://etoile.dev"
}'Related
- Index document (POST) — content types
- Index an image — index images
- Index text — index plain text