Translation API with flat per-call pricing

Flat per-call pricing. Send a tweet or a contract for the same credit.

POST /v1/translate 1 credit Utilities

Translate UGC, support tickets, or scraped pages into any of 28 languages. We don't charge per character: one call, one credit, whether you send a tweet or a contract.

The hard part

Per-character pricing is fine until your users paste a contract or a long thread, and suddenly one record costs more than a hundred others combined. A flat per-call price means your translation line item scales with usage, not with how long the strings are.

Translation API: what you get

  • 28 source/target languages, source="auto" for detection.
  • Flat 1 credit per call. Predictable cost on big texts.
  • Returns detected source language alongside the translation.
  • Each call takes up to 5,000 characters of text; split longer documents across calls.
  • Region and script tags are normalised for you: pt-BR, es-419, zh-TW and en_US all work.

Translation API use cases

  • Translate scraped pages

    Turn foreign-language text from the Web Scraping API into English before it reaches your pipeline.

  • Support tickets and reviews

    Translate user-generated text at a predictable cost, with detected_source telling you what language came in.

  • Short strings at the same price

    Product titles, UI copy and notifications cost the same flat credit as a long paragraph.

Translation API quickstart: Python, Node and curl

Install the SDK with pip install scrapenest (PyPI) or npm install scrapenest (npm), or send the raw HTTP call with your key in the Authorization: Bearer header. No key yet? Sign up free, verify your email, then create a key in your dashboard.

import os
from scrapenest import Client

client = Client(os.environ["SCRAPENEST_API_KEY"])
res = client.translate("Estoy buscando un buen restaurante de tapas cerca de la Plaza Mayor", "en")
print(res.translated)
print(res.detected_source, "->", res.target, res.credits_charged, "credit")

Translation API request and response

Request body

{
  "text": "Estoy buscando un buen restaurante de tapas cerca de la Plaza Mayor",
  "target": "en",
  "source": "auto"
}

Response JSON

{
  "translated": "I am looking for a good tapas restaurant near Plaza Mayor",
  "detected_source": "es",
  "target": "en",
  "credits_charged": 1
}

Fields with no value are left out of the JSON rather than sent as null, so read optional fields defensively.

Translation API pricing

1 credit per call regardless of length. No per-character or per-word fee. Each call takes up to 5,000 characters of text, and a call whose source already equals the target returns the text unchanged for 0 credits.

Plans and pay-as-you-go rates are on the pricing page.

Translation API limits

  • text: 1 to 5,000 characters per call.
  • Supported codes: ar, cs, da, de, el, en, es, fi, fr, he, hi, hu, id, it, ja, ko, nb, nl, pl, pt, ro, ru, sv, th, tr, uk, vi, zh-hans and zh-hant.
  • Region and script subtags are normalised (pt-BR becomes pt, zh-TW becomes zh-hant), and underscore forms like en_US work.
  • Translations are never cached: every call translates fresh.

Translation API error codes

HTTPCodeMeaning
422validation_errorAn unsupported target or source, or text over 5,000 characters; details[] names the field.
400unsupported_detected_sourceAuto-detection found a language that isn't supported. Pass source explicitly.
400translation_rejectedThe language pair or input was rejected. Not billed.
503upstream_failedTranslation is temporarily unavailable. Not billed; retry.

Every endpoint can also return 401 unauthorized (missing or wrong key), 402 insufficient_credits (balance used up), 403 email_not_verified (an email signup must verify its address before its key works) and 429 rate_limited or concurrency_limit_exceeded. All errors share one JSON envelope; see the error reference.

questions

Translation API FAQ

How much does translation cost?

1 credit per call whatever the length, up to the 5,000-character limit per call. A call whose source already equals the target returns the text unchanged and bills 0.

Which languages are supported?

28 languages: Arabic, Czech, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Norwegian Bokmål, Dutch, Polish, Portuguese, Romanian, Russian, Swedish, Thai, Turkish, Ukrainian, Vietnamese and Chinese, in both Simplified (zh-hans) and Traditional (zh-hant) script.

Does it detect the source language?

Yes. source defaults to auto, and detected_source in the response reports what came in. If the detected language isn't supported, the call returns a 400 unsupported_detected_source instead of a wrong translation.

How long can the text be?

Up to 5,000 characters per call. For longer documents, split on paragraph boundaries and send each part as its own call; each part bills 1 credit.

Page updated