{"id":18572698,"url":"https://github.com/botblock/blapi","last_synced_at":"2025-04-06T18:13:58.195Z","repository":{"id":35035628,"uuid":"143175128","full_name":"botblock/BLAPI","owner":"botblock","description":"A package to handle posting your discord bot stats to all botlists [Typescript (and JavaScript) - maintained by @maybeanerd]","archived":false,"fork":false,"pushed_at":"2025-04-05T01:31:48.000Z","size":1357,"stargazers_count":32,"open_issues_count":6,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T02:25:48.967Z","etag":null,"topics":["api","apikeys","blapi","bot-lists","botblock-api","botlist","botlistapi","discord","discord-api","discord-bot","discord-bot-stats","discord-bots","discord-js","discordbot","discordbotlist","discordjs","hacktoberfest","stats","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"T0TProduction","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-08-01T15:31:32.000Z","updated_at":"2025-04-03T01:52:31.000Z","dependencies_parsed_at":"2023-09-24T03:02:51.414Z","dependency_job_id":"596b20ea-d45b-474d-aaf5-ac2bfac5ded9","html_url":"https://github.com/botblock/BLAPI","commit_stats":{"total_commits":390,"total_committers":19,"mean_commits":"20.526315789473685","dds":0.4641025641025641,"last_synced_commit":"7aca477a9b66e38139d03d681f4410a0c3ba39db"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botblock%2FBLAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botblock%2FBLAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botblock%2FBLAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botblock%2FBLAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botblock","download_url":"https://codeload.github.com/botblock/BLAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526753,"owners_count":20953143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","apikeys","blapi","bot-lists","botblock-api","botlist","botlistapi","discord","discord-api","discord-bot","discord-bot-stats","discord-bots","discord-js","discordbot","discordbotlist","discordjs","hacktoberfest","stats","typescript","typescript-library"],"created_at":"2024-11-06T23:06:59.403Z","updated_at":"2025-04-06T18:13:58.174Z","avatar_url":"https://github.com/botblock.png","language":"TypeScript","readme":"# BLAPI - the BotListAPI\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![npm downloads](https://img.shields.io/npm/dt/blapi.svg)](https://nodei.co/npm/blapi/) [![install size](https://packagephobia.now.sh/badge?p=blapi)](https://packagephobia.now.sh/result?p=blapi)\n[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/blapi/badge?style=rounded)](https://www.jsdelivr.com/package/npm/blapi)\n\n[![nodei](https://nodei.co/npm/blapi.png)](https://nodei.co/npm/blapi/)\n\nBLAPI is a fully typed package to handle posting your discord bot stats to botlists.\n\nIt's intended to be used with discord.js v13 or v14, though you can also manually post your stats.\n\nBLAPI fully supports external and discord.js internal sharding with and without the use of the [BotBlock API](https://botblock.org/api/docs#count).\n\n## Installation\n\n### NPM (recommended)\n\n```bash\nnpm i blapi\n```\n\n### Yarn\n\n```bash\nyarn add blapi\n```\n\n## Usage\n\nThe list of all supported bot lists and their respective names for the apiKeys object are listed [below](https://github.com/T0TProduction/BLAPI#lists)\n\n### Import the lib via ES6 or commonJS modules\n\n```js\n// ES6\nimport * as blapi from \"blapi\";\n// or\nimport { handle } from \"blapi\"; // Just the functions you want to use\n// or commonJS\nconst blapi = require(\"blapi\");\n```\n\n### With discord.js (version 13.x or 14.x)\n\n```js\nimport Discord from \"discord.js\";\n\nconst bot = new Discord.Client();\n\n// Post to the APIs every 60 minutes; you can leave out the repeat delay as it defaults to 30\n// If the interval is below 3 minutes BLAPI will not use the BotBlock API because of ratelimits\nblapi.handle(bot, apiKeys, 60);\n```\n\n### Manually, without need of Discord libraries\n\n```js\n// If you want to post sharddata you can add the optional parameters\n// shardID and shardCount should both be integers\n// shardsArray should be an integer array containing the guildcounts of the respective shards\nblapi.manualPost(guildCount, botID, apiKeys[, shardID, shardCount[, shardsArray]]);\n```\n\n\n### Logging Options\n```js\n// Use this to set the level of logs you're interested in\n// By default, warnings and errors will be logged\nblapi.setLogging({\n  logLevel: LogLevel.All\n});\n```\n\n```js\n// If you have your own logger that you want to use pass it to BLAPI like this:\n// Important: The logger needs to include the following methods: log.info(), log.warn() and log.error()\nblapi.setLogging({\n  logger: yourCustomLogger\n})\n```\n\n### Turn off the use of the BotBlock API\n\n```js\n// Use this to turn off BotBlock usage\n// By default it is set to true\nblapi.setBotblock(false);\n```\n\n### apiKeys\n\nThe JSON object which includes all the API keys should look like this:\n\n```json\n{\n  \"bot list domain\": \"API key for that bot list\",\n  \"bot list domain\": \"API key for that bot list\"\n}\n```\n\nan example would be:\n\n```json\n{\n  \"bots.ondiscord.xyz\": \"dsag38_auth_token_fda6gs\",\n  \"discordbots.group\": \"qos56a_auth_token_gfd8g6\"\n}\n```\n\n## Lists\n\nBLAPI automatically supports posting to all lists that are [listed on botblock](https://botblock.org/api/docs#lists). For the rare case that their API is down, BLAPI has an [integrated fallback list](https://github.com/botblock/BLAPI/blob/master/src/fallbackListData.ts). This list is kept somewhat up to date inside the repository, but once BLAPI is running in your bot, it will update the internal fallback on a daily basis.\n\nSupported legacy Ids are supported in a similar fashion. BLAPI supports all [legacy IDs listed on botblock](https://botblock.org/api/docs#legacy-ids). The fallback legacy IDs can be found [here](https://github.com/botblock/BLAPI/blob/master/src/legacyIdsFallbackData.ts), and they are also internally updated on a daily basis once you have BLAPI up and running.\n\nIf at any time you find other bot lists have added an API to post your guildcount, let us know on this repo or by contacting T0TProduction#0001 on Discord. In general, if a list is not listed on BotBlock, the best way to get it added is to directly [join the BotBlock Discord server](https://botblock.org/discord) and request it there.\n\n## Development\n\nTo work on BLAPI, install the node version specified in [.nvmrc](https://github.com/botblock/BLAPI/blob/master/.nvmrc).\nIf you are using nvm on a unix based system, this can be done quickly by using `nvm use` and if the version is not installed, `nvm install`.\nInstall all the dependencies following the package-lock via `npm ci`.\n\nThis repo enforces eslint rules which are included in the installation.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://diluz.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/18548570?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSebastian Di Luzio\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/botblock/BLAPI/commits?author=T0TProduction\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-T0TProduction\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/botblock/BLAPI/commits?author=T0TProduction\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://advaith.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/11778454?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eadvaith\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/botblock/BLAPI/commits?author=advaith1\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/botblock/BLAPI/issues?q=author%3Aadvaith1\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://mattcowley.co.uk/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/12371363?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMatt Cowley\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/botblock/BLAPI/commits?author=MattIPv4\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/botblock/BLAPI/commits?author=MattIPv4\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/MeerBiene\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/60227302?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBenedikt Buhles\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/botblock/BLAPI/commits?author=MeerBiene\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://not-tech.support\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/10573728?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGlenn\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/botblock/BLAPI/commits?author=promise\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/botblock/BLAPI/issues?q=author%3Apromise\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://jonahsnider.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7608555?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJonah Snider\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/botblock/BLAPI/commits?author=jonahsnider\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","funding_links":["https://github.com/sponsors/T0TProduction"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotblock%2Fblapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotblock%2Fblapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotblock%2Fblapi/lists"}