RepositoryJavaScriptCNChina
plainheart

plainheart/bing-translate-api

A simple and free API for Bing & Microsoft Translator for Node.js

229stars
40forks
0issues
4views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: microsoft-translator

#1 Repository of the month

1
TINIX TRENDING·Topic: microsoft-translator

#1 Repository of the week

1
TINIX TRENDING·Topic: translator

#1 Repository of the month

bing-translate-api

NPM version Auto Test NPM Downloads License

A simple and free API for Bing Translator and Microsoft Translator for Node.js.

Install

npm install bing-translate-api

Usage

Microsoft Translator 🆕

Added since v4.0.0. More stable and powerful. Both free service and paid service are supported. Feel free to give it a try!

Read the README for more details.

Bing Translator

From auto-detected language to English:

const { translate } = require('bing-translate-api');

translate('你好', null, 'en').then(res => {
  console.log(res.translation);
}).catch(err => {
  console.error(err);
});

Translation result

{
  // original text
  "text": "你好",
  // user-specified language code
  "userLang": "auto-detect",
  // translated text
  "translation": "Hello",
  // `correctedText` is returned only when `correct` is set as `true`
  // supported since v1.1.0
  "correctedText": "",
  // detected language
  "language": {
    // language code of translated text
    "to": "en",
    // detected language code of original text
    "from": "zh-Hans",
    // score of language detection
    // supported since v1.1.0
    // (NOTICE: This field may not be provided at present)
    "score": 1
  },
  // feminine translation text (Only be returned when the translation result is gender-debiased)
  // supported since v4.1.0
  "feminineTranslation": undefined,
  // masculine translation text (Only be returned when the translation result is gender-debiased)
  // supported since v4.1.0
  "masculineTranslation": undefined
}

API

translate(text, [from], [to], [correct], [raw], [userAgent], [proxyAgents])

text

Type: string

The text to be translated, can't be blank. The maximum text length is 1000.

NOTE:

  1. The maximum text length is up to 5000 characters only in China.
  2. In EPT mode (since v3.0.0), the maximum text length is currently 3000.
from

Type: string Default: auto-detect

The language code of source text.

MUST be auto-detect or one of the codes/names (not case sensitive) contained in lang.json

NOTE: The EPT mode (since v3.0.0) only supports the languages contained in src/config.json#eptLangs. Any other language will fall back to the legacy mode, in which a 429 (Too Many Requests) error often occurs.

to

Type: string Default: en

The language in which the text should be translated.

MUST be one of the codes/names (not case sensitive) contained in lang.json.

NOTE: The EPT mode (since v3.0.0) only supports the languages contained in src/config.json#eptLangs. Any other language will fall back to the legacy mode, in which a 429 (Too Many Requests) error often occurs.

correct

Type: boolean Default: false Since: v1.1.0

Whether to correct the input text.

Note that:

  1. There is currently a limit of 50 characters for correction service.
  2. Only the languages in the list are supported to be corrected.
raw

Type: boolean Default: false

Whether the translation result contains raw response from Bing API.

userAgent

Type: string

The header value of user-agent used in API requests.

Refer to src/config.json#userAgent for the default user agent.

proxyAgents

Type: Got['Agents'] Default: undefined Since: v2.4.0

Set agents of got for proxy.

License

MIT © 2021-2025 plainheart.

Thanks

Great thanks to Bing Translator for providing such an excellent translation service.

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
LibreTranslate/LibreTranslate

Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup.

17.9k
Nov 25, 2026
RepositoryPython
public-apis/public-apis

A collective list of free APIs

502.6k
Nov 30, 2026
RepositoryJavaScript
nodejs/node

Node.js JavaScript runtime ✨🐢🚀✨

124.1k
Nov 30, 2026
RepositoryJavaScript
react/react

The library for web and native user interfaces.

253.0k
Nov 30, 2026
RepositoryJavaScript
trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

196.8k
Jul 26, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryTypeScript
vuejs/vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

212.6k
Oct 10, 2024