Skip to content

Instantly share code, notes, and snippets.

@rfoel
Last active December 5, 2025 14:08
Show Gist options
  • Select an option

  • Save rfoel/cefe22775e0c94fcead38943d998fa9d to your computer and use it in GitHub Desktop.

Select an option

Save rfoel/cefe22775e0c94fcead38943d998fa9d to your computer and use it in GitHub Desktop.
Duolingo XP farm

Script to farm XP from Duolingo. Never get demoted again!

Copy and paste the following code in your browser console and hit Enter:

const id=document.cookie.split(';').find(e=>e.includes('logged_out_uuid')).split('=')[1];const{fromLanguage,learningLanguage}=await fetch(`https://www.duolingo.com/2017-06-30/users/${id}?fields=fromLanguage,learningLanguage`,{credentials:'include',headers:{'Content-Type':'application/json'}}).then(r=>r.json());while(true){const session=await fetch('https://www.duolingo.com/2017-06-30/sessions',{body:JSON.stringify({challengeTypes:[],fromLanguage,isFinalLevel:false,isV2:true,juicy:true,learningLanguage,smartTipsVersion:2,type:'GLOBAL_PRACTICE'}),credentials:'include',headers:{'Content-Type':'application/json'},method:'POST'}).then(r=>r.json());await fetch(`https://www.duolingo.com/2017-06-30/sessions/${session.id}`,{body:JSON.stringify({...session,heartsLeft:0,startTime:(+new Date()-60000)/1000,enableBonusPoints:false,endTime:+new Date()/1000,failed:false,maxInLessonStreak:9,shouldLearnThings:true}),credentials:'include',headers:{'Content-Type':'application/json'},method:'PUT'}).then(r=>r.json())}
@kazirakibulalam
Copy link

not working

@rfoel
Copy link
Author

rfoel commented Mar 12, 2025

Try this one:

const id=document.cookie.split(';').find(e=>e.includes('logged_out_uuid')).split('=')[1];const{fromLanguage,learningLanguage}=await fetch(`https://www.duolingo.com/2017-06-30/users/${id}?fields=fromLanguage,learningLanguage`,{credentials:'include',headers:{'Content-Type':'application/json'}}).then(r=>r.json());while(true){const session=await fetch('https://www.duolingo.com/2017-06-30/sessions',{body:JSON.stringify({challengeTypes:[],fromLanguage,isFinalLevel:false,isV2:true,juicy:true,learningLanguage,smartTipsVersion:2,type:'GLOBAL_PRACTICE'}),credentials:'include',headers:{'Content-Type':'application/json'},method:'POST'}).then(r=>r.json());await fetch(`https://www.duolingo.com/2017-06-30/sessions/${session.id}`,{body:JSON.stringify({...session,heartsLeft:0,startTime:(+new Date()-60000)/1000,enableBonusPoints:false,endTime:+new Date()/1000,failed:false,maxInLessonStreak:9,shouldLearnThings:true}),credentials:'include',headers:{'Content-Type':'application/json'},method:'PUT'}).then(r=>r.json())}

@kianmaina
Copy link

it worked perfectly

@idkwhattocallmyself123
Copy link

Is there a way to make the program stop after being activated or undo it after?

@rfoel
Copy link
Author

rfoel commented Sep 3, 2025

just close the browser tab to stop. No way to undo.

@josefloconta-cloud
Copy link

is it detected? can i be banned or something?

@kianmaina
Copy link

kianmaina commented Dec 3, 2025 via email

@swag824
Copy link

swag824 commented Dec 5, 2025

is it detected? can i be banned or something?

no it isnt detected, been using it for like 2 months

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