0.1.4 • Published 3 years ago

brainly-client v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

🚀 Installation

Use the package manager npm to install brainly-client.

Simply run:

npm install brainly-client

💻 Quickstart

A simple example of usage:

const Client = require('brainly-client')
const brainly = new Client()

brainly.search('Test')
  .then(questions => {
    const question = questions[0]
    const answer = question.answers[0]

    console.log(question)
    console.log(answer)
  })

You can specify the number of questions you want to receive:

const Client = require('brainly-client')
const brainly = new Client()

brainly.search({ query: 'Test', first: 10 })
  .then(questions => {
    console.assert(questions.length <= 10)
  })

You can also define a different server (BR is default):

const Client = require('brainly-client')
const brainly = new Client({ server: 'ES' }) // Spain server

There are currently 9 servers you can use:

CountryCodeURL
SpainEShttps://brainly.lat
RomaniaROhttps://brainly.ro
IndiaHIhttps://brainly.in
PolandPLhttps://brainly.pl
PhilippinesPHhttps://brainly.ph
IndonesiaIDhttps://brainly.co.id
TurkeyTRhttps://eodev.com
RussiaRUhttps://znanija.com
BrazilBRhttps://brainly.com.br

⚠️ Be aware that some of them may be deprecated

📜 License

MIT