Git Product home page Git Product logo

discord-lookup-api's Introduction

discord-lookup-api

Discord Lookup API is an API that lets you, with a given ID, get basic informations about a user

The API returns :

  • User ID
  • User Tag (username#0000)
  • User Badges
  • Avatar (ID, Link, animated boolean)
  • Banner (ID, Link, animated boolean, color)

The API has built-in CORS support, so you won't have to worry

Data is cached for 3 hours (or until the Redis Server restarts)

Planned features

  • Experiment Lookup
  • Invite Resolver

Usage

You can freely access the API here

Or you can deploy your own instance of the API through Vercel:

Deploy with Vercel

Note This version does not have caching due to Vercel limitations. You must also have a Discord Bot Token to use the API. You can get one here

Right now, you must specify an ID to the link (a proper website is currently in development)

Example

https://discordlookup.mesavirep.xyz/v1/user/604779545018761237

{
    "id": "604779545018761237",
    "tag": "mesa#0101",
    "badges": [
        "HOUSE_BRAVERY",
        "EARLY_VERIFIED_BOT_DEVELOPER",
        "ACTIVE_DEVELOPER"
    ],
    "avatar": {
        "id": "02a161dcd6d590fbce550d6872468cc7",
        "link": "https://cdn.discordapp.com/avatars/604779545018761237/02a161dcd6d590fbce550d6872468cc7",
        "is_animated": false
    },
    "banner": {
        "id": "a_b987e17d75cc964905b04a575636c60e",
        "link": "https://cdn.discordapp.com/banners/604779545018761237/a_b987e17d75cc964905b04a575636c60e",
        "is_animated": true,
        "color": "#385d6d"
    }
}

https://discordlookup.mesavirep.xyz/v1/application/437190817195753472

{
   "id":"437190817195753472",
   "name":"Helixus",
   "icon":"https://cdn.discordapp.com/avatars/437190817195753472/9d7e869d626efd6d0e61ac9e552e6fb6",
   "description":"Helixus aims to do what would normally need multiple bots, and does it all by itself !\nYou can play Music (from some sources), log what happens in your server, send some memes, and much more!\n\nInvite it now to see the full capacity of Helixus!\n**SUPPORT**: https://discord.gg/pBATVfHg",
   "summary":"",
   "type":null,
   "hook":true,
   "guild_id":"418433461817180180",
   "bot_public":true,
   "bot_require_code_grant":false,
   "terms_of_service_url":"https://gist.github.com/mesalytic/c132c786b47c86599021237f0303b952",
   "privacy_policy_url":"https://gist.github.com/mesalytic/598c963ddfa4562ec7c867574ed7cedf",
   "install_params":{
      "scopes":["bot","applications.commands"],
      "permissions":"1926057290966"
   },
   "verify_key":"82449bea917a3e2b4a407254cc548e5d35de9cb8a888d692d65f31471ddc5fa0",
   "flags":{
      "bits":10764288,
      "detailed":["GATEWAY_GUILD_MEMBERS","GATEWAY_MESSAGE_CONTENT","APPLICATION_COMMAND_BADGE"]
   },
   "tags":["image","logging","meme","mini-game","music"]
}

https://discordlookup.mesavirep.xyz/v1/guild/81384788765712384

Note The guild linked to the request ID must have Server Widget and/or Server Discovery enabled. An error will be thrown otherwise.

{
   "id":"81384788765712384",
   "name":"Discord API",
   "instant_invite":null,
   "presence_count":18759
}

Installation

Note You must have a Redis server installed, and ready to be used.

  1. Clone the repo using Git
  2. Install dependencies (npm i)
  3. Open ports (either 3000 or any other port)
  4. Launch the Redis Server
  5. Launch the server (node server.js)

discord-lookup-api's People

Contributors

jsydorowicz21 avatar mesalytic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

discord-lookup-api's Issues

Invalid User ID data being cached nonetheless

When giving an invalid userID, the first response is from the Discord API, but when trying to reach it again, it accesses the cached data, giving {"created_at":"2015-01-01T00:00:00.000Z","tag":"undefined#undefined","badges":[],"avatar":{"link":null,"is_animated":false},"banner":{"link":null,"is_animated":false}}

API is currently down

I don't have much information as to why, but the server is down.

If you need to access the API, either wait or self-host it yourself

Pronoun support?

Pronouns are a thing now and I can't tell if the Discord Canary endpoint you're getting data from sends it, but if it does then it would be nice to include it :)

Support for Pomelo Usernames

Discord started rolling Pomelo Usernames, and the API need to support it as soon as possible

The API resposne shouldn't really change, but this is in case

createdAt missing

Hi, The API is not returning the Joining Time of Discord ID, Can you make it possible?

Caching Responces

If someone really wanted to, it seems you don't have any cache and/or rate limiting on the api, anyone could get your bot deleted, discord may also give consequences to the users account not so sure about that last bit though.

Use .env instead of config.json

Reason:
env can be set in the enviroment, without needing a file in the working directory. which most services uses by default.

example:

PORT=3000
TOKEN=PK_123456

// redis config
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=123

OAuth Idea

You say you need OAuth for certain info, you could add message in the JSON output telling apps to ask the user to Auth the api for the extended info
maybe include something like this at the bottom

"extended": [
"message": "The current user needs to authorize the api for extra information, ask the user to grant permission to the app.",
"url": "https://discord.com/...."
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.