Create Top.gg API instance
Token or options
Optional
options: APIOptions = {}API Options
Get a list of bots
Optional
query: BotsQueryBot Query
Return response
// Finding by properties
await api.getBots({
search: {
username: "shiro",
certifiedBot: true,
},
});
// =>
{
results: [
{
id: '461521980492087297',
username: 'Shiro',
discriminator: '8764',
lib: 'discord.js',
...rest of bot object
}
...other shiro knockoffs B)
],
limit: 10,
offset: 0,
count: 1,
total: 1
}
// Restricting fields
await api.getBots({
fields: ["id", "username"],
});
// =>
{
results: [
{
id: '461521980492087297',
username: 'Shiro'
},
{
id: '493716749342998541',
username: 'Mimu'
},
...
],
...
}
Get users who've voted
Array of users who've voted
await api.getVotes();
// =>
[
{
username: 'Xignotic',
id: '205680187394752512',
avatar: '3b9335670c7213b3a2d4e990081900c7'
},
{
username: 'iara',
id: '395526710101278721',
avatar: '3d1477390b8d7c3cec717ac5c778f5f4'
}
...more
]
Generated using TypeDoc
Top.gg API Client for Posting stats or Fetching data
Example
Link
Library docs
Link
API Reference