nianyuguai / akinator-api

NodeJS API for Akinator with support for 15 regions/languages 🌎

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

akinator-api

npm version License: MIT

An api built to interact with Akinator based in NodeJS.

This package has many features that you may use to interact with the Akinator api. Below you will find information on how to install the package + the package's features. This package supports 15 different languages.

Requirements

Requirement Version
Node ^8.8.0
NPM ^5.5.1

Installation

npm i akinator-api

Usage

Region/Language List

us - English
de - German
fr - French
in - Hindi
es - Spanish
cn - Chinese
ar - Arabic
il - Hebrew
it - Italian
jp - Japanese
kr - Korean
nl - Dutch
pl - Polish
pt - Portuguese
ru - Russian
tr - Turkish

Start A Game

Sample JSON Response

{  
   "session":"20",
   "signature":"793609611",
   "question":"Is your character's gender female?",
   "answers":[  
      "0 - Yes",
      "1 - No",
      "2 - Don't know",
      "3 - Probably",
      "4 - Probably not"
   ]
}

Example Code for Start

const api = require('akinator-api');

api.start(region, (gamedata, error) => {
  if (error) {
    console.log(error);
  } else {
    console.log(gamedata);
  }
})

Answer a Question

Sample JSON Response

{  
   "nextquestion":"Is your character a youtuber?",
   "progress":"2.05700",
   "answers":[  
      "0 - Yes",
      "1 - No",
      "2 - Don't know",
      "3 - Probably",
      "4 - Probably not"
   ]
}

Example Code for Answer

const api = require('akinator-api');

api.answer(region, session, signature, answerid, step, (next, error) => {
  if (error) {

  } else {
    console.log(next);
    step++;
  }
})

TODO

  1. Completion Detection

About

NodeJS API for Akinator with support for 15 regions/languages 🌎


Languages

Language:JavaScript 100.0%