Faraatarjomeh API
Pages

For AI agents: this page as Markdown at https://faraatarjomeh.com/api/v1/docs/guides/content-translation.md; all docs in one file at llms-full.txt.

Website and app copy

Send the English text of a website or app (an i18n JSON file, Markdown pages, HTML, or a list of strings) and get the same file back in natural Persian: the same keys, placeholders, tags, links and code, with Persian text that reads as if it was written in Persian. Sequence: POST /api/v1/content/translate with dryRun: true (the price) → POST /api/v1/content/translate → the answer has content, or poll GET /api/v1/content/jobs/{id}.

At a glance#

What you send#

Field Meaning
format json (any object or array), markdown, html (a page or a fragment), strings (a string or an array of strings).
content The English text in that shape.
brief One or two sentences: what the product is and who reads it. The Persian fits better with it.
tone neutral (default), formal, friendly.
glossary Terms that must be translated one way: { "dashboard": "پیشخوان", "Acme": "Acme" }. A translation equal to the term keeps it in English.
keep Names to leave in English everywhere: ["Acme", "Acme Cloud"].
notes Per JSON key: where the string is used and a length limit: { "nav.signup": { "note": "button", "maxLength": 12 } }.
skipKeys json: key paths to leave as they are. Parts are joined by dots; * matches inside one part and ** any number of parts: meta.*, **.url, faq.*.q (or faq[*].q). A pattern that matches no string is reported in warnings.
project Your name for the site. Translation memory is kept per project.
memory use (default), refresh (translate again), off.
digits persian (default) or latin.
dryRun true: only the price.
async true: always answer 202 with a job.

What is never changed:

JSX and other code are not a format: send their strings as json or strings.

Steps#

1. Get the price#

HTTP
POST /api/v1/content/translate HTTP/1.1
Authorization: Bearer fara_sk_...
Content-Type: application/json

{
  "format": "json",
  "content": { "hero": { "title": "Ship faster", "cta": "Start your free trial" }, "plans": "{n, plural, one {# project} other {# projects}}" },
  "brief": "Hosting for small online shops in Iran.",
  "project": "acme-site",
  "dryRun": true
}

Response 200 OK:

JSON
{ "object": "content_translation_quote", "quote": { "maxFara": 1, "characters": 62, "strings": 3, "translatable": 3, "fromMemory": 0, "toTranslate": 3, "repeated": 0, "runs": "now" } }

maxFara is the most the request can cost. Show it to the user before you send the request without dryRun. repeated counts sentences that repeat another string of the request: they are translated once, read the same everywhere, and cost nothing more (a single word is translated per key, because one English word can need two Persian words). When something in the request had no effect, the answer also has warnings (for example a skipKeys pattern that matched nothing).

curl
curl -sS -X POST "https://faraatarjomeh.com/api/v1/content/translate" \
  -H "Authorization: Bearer $FARA_API_KEY" -H "Content-Type: application/json" \
  -d '{"format":"strings","content":["Save changes","Delete project?"],"dryRun":true}'

2. Translate#

Send the same body without dryRun, with an Idempotency-Key (a new UUID per request; reuse it on retries).

Response 200 OK (small work):

JSON
{
  "id": "6740c1f2a9e4b1d2c3f4a5b6",
  "object": "content_translation",
  "status": "completed",
  "format": "json",
  "project": "acme-site",
  "counts": { "strings": 3, "translatable": 3, "fromMemory": 0, "translated": 3, "failed": 0 },
  "price": { "maxFara": 1, "chargedFara": 1 },
  "failed": [],
  "content": { "hero": { "title": "سریع‌تر منتشر کنید", "cta": "دورهٔ رایگان را شروع کنید" }, "plans": "{n, plural, one {# پروژه} other {# پروژه}}" },
  "createdAt": "2026-11-16T09:00:00.000Z",
  "updatedAt": "2026-11-16T09:00:09.000Z",
  "completedAt": "2026-11-16T09:00:09.000Z",
  "links": { "self": "https://faraatarjomeh.com/api/v1/content/jobs/6740c1f2a9e4b1d2c3f4a5b6" }
}

Response 202 Accepted (more work, or async: true): the same job with status: "queued" or "running" and no content, plus quote. Poll links.self (first after 10 s, then every 30–60 s) or wait for a content.completed webhook.

When every string comes from memory, the answer is 200 at once with id: null, content, and nothing charged.

3. Check failed#

Every string is checked before it is returned: all placeholders and tags kept, no English left behind, the maxLength kept. A string that still fails after a second try is listed in failed with its key and reason, and keeps its English text in content. The job is then completed_partial. Send those strings again, or change the note or limit.

Translation memory#

Each account has its own memory, per project. A string translated before (same text, note, tone, digits and glossary terms) comes back the same and costs nothing. So when your site changes, send the whole file again: only new and changed strings are translated and charged, and the rest stay word for word as before.

Errors#

Code When What to do
CONTENT_FORMAT_INVALID (400) content does not match format. Fix the request.
BAD_REQUEST (400) A field is wrong; detail names it. Fix the request.
CONTENT_TOO_LARGE (413) More than 20,000 strings or 1,000,000 characters. Split the content; memory keeps terms the same.
INSUFFICIENT_CREDITS (402) The balance is below maxFara. Tell the user to top up.
JOB_NOT_FINISHED (409) Delete of a running job. Wait for it to finish.

Limits#

Limit Value
Strings per request 20,000
Text per request 1,000,000 characters
Answered in the same call about 6,000 characters (≈1,000 words) of new text
Glossary 500 terms
Rate limits 120 requests per 60 s per API key