> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reverieinc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transliteration API

> The Transliteration API enables you to convert text content from one language script to another. Below are examples demonstrating how to transliterate single and multiple sentences.

```bash cURL theme={null}
curl --location --request POST 'https://revapi.reverieinc.com' \
--header 'Content-Type: application/json' \
--header 'REV-API-KEY: <YOUR API KEY>' \
--header 'REV-APP-ID: <YOUR APP-ID>' \
--header 'src_lang: en' \
--header 'tgt_lang: hi' \
--header 'domain: 1' \
--header 'REV-APPNAME: transliteration' \
--data-raw '{
"data": ["Hello, how are you?"],
"isBulk": true,
"ignoreTaggedEntities": true
}'
```

```python Python theme={null}
from reverie_sdk import ReverieClient

client = ReverieClient(
   api_key="MY_API_KEY",
   app_id="MY_APP_ID",
)

res = client.t13n.transliteration(
   data=[
       "Reverie Language Technologies is located in Bengaluru ",
       "The address is Jio Avana, Bellandur, Bengaluru -560102",
       "The website address is www.reverieinc.com.",
   ],
   src_lang="en",
   cnt_lang="en",
   tgt_lang="hi",
   noOfSuggestions=2,
)

print(res)

```

```javascript JavaScript theme={null}
const ReverieClient = require("@reverieit/reverie-client");

const reverieClient = new ReverieClient({
 apiKey: "YOUR-API-KEY",
 appId: "YOUR-APP-ID",
});

async function transliterateText() {
 const translation = await reverieClient.transliterate({
   text: "Namaste",
   src_lang: "en",
   tgt_lang: "ta",
 });
 console.log(translation);
}

transliterateText();

```

```go Go theme={null}
package main

import (
   "bytes"
   "encoding/json"
   "fmt"
   "io/ioutil"
   "log"
   "net/http"
)

const (
   apiURL     = "https://revapi.reverieinc.com/"
   apiKey     = "<YOUR API KEY>"
   appID      = "<YOUR APP ID>"
)

type RequestBody struct {
   Data                 []string `json:"data"`
   IsBulk               bool     `json:"isBulk"`
   IgnoreTaggedEntities bool     `json:"ignoreTaggedEntities"`
}

type APIResponse struct {
   ResponseList []struct {
   	APIStatus int      `json:"apiStatus"`
   	InString  string   `json:"inString"`
   	OutString []string `json:"outString"`
   } `json:"responseList"`
}
func main() {
   text := "Reverie Language Technologies ltd website address is www.reverieinc.com"
   requestBody := map[string]interface{}{
   	"data":                 []string{text},
   	"isBulk":               false,
   	"ignoreTaggedEntities": false,
   }

   jsonData, err := json.Marshal(requestBody)
   if err != nil {
   	log.Fatalf("Error marshaling JSON: %v", err)
   }

   req, err := http.NewRequest("POST", apiURL, bytes.NewBuffer(jsonData))
   if err != nil {
   	log.Fatalf("Error creating request: %v", err)
   }

   req.Header.Set("Content-Type", "application/json")
   req.Header.Set("REV-API-KEY", apiKey)
   req.Header.Set("REV-APP-ID", appID)
   req.Header.Set("src_lang", "en")
   req.Header.Set("tgt_lang", "hi")
   req.Header.Set("domain", "1")
   req.Header.Set("cnt_lang", "en")
   req.Header.Set("REV-APPNAME", "transliteration")

   client := &http.Client{}
   resp, err := client.Do(req)
   if err != nil {
   	log.Fatalf("Error making request: %v", err)
   }
   defer resp.Body.Close()

   body, err := ioutil.ReadAll(resp.Body)
   if err != nil {
   	log.Fatalf("Error reading response body: %v", err)
   }

   var apiResponse APIResponse
   err = json.Unmarshal(body, &apiResponse)
   if err != nil {
   	log.Fatalf("Error unmarshaling response: %v", err)
   }

   if len(apiResponse.ResponseList) > 0 && len(apiResponse.ResponseList[0].OutString) > 0 {
   	fmt.Println("Transliterated text:", apiResponse.ResponseList[0].OutString[0])
   } else {
   	fmt.Println("No response from API")
   }
}
```

### Headers

**Content-Type** `string` *required* (default: application/json)

The format of the data to be posted. Must be set to "application/json".

**REV-API-KEY** `string` *required*

&#x20;

A unique key/token provided by Reverie to identify the user using the Localization
API.&#x20;

**REV-APP-ID** `string` *required*

&#x20;

The unique account ID to identify the user and the default account settings.

&#x20;

**REV-APPNAME** `string` *required* (default: transliteration)

Application name i.e., transliteration

**src\_lang** `string` *required*

Source language code : hi, as, bn, gu, kn, ml, mr, or, pa, ta, te, en, ur, sd, doi, kon, brx, ks, mai, mni, sa, sat

**tgt\_lang** `string` *required*

Target language code : hi, as, bn, gu, kn, ml, mr, or, pa, ta, te, en, ur, sd, doi, kon, brx, ks, mai, mni, sa, sat

**domain** `string` *required*

&#x20;

Domain category : generic, pii\_names, pii\_addresses, OnlyEnglish, bfsi, ecommerce, food, infotainment

**cnt\_lang** `string`

Content language code : en

### Body

**data** `string[]` *required*

The text you want to translate. This is the input text that will be processed by the translation model.

**isBulk** `boolean`

&#x20;

Indicates whether the request is for bulk processing. Set to `false` for single
sentence transliteration.&#x20;

**ignoreTaggedEntities** `boolean`

&#x20;

Determines whether to ignore tagged entities during transliteration. Set to `false`
to include all entities.&#x20;

```bash 200 theme={null}
{
	"responseList": [
    	{
        	"inString": "Reverie Language Technologies ltd website address is www.reverieinc.com ",
        	"outString": [
            	"रेवरी लैंग्वेज टेक्नोलॉजीस लिमिटेड वेबसाइट एड्रेस इज़ www.reverieinc.com"
        	],
        	"status": 2
    	}
   ]
}
```

```bash 400 theme={null}
{
	"message" : "Message depending on the missing parameter"
}
```

```bash 403 theme={null}
{
  "message" : "Invalid REV-API-KEY or REV-APP-ID"
}
```

```bash 403 theme={null}
 {
 	"message" : "usage exhausted"
 }
```

```bash 403 theme={null}
{
	"message" : "API key expired"
}
```

```bash 403 theme={null}
{
	"message" : "unauthorized to use this src/tgt language"
}
```

```bash 403 theme={null}
{
	"message" : "unauthorized to use this API"
}
```

```bash 500 theme={null}
{
  "message" : "Internal Server Error"
}
```

### Response

**responseList** `Object` *required*

An array of translation responses

**ResponseList**

**inString** `string`

The input text in the source language script.

Example: `Reverie Language Technologies ltd website address is www.reverieinc.com`

**outString** `string[]`

The result of converting the input text to the output script.

Example: `["रेवरी लैंग्वेज टेक्नोलॉजीस लिमिटेड वेबसाइट एड्रेस इज़ www.reverieinc.com"]`

**status** `integer`

Status of API – successful/fail. By default, 2 for successful transactions.

Example: `2`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.