Skip to main content

Migrate from Google Translate v2

Langbly is a drop-in replacement for the Google Translate v2 API. Same request format, same response shape. Most teams switch in under 10 minutes.

The 2-Line Change

cURL / raw HTTP

# Before (Google Translate)
POST https://translation.googleapis.com/language/translate/v2?key=GOOGLE_KEY

# After (Langbly)
POST https://api.langbly.com/language/translate/v2
Authorization: Bearer LANGBLY_KEY

The request body and response format are identical.

Python

# Before
from google.cloud import translate_v2 as translate
client = translate.Client()
result = client.translate("Hello world", target_language="nl")

# After
from langbly import Langbly
client = Langbly(api_key="your-langbly-key")
result = client.translate("Hello world", target="nl")

JavaScript / TypeScript

// Before
import { Translate } from "@google-cloud/translate/build/src/v2";
const client = new Translate();

// After
import { Langbly } from "langbly";
const client = new Langbly({ apiKey: "your-langbly-key" });

What stays the same

Everything you already know about Google Translate v2 works with Langbly:

FeatureWorks?
Request body (q, target, source, format)Yes
Response shape (data.translations[].translatedText)Yes
Language codes (ISO 639-1)Yes
HTML mode (format: "html")Yes
Batch requests (array of q values)Yes
Language detection (detectedSourceLanguage)Yes

What's different

Authentication

Google Translate uses an API key in the URL query string:

POST /language/translate/v2?key=YOUR_GOOGLE_KEY

Langbly uses a Bearer token in the Authorization header (more secure):

POST /language/translate/v2
Authorization: Bearer YOUR_LANGBLY_KEY
Why this is better

API keys in URLs appear in server logs, browser history, and referrer headers. Bearer tokens in the Authorization header are the industry standard and never leak through URLs.

Extra features (optional)

Langbly supports additional parameters that Google Translate v2 does not:

ParameterTypeDescription
formality"auto" | "formal" | "informal" | "neutral"Control translation tone

These are optional. Your existing Google Translate requests work without any changes.

Step-by-step migration

1. Get a Langbly API key

Sign up at langbly.com/signup. The free tier includes 500K characters per month, no credit card required.

2. Update your endpoint

Replace the Google Translate URL:

- https://translation.googleapis.com/language/translate/v2?key=GOOGLE_KEY
+ https://api.langbly.com/language/translate/v2

3. Update authentication

Move from URL parameter to Authorization header:

- # API key in URL
- ?key=YOUR_GOOGLE_KEY
+ # Bearer token in header
+ Authorization: Bearer YOUR_LANGBLY_KEY

4. Test

Send a test request:

curl -X POST https://api.langbly.com/language/translate/v2 \
-H "Authorization: Bearer YOUR_LANGBLY_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "Hello world", "target": "nl"}'

Expected response:

{
"data": {
"translations": [
{
"translatedText": "Hallo wereld",
"detectedSourceLanguage": "en"
}
]
}
}

5. Remove Google Cloud dependency

Once verified, you can remove the Google Translate SDK:

# Python
pip uninstall google-cloud-translate

# Node.js
npm uninstall @google-cloud/translate

FAQ

Will my batch requests work?

Yes. Array-style q values work identically:

{
"q": ["Hello", "Goodbye", "Thank you"],
"target": "de"
}

Will HTML translation work?

Yes. Set format: "html" and Langbly will preserve all tags, attributes, and entities:

{
"q": "<p>Hello <strong>world</strong></p>",
"target": "nl",
"format": "html"
}

What about auto-detection?

If you omit the source parameter, Langbly will detect the language and include detectedSourceLanguage in the response, just like Google Translate.

Is there a rate limit difference?

Langbly rate limits are based on your plan tier. See Limits and Timeouts for details.

What if I need help migrating?

Email us at support@langbly.com. We're happy to review your integration and help with the switch.