DEV Community

LucasX7
LucasX7

Posted on

I built an Akinator API that works in 2026 — with TypeScript and JavaScript, retry, and proxy support

I built an Akinator API that works in 2026

All existing Akinator packages on npm are broken. Cloudflare now blocks them with HTTP 403.

I built akinator-client — a TS/JS library that actually works.

The Problem

Every Akinator package on npm (aki-api, akinatorjs, node_akinator) uses axios or node-fetch. Cloudflare's JA3 TLS fingerprinting blocks them.
Error: Request failed with status code 403

The Solution

got-scraping — the only HTTP library that bypasses Cloudflare's TLS fingerprinting. It uses the same TLS library as Chrome, so Cloudflare can't tell the difference.

Quick Start

npm install akinator-client

import { AkinatorClient, Languages, Themes, Answers } from "akinator-client";

const akinator = new AkinatorClient({
  language: Languages.EN,
  theme: Themes.ANIMALS
});

await akinator.start();

console.log(akinator.question); // "Is your character real?"

await akinator.answer(Answers.YES);
console.log(akinator.progress); // 45.2

await akinator.back();

await akinator.continue();

const winner = await akinator.submitWin();
console.log(winner.name);
console.log(winner.description);
console.log(winner.photo);
Enter fullscreen mode Exit fullscreen mode

Features

16 languages — EN, AR, CN, DE, ES, FR, IL, IT, JP, KR, NL, PL, PT, RU, TR, ID
3 themes — Characters, Animals, Objects
TypeScript — Full type definitions
ESM + CJS — Works in any project
Automatic retry — 3 retries with exponential backoff
Proxy support — HTTP/HTTPS/SOCKS5 proxies
Child mode — Filter NSFW questions
Localized answers — Answer labels in your language

API

const client = new AkinatorClient({
  language: Languages.EN,
  theme: Themes.CHARACTERS,
  childMode: false,
  proxy: "http://proxy:8080",
  retries: 3
});

await client.start();           // Start new game
await client.answer(Answers.NO); // Answer question
await client.back();            // Go back
await client.continue();        // Continue after wrong guess
await client.submitWin();       // Win the game

// Properties
client.question;
client.progress;
client.step;
client.guessCount;
client.players;
Enter fullscreen mode Exit fullscreen mode

Why not just use got-scraping directly?

got-scraping is ESM-only. This library uses dynamic import() to load it, so it works in both ESM and CJS projects.

Stats

1 dependency (got-scraping)
4.7 MB installed
9.7 kB packed

Compare to the broken alternatives:
aki-api — 5 deps, 21 MB, broken
akinatorjs — 1 dep, 11 MB, broken

Links

npm: https://www.npmjs.com/package/akinator-client
GitHub: https://github.com/Lucas7X7/akinator-client
Issues: https://github.com/Lucas7X7/akinator-client/issues

Found this helpful? ⭐ Star the repo or open an issue if you find bugs.

Top comments (0)