google翻译api

纯净搜索 为您找到 本页 8 条,用时 0 秒(数据源:bingrss)

AI 回答 由 glm-4-flash 生成 · 仅供参考,请自行核实
1. 功能:Google翻译API提供文本翻译服务,支持多种语言之间的转换。
2. 使用方式:通过HTTP请求发送待翻译文本,API返回翻译后的文本。
3. 限制:免费版每月有免费请求次数限制,超过限制需付费。
4. 代码示例:```python
import requests

def translate(text, source_lang, target_lang):
url = "https://translation.googleapis.com/language/translate/v2"
params = {
"q": text,
"source": source_lang,
"target": target_lang,
"format": "text",
"key": "YOUR_API_KEY"
}
response = requests.get(url, params=params)
return response.json().get("data", {}).get("translations", [{}])[0].get("translatedText")

使用示例
translated_text = translate("你好", "zh-CN", "en")
print(translated_text)

Google

Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
google.com

Sign in - Google Accounts

Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode Next Create account
accounts.google.com

Google Search

Google Search provides a fast, easy way to find information, images, videos and more across the web.
ogs.google.com

Gmail - Google Accounts

Gmail is email that’s intuitive, efficient, and useful. 15 GB of storage, less spam, and mobile access.
accounts.google.com

Google - Apps on Google Play

Download the Google app to find quick answers, explore your interests, and ask anything on your mind in any way. Try AI in Google Search with AI Mode, Lens, Search Live, and more.
play.google.com