Serverlist Documentation

Last updated 13 days ago

Start the API

First install the package by running:

$ npm i botlist.space-api

Once you installed the npm package, you can now use the package in your code:

const botlistspaceAPI = require('botlist.space-api');
// Now call the API code
const api = new botlistspaceAPI.serverlistAPI('InsertUserKeyHere');

Remember like the botlist counterpart, most of the functions require a user key.

Functions with the API

Now that you have the your code set up, you can now use the API with a user key.

Please remember like I said, a user key is need for MOST functions with the api.

ALL FUNCTIONS BELOW NEED A USER KEY.

For more info on the functions like response go here.

get
Get Server

api.
getServer(id)
Fetches info about a specific server by ID
Request
Response
Path Parameters
id
required
string
Server ID
200: OK
{
"success": true, // Boolean
"id": "387812458661937152", // String
"name": "botlist.space", // String
"icon": "https://cdn.discordapp.com/icons/387812458661937152/e56ff74366e752e7817349235057504f.jpg?size=256", // String
"short_description": "The official support server for botlist.space.", // String
"full_description": "...", // ?String
"icon_child_friendly": true, // Boolean
"public": true, // Boolean
"compliance": true, // Boolean
"owners": [ // Array<Object>
{
"avatar": "https://cdn.discordapp.com/avatars/149505704569339904/d7083005cb77b45b55d82a4e1fbe104c.png?size=256", // String
"discriminator": "0123", // String
"id": "149505704569339904", // String
"short_description": null, // ?String
"username": "luke" // String
}
],
"tags": [ // ??Array<String>
"Utility"
],
"member_count": 2500, // Number
"vanity": "botlist" // ?String
"created_at": 1509302556022, // Number
"updated_at": 1546153941801, // Number
}

get
Get All Servers

api.
getALLServers(pageNumb)
Fetches ALL servers on the website per page.
Request
Response
Query Parameters
pageNumb
optional
string
Page number. Will default to 1.
200: OK
{
"success": true, // Boolean
"page": 1, // Number
"page_count": 20, // Number
"servers": [ // Array<Object>
{ ... },
{ ... },
{ ... }
]
}

get
Get Stats

api.
getStats()
Fetches info about the site.
Request
Response
200: OK
{
"success": true, // Boolean
"servers": 100, // Number
"tags": 15, // Number
"users": 2500 // Number
}

get
Get User

api.
getUser(id)
Fetches user by ID.
Request
Response
Path Parameters
id
required
string
User ID
200: OK
N/A

get
Get User Servers

api.
getUserServers(id, pageNumb)
Fetches user's servers by ID
Request
Response
Path Parameters
id
required
string
User ID
Query Parameters
pageNumb
optional
string
Page number
200: OK
N/A

get
Get Server Upvotes

api.
getUpvotes(pageNumb, auth, id)
Request
Response
Path Parameters
id
required
string
Server ID.
Headers
auth
required
string
Your server's key.
Query Parameters
pageNumb
optional
string
Page number. Will default to 1.
200: OK