const response = await fetch("https://back.tilion.dev/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TILION_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ query: "chrome devtools protocol", count: 3 }),
signal: AbortSignal.timeout(70_000),
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
if (result.status !== "ok") throw new Error(JSON.stringify(result));
for (const item of result.results) console.log(item.title, item.url);