duoinfo
A Go library to fetch public Duolingo profile data via Duolingo's REST API.

Overview
duoinfo gives you a clean Go API over Duolingo's public users endpoint to pull profile, course, streak, and XP data without dealing with request building or response parsing yourself.
| Function |
What it returns |
GetUser |
Full profile: courses, streak data, total XP, and XP by language |
Installation
go get github.com/reinanbr/duoinfo
Requirements: Go 1.21+ · Internet access to Duolingo's public API (no auth token required)
Quick Start
package main
import (
"fmt"
"github.com/reinanbr/duoinfo"
)
func main() {
user, err := duoinfo.GetUser("reinanbr")
if err != nil {
fmt.Println("error:", err)
return
}
fmt.Println("name:", user.Name)
fmt.Println("total xp:", user.TotalXP)
fmt.Println("streak:", user.Streak)
for _, xp := range user.XPByLanguage {
fmt.Printf("%s: %.1f%%\n", xp.LanguageID, xp.Percentage)
}
}
API Reference
GetUser(username string) (User, error)
Returns the full Duolingo profile for username.
type User struct {
Username string
Name string
FirstName string
LastName string
Bio string
Picture string
CreationDate int64
Streak int
TotalXP int
Courses []Course
StreakData StreakData
XPByLanguage []LanguageXP
}
XPByLanguage is derived client-side: each course's share of the user's total XP, sorted from highest to lowest.
Contributing
Contributions are welcome! See CONTRIBUTING.md for how to set up the project, run tests, and submit a pull request.
License
MIT — see LICENSE.