A free and unlimited API for Google Translate (v10.7.2) that uses the same servers as translate.google.com. Cross-platform (Node.js, browsers) via Fetch API, ships TypeScript types. Supports automatic language detection, spelling/language correction, batch translation (arrays/objects), and text-to-speech. Differentiators: supports both single and batch translate endpoints for reliability, provides a Translator class for option persistence, and includes over 100 languages. Actively maintained with weekly releases.
npm install google-translate-api-xVerified import paths — ran on the pinned version, not inferred.
Demonstrates default and named imports, single and batch translation, text-to-speech, Translator class, and language utilities.
Split text into chunks of 5000 chars or less before translating.
Set { client: 'gtx' } in options when calling translate() or use Translator with client option.Avoid relying on autoCorrect results; use with caution.
Use singleTranslate for accuracy, batchTranslate for performance when accuracy is less critical.
Set { client: 'gtx' } in options: await translate('text', { to: 'en', client: 'gtx' })Run: npm install google-translate-api-x
Use: import translate from 'google-translate-api-x' or const translate = require('google-translate-api-x').defaultAvoid translating results of translate() repeatedly; ensure termination condition.
No dependency data recorded yet.