Skip to main content
Polyglot CloudPolyglot Cloud
Developer Documentation

API Reference

Build integrations with the Polyglot Cloud API. RESTful endpoints, Translation Memory, and community consensus — all in one platform.

Using WordPress? You don't need this API — install the one-click plugin instead.Get the plugin

Quick Start

Get up and running in minutes. All you need is an API key.

Base URL
https://api.polyglot-translate.cloud/v1
Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY
Content-Type
Content-Type: application/json

Example request

curl
curl -X POST https://api.polyglot-translate.cloud/v1/translate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, world!",
    "sourceLang": "en",
    "targetLang": "sr"
  }'

Endpoints

All endpoints return JSON. Authenticated endpoints require a Bearer token.

POST/v1/translate

Translate text

Translate a string from one language to another. Uses Translation Memory first, then falls back to provider routing (OPUS-MT, Gemini, Argos).

Request body
{
  "text": "Hello, world!",
  "sourceLang": "en",
  "targetLang": "sr",
  "context": "homepage hero"
}
Response
{
  "translations": [
    {
      "text": "Zdravo, svete!",
      "provider": "community_tm",
      "confidence": 95,
      "cached": true
    },
    {
      "text": "Pozdrav, svete!",
      "provider": "opus_mt",
      "confidence": 70,
      "cached": false
    }
  ],
  "_metadata": {
    "sourceLang": "en",
    "targetLang": "sr",
    "tmHit": true
  }
}
POST/v1/translate/publicNo auth required

Public translate (multi-option)

Public endpoint that returns multiple translation options with community votes. No authentication required. Rate-limited per IP.

Request body
{
  "text": "Welcome to our website",
  "sourceLang": "en",
  "targetLang": "sr"
}
Response
{
  "translations": [
    {
      "text": "Dobrodošli na naš sajt",
      "provider": "community_tm",
      "confidence": 95,
      "votes": {
        "up": 47,
        "down": 0
      }
    },
    {
      "text": "Dobrodošli na našu web stranicu",
      "provider": "gemini",
      "confidence": 72,
      "votes": {
        "up": 12,
        "down": 0
      }
    }
  ],
  "_metadata": {
    "sourceLang": "en",
    "targetLang": "sr",
    "tmHit": true
  }
}
GET/v1/usage

Get credit usage

Returns your current credit usage and plan limits. The Polyglot Translate WordPress plugin deduplicates duplicate strings locally before they reach our API, so your effective character spend stays low.

Response
{
  "used": 1234,
  "limit": 50000,
  "remaining": 48766,
  "plan": "pro"
}
GET/v1/sites

List connected sites

Returns all sites connected to your account (WordPress, Shopify, or custom integrations), including their status and language configuration.

Response
[
  {
    "id": "site_abc123",
    "domain": "example.com",
    "status": "active",
    "languages": [
      "en",
      "sr",
      "de"
    ],
    "createdAt": "2026-01-15T10:00:00Z"
  }
]
POST/v1/translate/public/batchNo auth required

Public batch translate

Translate multiple strings in one request without authentication. Up to 20 texts per batch. TM is checked for each string — only cache misses hit the provider. Rate-limited per IP.

Request body
{
  "texts": [
    "Add to cart",
    "Checkout",
    "My Account"
  ],
  "sourceLang": "en",
  "targetLang": "de"
}
Response
{
  "results": [
    {
      "sourceText": "Add to cart",
      "text": "In den Warenkorb",
      "provider": "community_tm",
      "confidence": 97,
      "tmHit": true
    },
    {
      "sourceText": "Checkout",
      "text": "Zur Kasse",
      "provider": "gemini",
      "confidence": 72,
      "tmHit": false
    },
    {
      "sourceText": "My Account",
      "text": "Mein Konto",
      "provider": "community_tm",
      "confidence": 94,
      "tmHit": true
    }
  ],
  "sourceLang": "en",
  "targetLang": "de"
}
POST/v1/translate/batch

Batch translate (authenticated)

Translate multiple strings in a single request. Up to 100 texts per batch. TM is checked for each string individually — only cache misses hit the provider. Credits deducted only for API calls, not TM hits.

Request body
{
  "texts": [
    "Add to cart",
    "Checkout",
    "My Account"
  ],
  "source": "en",
  "target": "de"
}
Response
{
  "translations": [
    {
      "text": "In den Warenkorb",
      "provider": "community_tm",
      "confidence": 97,
      "tmHit": true
    },
    {
      "text": "Zur Kasse",
      "provider": "gemini",
      "confidence": 72,
      "tmHit": false
    },
    {
      "text": "Mein Konto",
      "provider": "community_tm",
      "confidence": 94,
      "tmHit": true
    }
  ],
  "tmHits": 2,
  "apiCalls": 1
}
POST/v1/feedback

Submit translation feedback

Vote on a translation (upvote/downvote) or suggest an improvement. Feedback drives the self-learning system — good translations get promoted, bad ones get demoted.

Request body
{
  "entryId": "tm_abc123",
  "action": "upvote"
}
Response
{
  "success": true,
  "newScore": 0.97
}
POST/v1/translate/public/voteNo auth required

Vote on translation

Upvote or downvote a translation variant. Votes influence quality tier promotion (candidate → verified → gold). No authentication required.

Request body
{
  "variantId": "var_abc123",
  "vote": "up"
}
Response
{
  "success": true,
  "votes": 48
}
GET/v1/geoNo auth required

Detect visitor country

Returns the visitor's country based on Cloudflare CF-IPCountry header. Used for language auto-detection. No authentication required.

Response
{
  "country": "DE"
}
POST/v1/tm/contribute

Contribute translation to TM

Submit a human translation to the Translation Memory. Contributions start as "candidate" and are promoted through trust tiers (candidate, verified, gold) based on community consensus.

Request body
{
  "sourceText": "Thank you",
  "targetText": "Hvala",
  "sourceLang": "en",
  "targetLang": "sr"
}
Response
{
  "id": "contrib_xyz789",
  "status": "candidate"
}

Rate Limits

Rate limits depend on your plan. TM lookups are always free and do not count against your translation quota. Limits are returned in response headers.

PlanRequestsBurstCharacters
Free100/min10/sec10,000 (lifetime trial)
Starter300/min30/sec50,000/mo
Pro1,000/min100/sec200,000/mo
Business3,000/min300/sec1,000,000/mo
EnterpriseCustomCustomUnlimited
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset

Error Codes

All errors return a consistent JSON structure with a status code and message.

Error response format
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please retry after 30 seconds.",
    "retryAfter": 30
  }
}
StatusCodeDescription
400INVALID_REQUESTMissing or invalid parameters
401UNAUTHORIZEDInvalid or missing API key
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource not found
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_ERRORServer error — contact support

SDKs

Official client libraries are under development. In the meantime, use the REST API directly with any HTTP client.

{}

JavaScript / TypeScript

Coming soon
#

Python

Coming soon
$

PHP

Coming soon

WordPress Plugin

The easiest way to use Polyglot Cloud. Install the WordPress plugin and translate your site with one click — no API integration needed.

How it connects

The WordPress plugin acts as a client for this API. When you activate the plugin and enter your API key, it handles all translation calls automatically. The plugin includes built-in Translation Memory caching — translations are stored locally in your WordPress database for instant retrieval.

Available addons

  • Pro — Unlimited languages, Magic Translate, bulk operations, XLIFF/CSV export
  • WooCommerce — Products, cart, checkout, 9 email types, HPOS support
  • SEO — Yoast/RankMath/SEOPress orchestration, hreflang, JSON-LD translation
  • Elementor — Data-level widget translation, Theme Builder, forms, popups
  • Contact Form 7 — Form labels, email templates, CF7 tag safety (free)

Ready to get started?

Create a free account to get your API key and start translating with 10,000 free characters to try the API.