explaingit

xnacly/go-kagi-translate

Analysis updated 2026-05-18

3GoAudience · developerComplexity · 2/5Setup · moderate

TLDR

An unofficial Go library and CLI for translating text and detecting languages using Kagi Translate, a paid feature of the Kagi search engine.

Mindmap

mindmap
  root((go-kagi-translate))
    What it does
      Translate text
      Detect language
      Check quota
    Tech stack
      Go
      Kagi web API
    Use cases
      Scripted translation
      CLI translation
    Audience
      Kagi subscribers
      Go developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Translate text between languages from a Go program using a Kagi subscription.

USE CASE 2

Detect the language of a piece of text programmatically.

USE CASE 3

Check remaining Kagi Translate quota from a script or CLI.

USE CASE 4

Run quick translations from the terminal using the ktranslate command.

What is it built with?

Go

How does it compare?

xnacly/go-kagi-translate12vault/ravelalexremn/finalizer-doctor
Stars333
LanguageGoGoGo
Setup difficultymoderateeasyeasy
Complexity2/52/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an active paid Kagi subscription and a manually copied session token.

In plain English

go-kagi-translate is an unofficial Go library and command line tool for using Kagi Translate, the translation feature built into the Kagi search engine. Kagi does not offer a public API for translation, so this project works by talking to the same private web interface that Kagi's own website uses. That means it can translate text, detect what language a piece of text is written in, and check how much translation quota remains on an account. To use it you need an active Kagi subscription, since Kagi Translate is a paid feature. Instead of a normal API key, the tool authenticates using a private session token copied from a link found in the Kagi website's sidebar. The library caches that session safely so it can be reused across multiple requests without repeating the login step each time. The project includes both a Go package for embedding translation into your own programs and a ready to use command line tool called ktranslate. With the CLI, you set the KAGI_TOKEN environment variable to your session token and then run commands to translate text between languages, detect a language, or check your remaining quota. The Go package also supports more detailed translation requests, letting you specify things like formality level and translation style. Because this relies on reverse engineering Kagi's private web application rather than an official, documented API, it can break if Kagi changes how that internal system works. The author built it after finding no public translation API and no easy way to get beta access, and made it because they personally use Kagi Translate often for Spanish, Basque, Russian, and German. The README does not mention a license.

Copy-paste prompts

Prompt 1
Show me how to install and use the ktranslate CLI to translate text from Spanish to English.
Prompt 2
Write a Go program that uses gokagitranslate to detect the language of a sentence.
Prompt 3
Explain how to get a KAGI_TOKEN session token for this library to work.
Prompt 4
Help me use TranslateWithParams to set formality and translation style options.

Frequently asked questions

What is go-kagi-translate?

An unofficial Go library and CLI for translating text and detecting languages using Kagi Translate, a paid feature of the Kagi search engine.

What language is go-kagi-translate written in?

Mainly Go. The stack also includes Go.

How hard is go-kagi-translate to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is go-kagi-translate for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.