β ƒβ — PolyPage Braille API β€” Documentation

πŸ”‘ Authentification : Ajoutez votre clΓ© API dans le header x-api-key de chaque requΓͺte.
Pas encore de clΓ© ? Inscrivez-vous gratuitement (essai 15 jours).

1. Conversion Braille

POST /api/braille/convert/segment

Convertit un segment de texte en braille dans la langue spΓ©cifiΓ©e.

ParamètreTypeDescription
textstringTexte Γ  convertir
languagestringCode langue (fr, en, de, es, it, pt, ar, ru, nl, tr...)
program_idstringIdentifiant du programme
segment_idstringIdentifiant du segment
startstringTimecode dΓ©but (HH:MM:SS.mmm)
endstringTimecode fin

Python :

# pip install requests
import requests

API_URL = "https://braille-api.i-dubbing.com"
API_KEY = "VOTRE_CLE_API"

response = requests.post(
    f"{API_URL}/api/braille/convert/segment",
    headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
    json={
        "program_id": "mon_projet",
        "segment_id": "seg0001",
        "language": "fr",
        "start": "00:00:01.000",
        "end": "00:00:05.000",
        "text": "Bonjour, bienvenue sur PolyPage"
    }
)

data = response.json()
print(data["segment"]["braille_text"])
# β ¨β ƒβ •β β šβ •β ₯β —β ‚β €β ƒβ Šβ ‘β β §β ‘β β ₯β ‘β €β Žβ ₯⠗⠀⠨⠏⠕⠇⠽⠨⠏⠁⠛⠑

JavaScript :

const API_URL = "https://braille-api.i-dubbing.com";
const API_KEY = "VOTRE_CLE_API";

const response = await fetch(`${API_URL}/api/braille/convert/segment`, {
  method: "POST",
  headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    program_id: "mon_projet",
    segment_id: "seg0001",
    language: "fr",
    start: "00:00:01.000",
    end: "00:00:05.000",
    text: "Bonjour, bienvenue sur PolyPage"
  })
});

const data = await response.json();
console.log(data.segment.braille_text);

2. Sous-titres YouTube

GET /api/braille/youtube/subtitles/{video_id}

Récupère les sous-titres d'une vidéo YouTube avec conversion braille automatique.

ParamètreTypeDescription
video_idstring (URL)ID de la vidΓ©o YouTube (ex: dQw4w9WgXcQ)
languagestring (query)Langue souhaitΓ©e (dΓ©faut: fr)

Python :

response = requests.get(
    f"{API_URL}/api/braille/youtube/subtitles/dQw4w9WgXcQ",
    headers={"x-api-key": API_KEY},
    params={"language": "fr"}
)

data = response.json()
for seg in data["segments"]:
    print(f"{seg['start']} β†’ {seg['text']}")

JavaScript :

const res = await fetch(
  `${API_URL}/api/braille/youtube/subtitles/dQw4w9WgXcQ?language=fr`,
  { headers: { "x-api-key": API_KEY } }
);
const data = await res.json();
data.segments.forEach(s => console.log(`${s.start} β†’ ${s.text}`));

3. Traduction de sous-titres

POST /api/braille/translate

Traduit un ensemble de segments dans la langue cible.

response = requests.post(
    f"{API_URL}/api/braille/translate",
    headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
    json={
        "segments": [
            {"text": "Hello, how are you?"},
            {"text": "I am fine, thank you."}
        ],
        "target_language": "fr"
    }
)
# β†’ "Bonjour, comment allez-vous ?", "Je vais bien, merci."

4. Conversion de fichiers SRT/WebVTT

POST /api/braille/convert/file

Convertit un fichier de sous-titres complet en braille.

with open("sous-titres.srt", "rb") as f:
    response = requests.post(
        f"{API_URL}/api/braille/convert/file",
        headers={"x-api-key": API_KEY},
        files={"file": f},
        data={"language": "fr"}
    )

5. Export BRF / PDF

POST /api/braille/export/pdf

Génère un fichier PDF contenant le texte et le braille.

response = requests.post(
    f"{API_URL}/api/braille/export/pdf",
    headers={"x-api-key": API_KEY, "Content-Type": "application/json"},
    json={
        "segments": [
            {"start": "00:00:01", "end": "00:00:05",
             "text": "Bonjour", "braille": "β ¨β ƒβ •β β šβ •β ₯β —"}
        ],
        "language": "fr"
    }
)

with open("braille.pdf", "wb") as f:
    f.write(response.content)

6. Langues supportΓ©es

GET /api/braille/languages

response = requests.get(
    f"{API_URL}/api/braille/languages",
    headers={"x-api-key": API_KEY}
)
print(response.json()["languages"])
# ["af","ar","bg","ca","cs","de","el","en","eo","es","fi","fr","he","hi","hr",
#  "hu","is","it","ko","nl","no","pl","pt","ru","sk","sl","sr","tr","uk","zh"]

7. Flux temps rΓ©el (WebSocket)

WS /ws/braille/{program_id}

Connexion WebSocket pour recevoir les sous-titres braille en temps rΓ©el.

# pip install websockets
import asyncio, websockets

async def listen():
    uri = "wss://braille-api.i-dubbing.com/ws/braille/mon_programme"
    async with websockets.connect(uri) as ws:
        async for message in ws:
            print("Braille reΓ§u:", message)

asyncio.run(listen())

Codes d'erreur

Code HTTPSignification
200βœ… SuccΓ¨s
403πŸ”‘ ClΓ© API manquante ou invalide
429⏳ Trop de requΓͺtes (rate limit)
500❌ Erreur serveur

Β© 2026 PolyPage β€” j.soto@i-dubbing.com