Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

dhanuprys/brainly-api

BrainlyAPI ๐ŸŒฉ๏ธ

brainly-api logo

NPM Downloads GitHub all releases Travis CI Github Action NPM npm (tag) GitHub last commit Circle CI Lerna

Now some commands have been divided into sections and must be installed separately

Now you can use "find question highlight" to search for the highlighted questions

Notes โ€ผ๏ธ

  • This is not the official library from brainly.com
  • This version is not stable yet
  • This library is still under development
  • PLEASE DO NOT USE THIS LIBRARY FOR NEGATIVE PURPOSE โš ๏ธ โ€ผ๏ธ
  • What about documentation? The documentation will be generated as soon as some library components are ready to use

Let's Try with Experimental Mode ๐Ÿ˜Ž

const { BrainlyAPI, Server } = require('brainly-api');

BrainlyAPI.startWorker({ experimental: true, server: Server.ID }, async brainly => {
  // find question
  console.log(await brainly.findQuestion('Indonesian!!'));
});

List of Available Locations ๐Ÿ“

Example:

const { Server } = require('brainly-api');

Server.{Code}
Code Name Refers to
PL Poland ๐Ÿ‡ต๐Ÿ‡ฑ brainly.pl
RU Russian Federation (the) znanija.com
ES Spain brainly.lat
PT Portugal ๐Ÿ‡ต๐Ÿ‡น brainly.com.br
TR Turkey eodev.com
RO Romania ๐Ÿ‡ท๐Ÿ‡ด brainly.ro
ID Indonesia ๐Ÿ‡ฎ๐Ÿ‡ฉ brainly.co.id
HI India ๐Ÿ‡ฎ๐Ÿ‡ณ brainly.in
PH Philippines (the) ๐Ÿ‡ต๐Ÿ‡ญ brainly.ph
US United States of America (the) ๐Ÿ‡บ๐Ÿ‡ธ brainly.com (deprecated)

Source โ„น๏ธ : https://www.iban.com/country-codes

List of Features ๐Ÿ˜ฒ

All the features below can only be used anonymously (temporarily disabled in auth mode) ๐Ÿ˜ฟ.

All the available features are still under development and will continue to be improved.

Feature Method Status
Find question findQuestion โœ”๏ธ
Find question by id โŒ โŒ
Find question highlight findQuestionHighlight โœ”๏ธ
Fetch user profile fetchUserProfile โœ”๏ธ

Using CLI Tools ๐Ÿ’ป

$ npx brainly-api

Brainly API Tools (@brainly-api-tools) โ€ผ๏ธ

Brainly api makes helper tools to simplify the development process. Here is a list of tools that can be used:

Enable Random User Agents โ“

The random user agent can be activated by installing the random-useragent library.

API

AnonymousWorker

AnonymousWorker.findQuestion(question: string)

Used to search for questions based on the server and search queries.

AnonymousWorker.findQuestionById(id: string)

Used to search for questions based on the server and id.

AnonymousWorker.fetchUserProfile(userId: string)

Under development

AnonymousWorker.findQuestionHighlight(lesson: number)

Used to search for highlight questions based on the server and lesson type.

Troubleshooting ๐Ÿ˜ 

Deploy to the server

Many people say that brainly-api has problems when deploying to Heroku. This was not caused by a flaw in the program, but from the security of the Brainly itself. They use Cloudflare for security. As another experiment, brainly-api works well with Microsoft Azure. If you have any suggestions for deploying brainly-api for free, you can do a pull request.

US Server restricted anywhere

Usually, many people ask why when the test on localhost is running well while on hosting it gives a 403 error. However, in this case, if you use US as the server then it will not work well on local and hosting. This is due to the security of Cloudflare.

Who Uses it โ“

Currently no project names are displayed. If you want your project name included here, then contact me with the following format:

  • projectname: your project name
  • projectlink: your project link
  • projectlogo(optional): your project logo (600x400) or lower

Contact me โ˜Ž๏ธ

Code of Conduct ๐Ÿ‘ฅ

See code of conduct

Support My Other Project ๐Ÿ”—

Contributing ๐Ÿ“

Thank you for wanting to contribute to this project. The contribution page can be found on contribution page

License ๐Ÿ”“

Licensed under MIT License

See package license

Thanks for using brainly-api ๐Ÿ˜‰

About

Unofficial brainly.com API

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •