Greasy Fork is available in English.
Get Duolingo XP easily
// ==UserScript==
// @name Duolingo Simple XP Cheat
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Get Duolingo XP easily
// @author You
// @match *://*.duolingo.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Duolingo PRO API URL
const apiURL = "https://api.duolingopro.net";
// Add XP button
function addXpButton() {
if (document.querySelector('#dlp-xp-button')) return;
const button = document.createElement('button');
button.id = 'dlp-xp-button';
button.textContent = 'GET XP';
button.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
z-index: 9999;
background: #1cb0f6;
color: white;
border: none;
border-radius: 16px;
padding: 12px 24px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
`;
button.addEventListener('click', getXP);
document.body.appendChild(button);
}
// Function to get XP
async function getXP() {
try {
const button = document.querySelector('#dlp-xp-button');
const originalText = button.textContent;
button.textContent = 'GETTING...';
button.disabled = true;
// Get JWT token from cookies
const cookies = document.cookie.split(';');
let jwtToken = '';
for (let cookie of cookies) {
if (cookie.trim().startsWith('jwt_token=')) {
jwtToken = cookie.split('=')[1];
break;
}
}
if (!jwtToken) {
alert('Please login to Duolingo first');
button.textContent = originalText;
button.disabled = false;
return;
}
// Request XP (amount - 100)
const response = await fetch(apiURL + '/request', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + jwtToken
},
body: JSON.stringify({
type: 'xp',
amount: 100,
version: '3.1BETA.04.2',
lang: 'en'
})
});
const data = await response.json();
if (data.status === 'completed') {
button.textContent = '✓ XP ADDED';
setTimeout(() => {
button.textContent = originalText;
button.disabled = false;
}, 3000);
// Show notification
alert('100 XP added successfully!');
} else {
alert('Failed to get XP: ' + (data.notification?.body || 'Unknown error'));
button.textContent = originalText;
button.disabled = false;
}
} catch (error) {
console.error('Error:', error);
alert('Error getting XP. Check console for details.');
document.querySelector('#dlp-xp-button').textContent = 'GET XP';
document.querySelector('#dlp-xp-button').disabled = false;
}
}
// Initialize
setTimeout(addXpButton, 3000);
// Also add on page changes
let lastUrl = location.href;
new MutationObserver(() => {
const url = location.href;
if (url !== lastUrl) {
lastUrl = url;
setTimeout(addXpButton, 3000);
}
}).observe(document, {subtree: true, childList: true});
})();