1.0.1 • Published 6 years ago

akinator-api v1.0.1

Weekly downloads
41
License
MIT
Repository
github
Last release
6 years ago

akinator-api

npm version License: MIT

An api for SupremeNewYork 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

RequirementVersion
Node^8.8.0
NPM^5.5.1

Installation

npm i akinator-api

Usage

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