Go SDK
Official typed Go client for the Analog WakaTime HTTP API. The package is generated from the public OpenAPI contract and ships with request builders, response models, and Bearer authentication.
github.com/Analog-Code-Monitor/Analog-WakaTime-GO-SDK
Repository: Analog-WakaTime-GO-SDK
Requirements
- Go 1.26 or newer
- an Analog WakaTime account
- a personal API token (
analog-wakatime_live_…) or a session JWT for protected endpoints
Production API
All generated URIs are relative to:
https://api.testingmyproject.space
NewConfiguration() already points at this host. You do not need to set a
manual base URL for production.
Quick start
package main
import (
"context"
"encoding/json"
"fmt"
analogwakatime "github.com/Analog-Code-Monitor/Analog-WakaTime-GO-SDK"
)
func main() {
ctx := context.WithValue(
context.Background(),
analogwakatime.ContextAccessToken,
"PASTE_API_TOKEN_HERE",
)
client := analogwakatime.NewAPIClient(analogwakatime.NewConfiguration())
profile, response, err := client.ProfileAPI.
MainApiV1GetMyProfileInfoGet(ctx).
Execute()
if err != nil {
if response != nil {
fmt.Printf("HTTP %s: %v\n", response.Status, err)
} else {
fmt.Printf("request failed: %v\n", err)
}
return
}
payload, _ := json.MarshalIndent(profile, "", " ")
fmt.Println(string(payload))
}
How generated calls work
Every service hangs off client. Calling a method returns a request builder;
Execute() sends the HTTP request:
result, response, err := client.ProfileAPI.
MainApiV1GetMyProfileInfoGet(ctx).
Execute()
JSON bodies use generated request models and constructors. Optional fields use
Set… helpers. Path parameters are method arguments; optional query values are
builder methods:
projects, response, err := client.StatisticsAPI.
MainApiV1GetMyProjectStatsGet(ctx).
Period("week").
Execute()
Every operation returns (result, *http.Response, error).
Documentation map
Getting started
Guides
API reference by service
| Client field | Docs |
|---|---|
AuthAPI | Auth |
DeviceAuthAPI | Device auth |
OAuthAPI | OAuth |
ProfileAPI | Profile |
BioAPI | Bio |
ActivitiesAPI | Activities |
StatisticsAPI | Statistics |
ExportAPI | Export |
TelemetryAPI | Telemetry |
WebSocketAPI | WebSocket |
TeamAPI | Team |
SubscriptionAPI | Subscription |
LeaderboardAPI | Leaderboard |
AgentReleasesAPI | Agent releases |
BlogAPI | Blog |
PublicAPI | Public |
SVGAPI | SVG |
SupportAPI | Support |
TelegramAPI | Telegram |
HealthAPI | Health |