Comments (10)
I thought you might be interested to see what I built: https://twitter.com/saltedlolly/status/1512107599747067913
from duolingo.
@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.
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:
Hope it helps.
from duolingo.
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.
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.
Amazing! Exactly what I needed! And even better it seems I don't even need to be authenticated. Many thanks.
from duolingo.
You're right, it works even without Authorization header or cookies, didn't realize that before.
from duolingo.
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.
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.
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:
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)
- Part of the API seems to have been either removed or moved
- get_known_words Not returning all words HOT 1
- Cannot get urls for audio by using get_audio_url method HOT 1
- Leaderboad Doesn't Work HOT 4
- module 'duolingo' has no attribute 'Duolingo' HOT 4
- Translations stopped working today HOT 4
- 3rd Party Login HOT 5
- unable to login with api, no returns HOT 28
- Translations are Broken HOT 1
- Not able to fetch user data from `_get_data()` HOT 1
- Unable To Buy Streak Savers
- get_friends() not working
- calculating total practice time by year.
- Vocabulary missing accents
- error: login failed HOT 1
- JSONDecodeError when trying to call .get_vocabulary() HOT 4
- Sign in with Google? HOT 1
- JSON Decode error on initiation HOT 1
- Get All known words from specific topic
- any updates?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duolingo.