NAV Navbar
shell

Introduction

Welcome to the Smoogle API! You can use our API to translate text within any application. The API is organized around REST and returns JSON-encoded responses.

If you have any questions, please send an email to developers@smoogle.gg.

Authentication

Authentication is performed with the Authorization HTTP header in the format

Authorization: Bearer your-api-key

You can manage your keys in the API dashboard.

Translate API

Example request

curl -X POST \
  https://api.smoogle.gg/v1/translate/auto/de \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Where is the cheese?"}'

Example response

{
    "text": "Wo ist die Käse?",
    "src": "en",
    "dest": "de",
    "settings" : {
        "languages" : [
            "en",
            "de",
            "ru",
            "fr"
        ]
    }
}

This endpoint will translate text.

POST https://api.smoogle.gg/v1/translate/:src/:dest

Parameter Required Description
dest Yes The destination language.
src Yes The source language. Use "auto" to auto-detect the language.

Response fields

Field Description
text The translated text.
dest The destination language.
src The source language.
settings Settings describing your account or the API. languages is an array of available languages.

Pricing

$20 per month to use the API for an unlimited number of characters.

Rate Limits

Rate limiting of the API is primarily on a per-user basis — or more accurately described, per API key. If a method allows for 30 requests per rate limit window, then it allows 30 requests per window per API key. In addition, rate limits may be applied on a per-route basis or globally.

The returned HTTP headers of any API request show your current rate limit status:

Header Description
X-RateLimit-Limit The maximum number of requests you're permitted to make in the current rate limit window.
X-RateLimit-Remaining The number of requests remaining in the current rate limit window.
X-RateLimit-Reset The time at which the current rate limit window resets in UTC epoch seconds.

Because we may change rate limits at any time and rate limits can be different per application, rate limits should not be hard coded into your bot/application. In order to properly support our dynamic rate limits, your application should parse for our rate limits in response headers and locally prevent exceeding of the limits as they change.

Errors

The Smoogle API uses the following error codes:

Error Code Meaning
200 OK -- Everything is working as expected.
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
402 Request Failed -- The parameters were valid but the request failed.
404 Not Found -- The requested resource doesn't exist.
429 Too Many Requests -- Too many requests hit the API too quickly and the rate limit was exceeded. Slow down and try again later.
500, 502, 503, 504 Server Errors -- We had a problem with our server. Try again later.