Lecto Translation

FREEMIUM
Verified
By Lecto | Updated 9 days ago | Translation
Popularity

9.7 / 10

Latency

127ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Character Count for "Translate JSON Payload" endpoint

Rapid account: Valepro
valepro
3 years ago

You have JSON translation endpoint https://lecto-translation.p.rapidapi.com/v1/translate/json

In your “About” page you say

Maximum Characters in a Single Request

    Basic Plan: 1000 characters.
    Pro Plan: 1000 characters.
    Ultra Plan: 5000 characters.
    Mega Plan: 5000 characters.

It is not clear to me how you calculate the number of characters for the pricing plan? Do you include only my JSON text which I want to translate or do you include full request payload?

Your example:

{
    "to": [
        "de"
    ],
    "from": "en",
    "protected_keys": [
        "team.name",
        "team.players"
    ],
    "json": "{\"team\":{\"name\":\"Los Angeles Lakers\",\"players\":[\"LeBron James\",\"Andre Drummond\"],\"player_ages\":{\"LeBron James\":36,\"Andre Drummond\":28},\"player_summary\":{\"LeBron James\":\"Widely considered one of the greatest NBA players in history.\",\"Andre Drummond\":\"A two-time NBA All-Star, he has led the league in rebounding four times and also been named to the All-NBA Third Team.\"}}}"
}

What will character count be here? ^

Rapid account: Sibaridev
sibaridev Commented 2 years ago

Hi !,

We developed a NEW RAPID MULTI TRANSLATE API that allow you translate multi texts in one fast query, wish help you improve response time and your service quality.
NEW API : https://rapidapi.com/sibaridev/api/rapid-translate-multi-traduction/

Request Example : [
	"Hello",
	"Whats",
	"<h1>Test</h1>",
	"Translate API",
	"Rapid Translate Multi Traduction"
	...
]
Response Example : [
	"أهلا",
	"ما هى",
	"<h1>اختبار</h1>",
	"ترجمة API",
	"ترجمة سريعة متعددة Traduction"
	...
]

We strive to give you the best, fast and cheaper results.

Thank you,

Rapid account: Lecto Support
LectoSupport Commented 3 years ago

Hi valepro,

For the JSON payload translation endpoint, the character count is based on the following criteria:

  1. The entire value of the json field of the input is counted for the character count.
  2. The character count is performed after escaping the input json value. So in the example you posted:

json value before escaping:

{\"team\":{\"name\":\"Los Angeles Lakers\",\"players\":[\"LeBron James\",\"Andre Drummond\"],\"player_ages\":{\"LeBron James\":36,\"Andre Drummond\":28},\"player_summary\":{\"LeBron James\":\"Widely considered one of the greatest NBA players in history.\",\"Andre Drummond\":\"A two-time NBA All-Star, he has led the league in rebounding four times and also been named to the All-NBA Third Team.\"}}}

json value after escaping:

{"team":{"name":"Los Angeles Lakers","players":["LeBron James","Andre Drummond"],"player_ages":{"LeBron James":36,"Andre Drummond":28},"player_summary":{"LeBron James":"Widely considered one of the greatest NBA players in history.","Andre Drummond":"A two-time NBA All-Star, he has led the league in rebounding four times and also been named to the All-NBA Third Team."}}}

Thus, the character count for the above is “372”, which can be verified from the API response:

"translated_characters": 372

Please note that values for protected_keys are also included in this character count. In other words, protected_keys do not have any effect on the chracter count here.

Regards,

Lecto Team
support@lecto.ai

Join in the discussion - add comment below:

Login / Signup to post new comments