This Node.js application serves as a simple API for retrieving extended information about Discord users. It utilizes the Discord API to fetch user data and processes it to provide additional details. The API exposes an endpoint to retrieve user information based on their Discord user ID.
Follow these steps to run the application locally:
-
Clone the repository to your local machine.
git clone https://github.com/itsvijaysingh/Discord-Lookup-API.git
-
Navigate to the project directory.
cd Discord-Lookup-API
-
Install the required dependencies.
npm install
-
Open the
api.js
file and ensure theDISCORD_BOT_TOKEN
variable is set. You can obtain a Discord bot token by creating a new bot on the Discord Developer Portal.const DISCORD_BOT_TOKEN = process.env.DISCORD_BOT_TOKEN || 'your-bot-token-here';
-
Save the changes.
-
Run the application.
node api.js
-
The server will start running on
http://localhost:3000
. You can now make requests to the API.
-
GET /api/user/:id: Retrieve extended information about a Discord user based on their user ID.
Example:
http://localhost:3000/api/user/123456789012345678
Replace
123456789012345678
with the actual Discord user ID.The response will include details such as username, discriminator, avatar, banner, user flags, Nitro type, creation date, and more.
- Express: A web application framework for Node.js.
- Cors: Middleware for enabling Cross-Origin Resource Sharing.
Note: Ensure that Node.js is installed on your machine before running the application.
Feel free to customize and extend the application according to your needs. If you encounter any issues or have questions, please refer to the Discord API documentation for assistance.