Translation API Reference
The Translation API allows you to translate text content between different locales while maintaining formatting. It supports various text formats and includes caching capabilities for improved performance.
Authentication
All API requests require authentication using an API key. Include your API key in the request headers:
Endpoints
Translate Text
POST /api/translate
Translates text content between specified locales.
Request Body
Response
Success Response (200 OK)
Error Response (4xx, 5xx)
Example Request
Example Response
Error Codes
The API uses conventional HTTP response codes to indicate the success or failure of requests:
401- Invalid or missing API key400- Invalid request parameters403- API key valid but insufficient permissions or exceeded limits500- Server error
Rate Limiting
API requests are subject to rate limiting based on your project's configuration. The limits are verified for each API key and project combination.
Caching
The API supports optional caching of translation results. When cache is set to true:
- Before translation, the system checks for a cached version
- If found, returns the cached translation
- If not found, performs the translation and caches the result for future use
Supported Formats
The API supports various text formats including:
string- Plain text stringsjson- JSON files and objectsyaml- YAML filesproperties- Java properties filesandroid- Android string resourcesxcode-strings- iOS/macOS .strings filesxcode-stringsdict- iOS/macOS .stringsdict filesxcode-xcstrings- iOS/macOS .xcstrings filesmd- Markdownmdx- MDX (Markdown with JSX)html- HTML filesjs- JavaScript filests- TypeScript filespo- Gettext PO filesxliff- XLIFF translation filescsv- CSV filesxml- XML filesarb- Application Resource Bundle filesftl- Fluent FTL filesphp- PHP files
Additional formats may be supported based on your project configuration.
How is this guide?
Last updated on