Skip to content

marvinscham/duolingo-api-dockerized

Repository files navigation

Duolingo Logo

Duolingo API Dockerized

Serves your Duolingo progress info as JSON.

Based on KartikTalwar/Duolingo, utilizing modifications from lidiaCirrone/pw-duolingo-data.

GitHub release Quality Gate Status

Example Setup

See example.docker-compose.yml. You'll need to provide your own docker-compose.yml, which you can base on this example file.

In case you'd like to run this behind a nginx reverse proxy, you can use nginx.conf as a reference.

version: '3.2'

# e.g. reverse proxy network
networks:
  yourNetwork:
    external: true

services:
  duolingo-data:
    image: ghcr.io/marvinscham/duolingo-api-dockerized:latest
    container_name: duolingo-data
    restart: unless-stopped
    environment:
      - TIMEZONE=Europe/Berlin
      - DUO_USERNAME=yourUsername
      - DUO_JWT=yourJWT
      - XP_SUMMARY_DAYS=30
      - UPDATE_INTERVAL=15
      - MAX_RETRIES=3
    # ports:
    #   - 80:7000
    networks:
      - yourNetwork

This will serve your progress info at https://duo.your-domain.com/duo_user_info.json.

Environment Variables

  • TIMEZONE
    • Relevant for determining which lessons belong to which day
    • Default: Europe/Berlin
  • DUO_USERNAME
    • Required for login
  • DUO_JWT
    • Login token (Not your password! Info on obtaining this is in the following segment)
  • XP_SUMMARY_DAYS
    • Number of past days to get data from. Might stop working properly if > 300
    • Default: 30
  • UPDATE_INTERVAL
    • Time in minutes to request fresh data from Duolingo
    • Default: 15
  • MAX_RETRIES
    • How often the app should retry in case of some connection error (retry interval 60 seconds)
    • Default: 3

Grabbing your JWT

Login on Duolingo and run the following JavaScript in your browser console. The returned string is your JWT. Do not share this token as it will allow anyone to access your Duolingo account.

document.cookie.match(new RegExp('(^| )jwt_token=([^;]+)'))[0].slice(11);

The token currently does not expire but will break if you change your Duolingo password.