Powerful API Integrations
Seamlessly integrate Translaytor's translation capabilities into your applications with our secure and easy-to-use API
// Simple API request example
fetch('https://api.translaytor.com/v1/translate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
text: 'Hello world',
sourceLanguage: 'en',
targetLanguage: 'es'
})
})
.then(response => response.json())
.then(data => console.log(data.translatedText))
// Output: "Hola mundo"
RESTful API Design
Our API follows RESTful principles, making it intuitive and easy to integrate with any application. With comprehensive documentation and predictable resource-oriented URLs, you'll be up and running in minutes.
- Simple, consistent endpoint structure
- JSON request and response format
- Comprehensive error handling
Enterprise-Grade Security
Security is our top priority. Our API is built with multiple layers of protection to ensure your data remains safe and private.
Authentication & Authorization
Secure API key authentication with JWT tokens and role-based access control. Each API key has specific permissions and can be revoked at any time.
Data Encryption
All data is encrypted in transit with TLS 1.3 and at rest with AES-256 encryption. Your sensitive information never leaves our secure environment unprotected.
Compliance & Auditing
Comprehensive audit logs track all API activity. We maintain compliance with GDPR, HIPAA, and other regulatory requirements to protect your data.
Key API Endpoints
/v1/translate/text
Translate text between languages
Request Parameters
text
- Text to translatesourceLanguage
- Source language code (optional)targetLanguage
- Target language code
Response
translatedText
- Translated textdetectedLanguage
- Detected source language (if not provided)
/v1/translate/document
Translate documents with preserved formatting
Request Parameters
file
- Document file (multipart/form-data)sourceLanguage
- Source language code (optional)targetLanguage
- Target language code
Response
jobId
- Job identifier for status checkingstatus
- Initial job status
/v1/jobs/{jobId}
Check the status of an asynchronous translation job
Path Parameters
jobId
- Job identifier
Response
status
- Job status (pending, processing, completed, failed)resultUrl
- URL to download the result (when completed)error
- Error message (if failed)
Integration Examples
Web Applications
Integrate Translaytor into your web application to provide real-time translation capabilities.
// JavaScript example
document.getElementById('translateBtn').addEventListener('click', async () => {
const text = document.getElementById('sourceText').value;
const targetLang = document.getElementById('targetLang').value;
try {
const response = await fetch('https://api.translaytor.com/v1/translate/text', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
text: text,
targetLanguage: targetLang
})
});
const data = await response.json();
document.getElementById('result').textContent = data.translatedText;
} catch (error) {
console.error('Translation failed:', error);
}
});
Mobile Applications
Add translation capabilities to your iOS or Android applications.
// Swift example for iOS
func translateText(text: String, targetLanguage: String) {
guard let url = URL(string: "https://api.translaytor.com/v1/translate/text") else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")
let parameters: [String: Any] = [
"text": text,
"targetLanguage": targetLanguage
]
request.httpBody = try? JSONSerialization.data(withJSONObject: parameters)
URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else { return }
if let result = try? JSONDecoder().decode(TranslationResponse.self, from: data) {
DispatchQueue.main.async {
self.resultLabel.text = result.translatedText
}
}
}.resume()
}
Official Client Libraries
JavaScript
Official JavaScript library for Node.js and browser applications.
npm install translaytor-api
Python
Python library for server-side applications and data processing.
pip install translaytor
.NET
.NET library for C# and other .NET language applications.
Install-Package Translaytor.API
Ready to Integrate?
Sign up for a free API key and start integrating Translaytor's powerful translation capabilities into your applications today.