Infinity Docs

/

API Usage

Common Examples of our API Usage.


If you prefer to interact with our raw API instead of using a Third Party Module you can follow the usage guides and examples below which should be more then enough to get you started xD

NOTE: For posting stats you can send up to 3 requests every 5 Minutes


Javascript Usage

POST
const fetch = require("node-fetch")
fetch(`https://api.infinitybotlist.com/bots/stats`, {
            method: "POST",
            headers: {
                "authorization": "api-key-here",
                "Content-Type": "application/json"
            },
            body: JSON.stringify({
                servers: 100,
                shards: 69
            })
        }).then(async res => console.log(await res.json()))
GET
const fetch = require("node-fetch")
fetch(`https://api.infinitybotlist.com/bot/:botID`, {
            method: "GET",
            headers: {
                "Content-Type": "application/json"
            }
        }).then(async res => console.log(await res.json()));

Python Usage

POST
import aiohttp
session = aiohttp.ClientSession(loop=bot.loop)
      headers= {
        "authorization": "Your api token"
        "Content-Type": "application/json",
        
      }
      payload= {
        "servers": len(bot.guilds),
        "shards": bot.shard_count or 0
      }
      await session.post(f"https://api.infinitybotlist.com/bots/stats", headers=headers, json=payload)
Edit on GitHub