Skip to content

Instantly share code, notes, and snippets.

@LucasOe
Created May 5, 2024 09:26
Show Gist options
  • Save LucasOe/04e16ab16e85a0299845e8f73b59c96f to your computer and use it in GitHub Desktop.
Save LucasOe/04e16ab16e85a0299845e8f73b59c96f to your computer and use it in GitHub Desktop.
Bulk remove domains from kagi.com
const auth = "AUTH_TOKEN";
const domains = ["example.com"];
async function remove() {
for (const domain of domains) {
const res = await fetch("https://kagi.com/esr/user_rules/delete", {
"credentials": "include",
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Content-Type": "application/x-www-form-urlencoded",
"Sec-GPC": "1",
"Alt-Used": "kagi.com",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-User": "?1",
"Authorization": auth,
},
"referrer": "https://kagi.com/settings?p=user_ranked",
"body": `kind=3&domain=${domain}`,
"method": "POST",
"mode": "cors",
});
console.log(res);
await new Promise((resolve) => setTimeout(resolve, 200));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment