Blacklister API
  • Welcome!
  • Get Started
Powered by GitBook
On this page
  • Get your API key
  • Make your first request
  • Check a user's blacklisted status

Get Started

PreviousWelcome!

Last updated 2 years ago

Good to know: We ratelimit requests to our API, and they are limited to 10 requests a second. If you need this increasing, please join our support server. Link:

Get your API key

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can generate an API key from our Dashboard (SOON!) or by doing /apikey

Make your first request

Check a user's blacklisted status

GET https://api.blacklister.xyz/<userid>

Headers

Name
Type
Description

Authorization*

Your API key

If the user is not blacklisted, it will return data in the following format:

{
    "blacklisted": false
}

If the user is blacklisted, it will return data in the following format:

{
    "blacklisted": true, 
    "reason": "Reason for the blacklist", 
    "moderator": "The moderator who blacklisted the user", 
    "date": "The date of the Blacklist (DD/MM/YYYY format)", 
    "evidence": "URL to the evidence"
}
{ "error":"Unauthorized!" }

Take a look at how you might call this method using Axios or Requests

const axios = require("axios")

await axios.get(`https://api.blacklister.xyz/USERID`, { 
            "headers": { "Authorization":"API key" }
})
.then(async function (response) {
            if (response.data.blacklisted) {
              // User is blacklisted!
            }
            else {
              // User is not blacklisted!
            }
})
import requests

r = requests.get("https://api.blacklister.xyz/USERID", headers={ "Authorization":"Your API key"})

response = r.json()

if response["blacklisted"]:
    # User is blacklisted!
else:
    # User is not blacklisted!
using System;
using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace BigBun
{
    public class Blacklist
    {
        [JsonPropertyName("blacklisted")]
        public bool Blacklisted { get; set; }

        [JsonPropertyName("reason")]
        public string Reason { get; set; }

        [JsonPropertyName("moderator")]
        public string Moderator { get; set; }

        [JsonPropertyName("date")]
        public string Date { get; set; }

        [JsonPropertyName("evidence")]
        public string Evidence { get; set; }

        [JsonPropertyName("source")]
        public string Source { get; set; }
    }

    public static class Program
    {
        public static async Task Main()
        {
            string apiKey = "";
            ulong userId = 710912646433603615;

            HttpClient client = new();

            HttpRequestMessage request = new(HttpMethod.Get, $"https://api.blacklister.xyz/{userId}");
            request.Headers.Add("Authorization", apiKey);
            HttpResponseMessage response = await client.SendAsync(request);

            string json = await response.Content.ReadAsStringAsync();
            Blacklist data = JsonSerializer.Deserialize<Blacklist>(json);

            if (data.Blacklisted)
            {
                Console.WriteLine("User is blacklisted!");
                Console.WriteLine($"Reason: {data.Reason}");
                Console.WriteLine($"Moderator: {data.Moderator}");
                Console.WriteLine($"Date: {data.Date}");
                Console.WriteLine($"Evidence: {data.Evidence}");
                Console.WriteLine($"Source: {data.Source}");
            }
            else
            {
                Console.WriteLine("User isn't blacklisted!");
            }

            Console.ReadKey();
        }
    }
}
https://discord.gg/FZxgNrwBS6