Translate
Grok translation for posts, bios and community notes, plus the auto-translate setting and translation feedback.
translate.post(tweetId, opts?)
Translate a post. Returns { text, polls, results }.
| Option | Type | Description |
|---|---|---|
opts.lang | string | Target language (default en) |
opts.raw | boolean | Return the raw result objects |
js
const { text } = await client.translate.post("2127370319077966155");translate.bio(userId, opts?)
Translate a user's bio.
translate.note(noteId, opts?)
Translate a community note into your account language.
translate.translate(kind, id, opts?)
The shared call behind the three above. kind is post, bio or note. Uses POST /2/grok/translation.json.
translate.autoTranslate(language?) / translate.setAutoTranslate(language, enable)
Read and change whether posts in language are translated automatically.
js
await client.translate.setAutoTranslate("ja", true);translate.postFeedback(tweetId, feedback) / translate.noteFeedback(noteId, feedback)
Rate a post or note translation. feedback is "Good" or "Bad".