Discord Widget
Last updated
Last updated
GET
https://api.twiz.lol/v3/widgets/${discordID}
Name | Type | Description |
---|---|---|
{
"name"="Wilson",
"owner": {
"id": "sha7891bikojbkreuy",
"name": "Samuel Passet",
"species": "Dog",}
"breed": "Golden Retriever",
}
This API was originally exclusive only to Twiz.lol
Easiest Way to use Discord Widget
We are pleased to announce the addition of two new themes - Light Theme and Transparent Theme.
<!-- for dark theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey">
</iframe>
<!-- for light theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=light">
</iframe>
<!-- for transparent theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=trans">
</iframe>
import React from 'react';
const DiscordUserEmbed: React.FC = () => {
return (
<!-- for dark theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey">
</iframe>
<!-- for light theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=light">
</iframe>
<!-- for transparent theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=trans">
</iframe>
);
};
export default DiscordUserEmbed;
import React from 'react';
const DiscordUserEmbed = () => {
return (
<!-- for dark theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey">
</iframe>
<!-- for light theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=light">
</iframe>
<!-- for transparent theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=trans">
</iframe>
);
};
export default DiscordUserEmbed;
import { meta } from '@astro/types';
<!-- for dark theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey">
</iframe>
<!-- for light theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=light">
</iframe>
<0!-- for transparent theme -->
<iframe
title="Discord user embed"
width="340" height="72"
frameborder="0"
sandbox="allow-scripts"
src="https://api.twiz.lol/v3/widgets/936249234510979183?apikey=apikey&theme=trans">
</iframe>
Node is Required
Requirements: NodeJs 18^
let port = 1000;
const _ES = require('express')
const app = _ES();
// For API
let ApiKey = `10234895`;
app.get('/', (req, res) => {
res.status(503).sendStatus(503);
})
// *
app.get('/widgets/', (req, res) => {
res.send("Invalid ID");
throw new Error('Invalid ID');
})
app.get('/widgets', (req, res) => {
res.send("Invalid ID");
throw new Error('Invalid ID');
})
// *
app.get('/widgets/:id', (req, res) => {
try {
const id = req.params.id;
if (!id) {
res.send("Invalid ID");
throw new Error('Invalid ID');
}
// Powerd by twiz®
const widgetUrl = `https://api.twiz.lol/v3/widgets/${id}?apikey=${ApiKey}`;
const widgetHTML = `
<iframe
title="Discord user embed"
width="340"
height="72"
frameborder="0"
sandbox="allow-scripts"
src="${widgetUrl}"
></iframe>
`;
res.send(widgetHTML);
} catch (error) {
console.error(error);
res.status(500).send('Internal Server Error');
}
});
app.listen(port, () => {
console.log(`Server: Running`);
})
/*
@
-Credits to g0thub/sentiax
@
*/
/*
-- source code
https://github.com/Twiz-lol/WidgetsAPI-Source
*/
{
"name": "api.twiz.lol",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "nodemon app.js"
},
"author": "sentiax",
"license": "ISC",
"dependencies": {
"axios": "^1.5.0",
"cheerio": "^1.0.0-rc.12",
"express": "^4.18.2",
"nodemon": "^3.0.1"
}
}
npm install && npm run start
apikey*
apikey
Get apikey from dashboard