API Documentation - Discord Bot Reviews

API Docs


We provide an API for Discord Bot Reviews.
All endpoints of this API support CORS.
Base URL: https://discordbotreviews.xyz/api

Introduction

Welcome to DBR API!
Our API will provide you information about bots, users and comment and so on.
Our API is completely free and usable by anyone, however some places may require authorization.
Any bugs or help needed? Contact us in the Discord server.

Endpoints


Getting a bot object by ID:

GET /bot/{bot.clientID}
Returns a bot object if client ID exists in database. Otherwise returns a 404 status.

Get a user object by ID:

GET /user/{user.id}
Returns a user object if client ID exists in database. Otherwise returns a 404 status.

Get all of the bot's comments

GET /bot/{bot.id}/comments
Returns all of the bot's comments in an object.

NOTE: This endpoint will not be usable if the bot has disabled comments.

Get a bot's widget

GET /widget/{bot.id}.png
ALTERNATE WIDGET
GET /widget/2/{bot.id}.png
Returns .png file of the widget

Post server count

POST /bot/{bot.id}/stats
Post your server count to our API. Requires Authorization header.

Get bot's ratings

GET /bot/${bot.id}/rating
Returns who liked & disliked the bot

NOTE: Rating data is publicly exposed by default, however, if only you would like to access this then check the 'voting' box on your bot's edit page



NOTE: If you have a vanity URL active, you can use that instead of ID on all bot endpoints.


Objects


Libraries



Name Language Author Description Last Updated (DD/MM/YYYY) Download Link
dbrlib Node.js RaZeFeiXX A small library to interact with our API. Check the download link for full information. 14/6/2019 Github
If you want to submit your own library, please contact us on the Discord Server.

Widgets


Widgets are a way to display your bot within another page.
NOTE: Widgets currently AREN'T working due to our issues. This may be fixed soon.
URL: https://discordbotreviews.xyz/api/widget/{bot.clientID}.png
Widgets will display the name, the owner, and the likes and dislikes of your bot.
To put in a widget on your website, put this into your website's HTML code where you'd like to place it.
<a href="https://discordbotreviews.xyz/bot/[Your bot's ID]"><img src="https://discordbotreviews.xyz/api/widget/[Your bot's ID]" height="175px" width="400px"></a>

It should look similar to this:


There's an alternate widget incase you didn't like the first one
URL: https://discordbotreviews.xyz/api/widget/2/{bot.clientID}.png

<a href="https://discordbotreviews.xyz/bot/[Your bot's ID]"><img src="https://discordbotreviews.xyz/api/widget/2/[Your bot's ID]" height="175px" width="464px"></a>


If you are getting any errors doing this, make sure that you typed in the correct Client ID. If you've confirmed that and it's still not working, please contact us on the Discord Server.

Customization


Widgets can be customized
Query Type Description Available for
header1 hexcolor (without #) The hex color of the top header Both widgets
header2 hexcolor (without #) The hex color of the bottom header Both widgets
body hexcolor (without #) The hex color of the center body Both widgets
removeowneravatar boolean set to 'true' to remove the bot owner's avatar from the widget Both widgets
hideicon boolean set to 'true' to hide the server icon from the widget Both widgets
hidelikes boolean set to 'true' to hide the number of likes from the widget Both widgets
hidedislikes boolean set to 'true' to hide the number of dislikes from the widget Both widgets
hidecomments boolean set to 'true' to hide the number of comments from the widget Both widgets
hideservers boolean set to 'true' to hide the server count from the widget Both widgets
gradient1 hexcolor (without #) Configure the bottom gradient color of the boxes Only for alternate widget (2)
gradient2 hexcolor (without #) Configure the top gradient color of the boxes Only for alternate widget (2)

Example code & preview of customization
https://discordbotreviews.xyz/api/widget/506213298153193483.png?body=0000FF&header1=2f2f2f&header2=2f2f2f&removeowneravatar=true&hideicon=true
Looks like this:


The alternate widget would look like this:
https://discordbotreviews.xyz/api/widget/2/506213298153193483.png?body=0000FF&header1=2f2f2f&header2=2f2f2f&removeowneravatar=true&hideicon=true


Server Count



Post your server count to our API.

Headers

Parameter Type Description
Authorization string Your bot's API key (REQUIRED)

Body

Parameter Type Description
server_count number Server count of your bot

Ratings



Get ratings for your bot

NOTE: Authorization header is required if you set your ratings to private, votes are by default public and obtainable by anyone


Headers

Parameter Type Description
Authorization string Your bot's api token (OPTIONAL)

Body response

Parameter Type Description
likers array of user IDs Shows everyone who liked the bot
dislikers array of user IDs Shows everyone who disliked the bot
totallikes number Total number of likes
totaldislikers array of user IDs Total number of dislikes
total number The total counted likes and dislikes
ratiofull number Shows like/dislike ratio by full number (will be negative if it's blow 0)
ratio number Calculated like/dislike ratio in percentage


Examples


Some response examples

NOTE: this hasn't been updated in a while and the response may be different




Example of GET bot

{
"clientID":  "506213298153193483",
"prefix":  "dbr!",
"invite_url":  "https://discordbotreviews.xyz/bot/dbr/add",
"support_url":  "invite",
"short_description":  "DBR is the website bot",
"long_description":  "DBR is the website bot, it logs when someone submits a bot, edits a bot, deletes a bot, or anything about certification status.",
"owner":   {
 "bio":  "making bots using fart power lmao",
 "certified":  true,
 "id":  "469716275786940416"
  },
"likes":  0,
"dislikes":  0,
"unique":  true,
"veryUnique":  false,
"website":  "https://discordbotreviews.xyz/",
"source":  "https://github.com",
"servers":  "1"
}

Example of GET user


{
"id":  "432400084706131989",
"bio":  "One of the owners of DBR | I like trains",
"certified":  false,
"bots":   {
 "Object of bots":  "Returns the same as GET bot (read above)",
  },
"background":  "https://discordbotreviews.xyz/api/icon.png",
"certifiedbots":  [ '506213298153193483' ],
"pulsecolor":  "0, 0, 0",
"animationtime":  "5"
}

Example of GET bot's comments


[  {
"id":  0,
"author":  "432400084706131989",
"content":  "Good bot! I really liked and enjoyed it!",
"time":  "2018-12-20T11:42:27.200Z"  },
{
"id":  1,
"author":  "469716275786940416",
"content":  "Awesome Bot!",
"time":  "2018-12-20T14:42:15.200Z"
}    ]


You can find your API token in your bot's page.

https://discordbotreviews.xyz/bot/:id/token