Skip to main content

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 fieldDocs
AuthAPIAuth
DeviceAuthAPIDevice auth
OAuthAPIOAuth
ProfileAPIProfile
BioAPIBio
ActivitiesAPIActivities
StatisticsAPIStatistics
ExportAPIExport
TelemetryAPITelemetry
WebSocketAPIWebSocket
TeamAPITeam
SubscriptionAPISubscription
LeaderboardAPILeaderboard
AgentReleasesAPIAgent releases
BlogAPIBlog
PublicAPIPublic
SVGAPISVG
SupportAPISupport
TelegramAPITelegram
HealthAPIHealth