GithubHelp home page GithubHelp logo

Comments (10)

saltedlolly avatar saltedlolly commented on August 16, 2024 2

I thought you might be interested to see what I built: https://twitter.com/saltedlolly/status/1512107599747067913

from duolingo.

igorskh avatar igorskh commented on August 16, 2024 1

@igorskh, could you tell me where you took that API screenshot? I have previously searched for documentation on Duolingo's API, but had little success. What you have in that screenshot is certainly the kind of thing I would be interested in looking at.

@golmschenk I have a repo with openAPI docs https://github.com/igorskh/duolingo-api

from duolingo.

igorskh avatar igorskh commented on August 16, 2024

Hi @saltedlolly,

It is possible with duolingo API, but this package doesn't implement this method.

The endpoint is www.duolingo.com/users/{userID}/xp_summaries

It returns an array for the given time range, as following:

Screenshot 2022-02-16 at 10 30 31

Hope it helps.

from duolingo.

saltedlolly avatar saltedlolly commented on August 16, 2024

Thanks - this is just what I have been looking for! Unfortunately, I'm struggling to make it work. Could you possibly provide me with an example query? Sorry, I'm quite new at this.

I tried https://www.duolingo.com/users/6364229/xp_summaries?startDate=2022-02-16&endDate=2022-02-17&timezone=Europe/London but got nothing.

from duolingo.

igorskh avatar igorskh commented on August 16, 2024

Sorry, my bad. The URL should be https://www.duolingo.com/2017-06-30/users/6364229/xp_summaries?startDate=2022-02-16&endDate=2022-02-17&timezone=Europe/London

The 2017-06-30 is missing. It's just a fixed prefix Duolingo currently use for their API endpoint.

Example:

GET /2017-06-30/users/6364229/xp_summaries?startDate=2022-02-16&endDate=2022-02-17&timezone=Europe%2FLondon HTTP/1.1
Authorization: Bearer <your_jwt_token_here>
Content-Type: text/plain; charset=utf-8
Host: www.duolingo.com

"summaries":[{"gainedXp":87,"frozen":false,"streakExtended":true,"userId":6364229,"dailyGoalXp":50,"date":1645056000,"repaired":false},{"gainedXp":null,"frozen":true,"streakExtended":false,"userId":6364229,"dailyGoalXp":null,"date":1644969600,"repaired":false}]}

from duolingo.

saltedlolly avatar saltedlolly commented on August 16, 2024

Amazing! Exactly what I needed! And even better it seems I don't even need to be authenticated. Many thanks.

from duolingo.

igorskh avatar igorskh commented on August 16, 2024

You're right, it works even without Authorization header or cookies, didn't realize that before.

from duolingo.

saltedlolly avatar saltedlolly commented on August 16, 2024

Thanks for all your help. As an aside, is there a query I can make to return the userid of a provided username?

from duolingo.

igorskh avatar igorskh commented on August 16, 2024

Yes, there is an endpoint which returns user information by username, it contains among other fields the userID:

https://www.duolingo.com/2017-06-30/users?username=<username>

e.g.:
https://www.duolingo.com/2017-06-30/users?username= igorskh returns

{
    "users": [
        {
            "joinedClassroomIds": [],
            "streak": 1873,
            
            "id": 14397890
        }
    ]
}

Lot's of other things as well, but you can get ID from here.

from duolingo.

golmschenk avatar golmschenk commented on August 16, 2024

Hi @saltedlolly,

It is possible with duolingo API, but this package doesn't implement this method.

The endpoint is www.duolingo.com/users/{userID}/xp_summaries

It returns an array for the given time range, as following:

Screenshot 2022-02-16 at 10 30 31

Hope it helps.

@igorskh, could you tell me where you took that API screenshot? I have previously searched for documentation on Duolingo's API, but had little success. What you have in that screenshot is certainly the kind of thing I would be interested in looking at.

from duolingo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.