Skip to content

Instantly share code, notes, and snippets.

@sh9351
Created December 21, 2023 09:45
Show Gist options
  • Save sh9351/5b431b59cce6ebdf038001360b2d2204 to your computer and use it in GitHub Desktop.
Save sh9351/5b431b59cce6ebdf038001360b2d2204 to your computer and use it in GitHub Desktop.
Free Discord Nitro (powered by Opera GX promotion)

Discord Nitro Generator

Opera GX has been doing an interesting campaign lately... so let's abuse it!

Instructions

  1. npm i axios
  2. node index.js
  3. Click the link to redeem your free Nitro. You will need to add a valid payment method, and verify it with a $1 transaction. (It will be instantly canceled.)

But because this is all just too complicated, I'ma just make it an executable.

const axios = require('axios')
async function main() {
const { data } = await axios.post('https://api.discord.gx.games/v1/direct-fulfillment', {
partnerUserId: [...Array(64)].map(() => Math.floor(Math.random() * 16).toString(16)).join('')
})
console.log(`https://discord.com/billing/partner-promotions/1180231712274387115/${data.token}`)
}
main()
@tomz00
Copy link

tomz00 commented Dec 22, 2023

Here is the script in vanilla JS:

async function main() {
    const response = await fetch('https://api.discord.gx.games/v1/direct-fulfillment', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        body: JSON.stringify({
            partnerUserId: [...Array(64)].map(() => Math.floor(Math.random() * 16).toString(16)).join('')
        })
    });

    const data = await response.json();
    console.log(`https://discord.com/billing/partner-promotions/1180231712274387115/${data.token}`);
}

main();

@sh9351
Copy link
Author

sh9351 commented Dec 22, 2023

Great job, @tomz00! 👏
I was just kinda used to using axios all the time 😟

@ProExecutor
Copy link

import('node-fetch').then(module => {
const fetch = module.default;
const fs = require('fs');

const options = {
    method: 'POST',
    headers: {
        authority: 'api.discord.gx.games',
        accept: '*/*',
        'accept-language': 'pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7',
        'content-type': 'application/json',
        origin: 'https://www.opera.com',
        referer: 'https://www.opera.com/',
        'sec-ch-ua': '"Opera GX";v="105", "Chromium";v="119", "Not?A_Brand";v="24"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': '"Windows"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'cross-site',
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0'
    },
    body: `{"partnerUserId":"your partnerUserId here"}`
};

let savedURLs = 0;
setInterval(() => {
    fetch('https://api.discord.gx.games/v1/direct-fulfillment', options)
        .then(response => response.json())
        .then(response => {
            let fullURL = "https://discord.com/billing/partner-promotions/1180231712274387115/"+response.token+"\n";
            fs.appendFile('free-nitro-urls.txt', fullURL, (err) => {
                if (err) throw err;
                savedURLs++;
                console.log(`Saved ${savedURLs} Discord Nitro URLs!`);
            });
        })
        .catch(err => console.error(err));
}, 500);

});

@Priyansxu
Copy link

It will work without payment?

@sh9351
Copy link
Author

sh9351 commented Jun 7, 2024

It will work without payment?

  1. This API is broken, now GX requires log-in.
  2. No, you need to make an initial payment of $1, which will be canceled right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment