Skip to main content

Statistics

The Free plan exposes the most recent seven days. Use week for operations that accept a period.

Dashboard and projects

dashboard, _, err := client.StatisticsAPI.
MainApiV1GetMyDashboardStatsGet(ctx).
Execute()
if err != nil {
return
}

projects, _, err := client.StatisticsAPI.
MainApiV1GetMyProjectStatsGet(ctx).
Period("week").
Execute()
if err != nil {
return
}

result := map[string]interface{}{
"dashboard": dashboard,
"projects": projects,
}
payload, err := json.MarshalIndent(result, "", " ")
if err != nil {
return
}
fmt.Println(string(payload))

Languages

languages, _, err := client.StatisticsAPI.
MainApiV1GetMyLanguageStatsGet(ctx).
Execute()
if err != nil {
return
}
fmt.Println(languages)

The dashboard endpoint applies the account history limit on the server and does not accept a period argument.

Desktop-agent and Android dashboards are covered in Statistics API.