googletrans-curl
googletrans-curl is a fast, drop-in replacement fork of googletrans that integrates curl-cffi to eliminate Google Translate HTTP 429 Too Many Requests and rate-limiting blocks via browser TLS fingerprint impersonation.
Drop-in Replacement for googletrans
The PyPI distribution package is named googletrans-curl, but the Python import namespace remains googletrans:
# Uninstall old package if present
pip uninstall googletrans
# Install drop-in replacement
pip install googletrans-curl
Existing applications continue importing googletrans with zero code modifications:
from googletrans import Translator
Why googletrans-curl?
The upstream googletrans uses httpx for HTTP requests. Google Translate's web endpoints actively monitor client TLS handshakes and HTTP/2 settings, frequently rejecting automated Python HTTP clients with HTTP 429 Too Many Requests or HTTP 403 Forbidden.
googletrans-curl solves this by introducing a flexible HTTP layer backed by curl-cffi. By impersonating real browser fingerprints (default: Chrome), requests match legitimate browser traffic and bypass fingerprint-based rate limiting.
Architecture
Existing Application
│
│ from googletrans import Translator
▼
┌───────────────┐
│ Translator │
│ Python API │
└───────┬───────┘
│
┌───────▼───────┐
│ HTTP Session │
│ Abstraction │
└───┬───────┬───┘
│ │
transport="curl"│ │ transport="httpx"
│ │
▼ ▼
curl-cffi httpx
│
(Chrome impersonation)
│
▼
Google Translate Service
Features
- Drop-in Compatible: 100% compatible with existing
googletranscode. - Anti-429 Protection: Uses
curl-cffiwith Chrome TLS/HTTP2 impersonation. - Pluggable Transports: Switch between
curl(anti-blocking) and standardhttpx. - Async First: Native
async/awaitsupport with async context manager. - Bulk Translation: Efficiently translate batches of text in a single request.
- Auto Language Detection: Automatically detect language and confidence scores.
- CLI Tool Included: Includes the command-line utility
translate. - Complete Type Annotations: Fully typed for modern Python environments.
Installation
pip install googletrans-curl
Requirements: Python 3.8 or newer.
Quickstart
Basic Usage (Async)
import asyncio
from googletrans import Translator
async def main():
async with Translator() as translator:
# Detect and translate to English (default)
result = await translator.translate("안녕하세요.")
print(result.text) # "Hello."
print(result.src) # "ko"
# Translate to Japanese
result = await translator.translate("안녕하세요.", dest="ja")
print(result.text) # "こんにちは。"
# Specify source language
result = await translator.translate("veritas lux mea", src="la", dest="en")
print(result.text) # "truth is my light"
asyncio.run(main())
Transport Configuration
By default, Translator() automatically uses curl-cffi with Chrome impersonation. You can customize the transport and browser fingerprint as needed:
from googletrans import Translator
# Default: automatic browser impersonation via curl-cffi
translator = Translator()
# Explicit curl transport with Safari impersonation
translator = Translator(
transport="curl",
impersonate="safari",
)
# Standard httpx transport
translator = Translator(
transport="httpx",
)
Available impersonation presets for curl-cffi include: "chrome", "chrome110", "chrome120", "safari", "safari15_3", "safari15_5", "edge99", "edge101", etc.
Advanced Usage
Bulk Translation
Translate multiple strings in a single call:
import asyncio
from googletrans import Translator
async def main():
async with Translator() as translator:
phrases = ["The quick brown fox", "jumps over", "the lazy dog"]
translations = await translator.translate(phrases, dest="ko")
for item in translations:
print(f"{item.origin} -> {item.text}")
asyncio.run(main())
Language Detection
Detect the language of text with confidence scores:
import asyncio
from googletrans import Translator
async def main():
async with Translator() as translator:
detection = await translator.detect("이 문장은 한글로 쓰여졌습니다.")
print(detection.lang) # "ko"
print(detection.confidence) # 0.27...
asyncio.run(main())
Custom Service URLs
Use alternate Google Translate service endpoints:
# Rotate across multiple domains
translator = Translator(service_urls=[
"translate.google.com",
"translate.google.co.kr",
])
# Direct client API (no token acquirer needed)
translator = Translator(service_urls=[
"translate.googleapis.com",
])
Command-Line Tool
googletrans-curl includes the translate CLI command:
# Translate text to English (default)
translate "veritas lux mea" -s la -d en
# Translate text to Korean
translate "Hello world" -d ko
# Detect language
translate -c "안녕하세요."
Unofficial API Disclaimer
License
This project is licensed under the MIT License. Upstream copyright (c) 2015 SuHun Han. Modifications copyright (c) 2026 Klaus Kreier and contributors.
Metadata
Release files for googletrans-curl 4.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| googletrans_curl-4.0.3.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| googletrans_curl-4.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.3 kB
Release files / googletrans_curl-4.0.3.tar.gz
| Download URL | googletrans_curl-4.0.3.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6813d6f4567cdf59d552c4a7dfe994f56059cf7cfe4993be0299707f3eb1f26b
|
|
BLAKE2b-256 checksum How to use checksums |
c98270a27c5a9ed54f7bd453fb6255405ab5d62bcf861dfa7c9fded8e5ba8db9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / googletrans_curl-4.0.3-py3-none-any.whl
| Download URL | googletrans_curl-4.0.3-py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1040bf03427234b990cda5e8310a2a94d8cd41aa4d54e30116bf1ded9bfd92c7
|
|
BLAKE2b-256 checksum How to use checksums |
9a6304aafc69ad6833777f5472a3e69717f52ae9ab4eb95f3b3f72a7d9e03e82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|