Overview

igts2B is a node-type driven iGaming translation platform that provides fast, consistent, and placeholder-safe localization for market, competitor, season, and related betting entities.

Production Base URL: https://igts2b.xyz Rules version field: 0.2.26

  • Use GET /api/languages to load supported target languages.
  • Use POST /api/excel/parse to normalize CSV/XLSX uploads.
  • Use POST /api/process for real-time translation/transliteration.
  • Use /api/jobs* only if async batch mode is required.

Authentication

All /api/* endpoints require auth except /api/health and /api/auth/login.

  • Preferred: X-API-Key: <api_key>
  • Optional: Authorization: Bearer <token>
  • Do not send both headers together (400 ambiguous_auth).

API key scopes

SCOPEPURPOSE
translation.readRead language catalog
translation.parseParse spreadsheet uploads
translation.processRun translation/transliteration
translation.jobsAsync job endpoints

Security

Enforced by platform

  • API key active/revoked/expired validation.
  • Scope-based access control per API key.
  • IP whitelist enforcement (single IP and CIDR supported).
  • Per-client-per-IP rate limiting.
  • Prompt-injection and quality guard filters in translation pipeline.

Recommended for integrators

  • Use dedicated API keys per environment.
  • Rotate keys regularly and store in a secret manager.
  • Use retry with exponential backoff for 429 and 5xx.
  • Track error codes and latency in your observability stack.

Core Workflow

  1. Authenticate using API key. Use X-API-Key for machine-to-machine integration and assign only required scopes.
  2. Read language list from /api/languages. Validate target language values before submitting workload.
  3. Parse files with /api/excel/parse when needed. This normalizes CSV/XLSX into API-ready items[].
  4. Submit normalized records to /api/process. Use sync processing for low-latency, near-real-time flows.
  5. Consume minimal output contract. In production, consume id + result_text, and log rules_version.

Implementation Notes

  • Chunk large requests before sync processing (/api/process max 200 items).
  • Preserve placeholders before and after translation.
  • Retry only on 429 and 5xx.
  • Do not retry 4xx validation errors; fix payload first.
  • Log latency, HTTP status, error code, and rules_version for supportability.

Happy Path Example

  1. GET /api/languages and validate target_lang.
  2. POST /api/excel/parse (if source is spreadsheet).
  3. POST /api/process and consume translated items.
  4. Persist id, result_text, rules_version.

Error Path Example

  1. Request with too many items returns 413 items_limit_exceeded.
  2. Split payload and resubmit in chunks.
  3. If throttled (429), backoff with jitter and retry.

Endpoint Reference

METHODPATHAUTHPURPOSE
GET/api/healthNoHealth probe
POST/api/auth/loginNoBearer login (optional)
GET/api/languagesYesSupported target languages
POST/api/excel/parseYesCSV/XLSX parser to API items
POST/api/processYesReal-time translation/transliteration
POST/api/jobsYesCreate async job (optional)
GET/api/jobsYesList async jobs (optional)
GET/api/jobs/:idYesGet job status/output (optional)

POST /api/process request

JSON body
{
  "mode": "translation",
  "node_type": "bet_type_group",
  "target_lang": "pt-BR",
  "include_meta": false,
  "items": [
    { "id": "1001", "source_text": "First Goal Scorer" }
  ]
}
FIELDREQUIREDDESCRIPTION
modeYestranslation for localized translation, transliteration for script/phonetic conversion.
node_typeYesSelects runtime pipeline (standard vs hybrid behavior).
target_langYesTarget locale code (for example pt-BR).
itemsYesArray of input records (id, source_text).

If you omit mode, the API returns 400 (for example: mode must be translation or transliteration).

entity_type is optional (advanced). Most integrations should only send node_type.

Excel Upload via API

Use POST /api/excel/parse to convert CSV/XLSX into normalized items[], then send those items to POST /api/process.

  1. Convert the file to a full Data URL string (data:<mime>;base64,<payload>).
  2. Send file_name, node_type, and file_data to /api/excel/parse.
  3. Use the returned items directly in /api/process.

Auth rule: use exactly one method per request (X-API-Key or Authorization: Bearer ...). Do not send both.

Parse Excel (API key)
FILE="bet_type_group.xlsx"
BASE64=$(base64 -i "$FILE" | tr -d '\n')

curl -sS -X POST https://igts2b.xyz/api/excel/parse \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d "{
    \"file_name\":\"$FILE\",
    \"node_type\":\"bet_type_group\",
    \"file_data\":\"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,$BASE64\"
  }"

`file_data` must include the data:...;base64, prefix. Raw base64 without prefix is invalid.

Node Mapping

node_typebehavior
bet_type_groupstandard translation
categorystandard translation
header_setstandard translation
leaguestandard translation
long_textstandard translation (long-form iGaming copy, natural casing)
mixedper-row auto-routing across standard + hybrid entity pipelines
named_valuestandard translation
outcome_valuestandard translation
period_typestandard translation
sport_typestandard translation
competitorhybrid translation/transliteration
seasonhybrid translation/transliteration

Processing behavior is inferred from node_type. mode is required and selects translation vs transliteration.

Node Selection Cheat Sheet

To ensure the highest translation quality, integrators must send the correct node_type based on the nature of the content being translated.

The system does not guess entity intent. It relies on the provided node_type to select the appropriate processing pipeline.

Sending all content under a single node (for example always bet_type_group) may lead to reduced terminology accuracy.

How to Select the Correct Node

CONTENT TYPEUSE THIS node_typePROCESSING BEHAVIOUR
Market / Bet Category Namesbet_type_groupStandard translation
Player / Team NamescompetitorHybrid (translation + transliteration)
Season NamesseasonHybrid
League / Tournament NamesleagueStandard translation
Long marketing / promotional textlong_textStandard translation (iGaming market terminology + no title-case post-format)
Mixed-content files (UI + competitor + season together)mixedPer-row auto-routing
Generic UI Betting Termsnamed_valueTerminology-aware translation
Outcome Labelsoutcome_valueContext-aware translation

Note: Use node_type league for league and tournament names. Use mixed when one file contains competitor names, season labels, and standard/UI rows together. Processing behavior is selected by node_type; refer to the Node Mapping section for authoritative behavior.

Examples

Market Name
First Goal Scorer
Match Winner
Total Goals Over/Under

{
  "node_type": "bet_type_group"
}

Player / Team Name
Cristiano Ronaldo
Manchester United

{
  "node_type": "competitor"
}

Season
2024/2025
Spring Split

{
  "node_type": "season"
}

League / Tournament Name
Premier League

{
  "node_type": "league"
}
{
  "target_lang": "pt-BR",
  "items": [
    {
      "id": "L1",
      "result_text": "Premier League"
    }
  ]
}

Mixed Content File
FC Buxoro
2024/2025
Account Activity

{
  "node_type": "mixed"
}

Outcome Label
Anytime Scorer
First Half Winner
Yes / No

{
  "node_type": "outcome_value"
}

Important Notes

  • The processing pipeline is selected based on node_type.
  • Hybrid pipelines apply transliteration when needed.
  • Standard pipelines apply terminology normalization.

Incorrect node selection may result in inconsistent translations, glossary misses, and incorrect name handling.

Best Practice

Integrators should map their internal entity types to IGTS node types before sending requests.

INTERNAL FIELDRECOMMENDED node_type
market_namebet_type_group
team_namecompetitor
player_namecompetitor
season_nameseason
league_nameleague
mixed_translation_filemixed
outcome_labeloutcome_value

This ensures optimal translation quality across all supported languages.

Limits & Timeouts

ENDPOINTLIMITVALUE
/api/processMax items200
/api/processMax chars per item400
/api/processMax total source chars40,000
/api/processTimeout55,000 ms
/api/excel/parseMax file_data chars14,000,000
/api/excel/parseMax rows10,000
/api/jobsMax items per job create5,000

HTTP Status Codes

CODEMEANING
200Success
201Created
400Validation/malformed request
401Missing/invalid authentication
403Permission/scope/IP denied
404Resource not found
408Processing timeout
413Payload/size limit exceeded
429Rate limit exceeded
500Internal processing error

Common Error Codes

ERRORCAUSE
auth_requiredNo auth provided
ambiguous_authBearer + API key sent together
invalid_sessionBearer token invalid/expired
invalid_api_keyAPI key invalid/revoked/expired
api_scope_deniedMissing required API key scope
ip_not_allowedCaller IP not in whitelist
rate_limit_exceededRate limit threshold reached
items_requireditems missing/empty
invalid_item_source_textsource_text missing for an item
items_limit_exceededSync item count above max
source_text_too_longPer-item text length above max
payload_text_too_largeTotal text payload above max
processing_timeoutSync processing exceeded timeout
missing_file_dataMissing file_data in excel parse request
file_too_largeUploaded file payload too large
row_limit_exceededParsed row count above max

Output Examples

POST /api/process (200, minimal output)

{
  "target_lang": "pt-BR",
  "rules_version": "0.2.26",
  "items": [
    {
      "id": "1001",
      "result_text": "Primeiro Marcador"
    }
  ]
}

POST /api/process (413, validation error)

{
  "ok": false,
  "error": "items_limit_exceeded",
  "message": "items exceeds sync limit (200). Use /api/jobs for larger batches.",
  "details": { "max_items": 200 }
}

POST /api/excel/parse (200, shape)

{
  "ok": true,
  "file_name": "bet_type_group.xlsx",
  "node_type": "bet_type_group",
  "summary": {
    "row_count": 430,
    "skipped_empty_value": 0
  },
  "items": [
    { "id": "1001", "source_text": "First Goal Scorer" }
  ]
}

cURL Samples

Health
curl -sS https://igts2b.xyz/api/health
Languages (API key)
curl -sS https://igts2b.xyz/api/languages \
  -H "X-API-Key: YOUR_API_KEY"
Realtime Translation (API key)
curl -sS -X POST https://igts2b.xyz/api/process \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "mode":"translation",
    "node_type":"bet_type_group",
    "target_lang":"pt-BR",
    "items":[{"id":"1001","source_text":"First Goal Scorer"}]
  }'