---
title: "Hebrew RTL API: Bidi Display for Mixed Hebrew-English Text"
slug: "hebrew-rtl-api"
canonical: "https://www.itsbaba.com/hebrew-rtl-api"
question: "Is there an API for displaying mixed Hebrew and English text correctly?"
answer: "Yes. baba HebrewCore, the Hebrew API from baba, has POST /v1/wrap, which returns a render-ready display line (HTML, Unicode isolates or direction marks) in which every left-to-right unit such as a range, a product name or a date stays whole and in order, and POST /v1/analyze, which returns the direction structure of a string or a whole record. Both run with no model and are not counted against the quota."
description: "Render mixed Hebrew and English text correctly: baba HebrewCore /v1/wrap and /v1/analyze keep prices, ranges, dates and signs whole in RTL lines. Free to call."
cluster: "developers"
html_status: "live"
updated: "2026-09-27"
numbers_used: "[100, 20000]"
competitors_named: "[Google Cloud Translation]"
---

# Hebrew RTL API: bidi display for mixed Hebrew and English

baba HebrewCore, the Hebrew API from baba and the engine the baba Hebrew translator app runs on, is an RTL API for mixed Hebrew and English. POST /v1/wrap returns a render-ready display line in which every left-to-right unit stays whole and in order, and POST /v1/analyze returns the direction structure of a string or a whole record. Both run with no model and are not counted against the quota.

## What breaks

A Hebrew line runs right to left, but prices, percentages, ranges, dates, product names and comparisons inside it run left to right. Left to the Unicode Bidirectional Algorithm alone, a range can split around its dash and a sign such as <5 can mirror.

HebrewCore returns two run lists: `runs` (exactly what the algorithm resolves, defects included) and `display_runs` (every left-to-right unit kept whole). Render `display_runs`, or let `/v1/wrap` produce the markup.

## Wrap a line

```bash
curl https://hc.itsbaba.com/v1/wrap \
  -H "Authorization: Bearer hc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "text": "הנחה: 10–20% על Galaxy S25 עד 31/12", "format": "html", "base": "rtl" }'
```

The output wraps the line in a `<span dir="rtl">` and each left-to-right unit (the range, the product name, the date) in its own `<span dir="ltr">`.

## Formats

- `html` (default): spans for the web, React and webviews.
- `isolate`: Unicode isolates for modern text engines (iOS, Android 7+, current browsers).
- `marks`: LRM and RLM marks, which render on every engine, including older Android and embedded displays.

`base` is `auto` (first strong letter), `rtl` or `ltr`. Pass `rtl` for a Hebrew line that starts with a Latin term.

## Analyze a record

```bash
curl https://hc.itsbaba.com/v1/analyze \
  -H "Authorization: Bearer hc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fields": { "title": "מסמך Q3 ready", "subtitle": "Read the summary" } }'
```

Each field returns `dir`, `mixed`, `lang`, `script` and `runs` with UTF-16 `start` and `end` offsets. Up to 100 fields, 20,000 characters in total.

## Other options

Google Cloud Translation adds a style attribute with text-align and direction when it translates HTML between RTL and LTR languages (as of September 2026, https://docs.cloud.google.com/translate/troubleshooting). It does not document a separate display endpoint for mixed-direction lines.

Related: https://www.itsbaba.com/hebrewcore , https://www.itsbaba.com/hebrew-language-detection-api , https://www.itsbaba.com/hebrew-localization-api , https://www.itsbaba.com/rtl-css-checker
