take it, meet Deno.
Run a standalone Deno script that can read only your take it key and connect only to take it's HTTPS endpoint.
Your first connection.
- 01
Set TAKEIT_API_KEY in your shell and save the example below as takeit.ts.
- 02
Run deno run --allow-env=TAKEIT_API_KEY --allow-net=takeit.waggle.ae takeit.ts.
- 03
Read the response and credits header. If you change the take it hostname, update the scoped network permission too.
Tool reference: Deno documentation ↗
Build the request.
Set the environment variables in your terminal for these code examples. In automation tools, enter the URL and credentials in the tool’s own fields.
const apiKey = Deno.env.get("TAKEIT_API_KEY");
if (!apiKey) throw new Error("Set TAKEIT_API_KEY");
const response = await fetch("https://takeit.waggle.ae/api/takeit/v1/scrape", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ url: "https://example.com" }),
signal: AbortSignal.timeout(45000),
});
const result: unknown = await response.json();
if (!response.ok) {
throw new Error(`take it HTTP ${response.status}: ${JSON.stringify(result)}`);
}
console.log("Credits used:", response.headers.get("X-TakeIt-Credits-Used") ?? response.headers.get("X-Waggle-Credits-Used"));
console.log(result);
export {};Reading or copying this example does not send a request or use credits.