Diacritize Arabic Text
curl --request POST \
--url https://api.munsit.com/api/v1/tashkil/diacritize \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"text": "ذهب الطالب الى المدرسة"
}
'import requests
url = "https://api.munsit.com/api/v1/tashkil/diacritize"
payload = { "text": "ذهب الطالب الى المدرسة" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'ذهب الطالب الى المدرسة'})
};
fetch('https://api.munsit.com/api/v1/tashkil/diacritize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.munsit.com/api/v1/tashkil/diacritize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'ذهب الطالب الى المدرسة'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.munsit.com/api/v1/tashkil/diacritize"
payload := strings.NewReader("{\n \"text\": \"ذهب الطالب الى المدرسة\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.munsit.com/api/v1/tashkil/diacritize")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"ذهب الطالب الى المدرسة\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.munsit.com/api/v1/tashkil/diacritize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"ذهب الطالب الى المدرسة\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"data": {
"original_text": "ذهب الطالب الى المدرسة",
"diacritized_text": "ذَهَبَ الطَّالِبُ إِلَى المَدْرَسَةِ"
},
"message": "Success"
}Tashkil
Tashkil
Add Arabic diacritics (tashkil) to text. The model performs best on Fusha and formal Arabic content.
POST
/
tashkil
/
diacritize
Diacritize Arabic Text
curl --request POST \
--url https://api.munsit.com/api/v1/tashkil/diacritize \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"text": "ذهب الطالب الى المدرسة"
}
'import requests
url = "https://api.munsit.com/api/v1/tashkil/diacritize"
payload = { "text": "ذهب الطالب الى المدرسة" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'ذهب الطالب الى المدرسة'})
};
fetch('https://api.munsit.com/api/v1/tashkil/diacritize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.munsit.com/api/v1/tashkil/diacritize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'ذهب الطالب الى المدرسة'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.munsit.com/api/v1/tashkil/diacritize"
payload := strings.NewReader("{\n \"text\": \"ذهب الطالب الى المدرسة\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.munsit.com/api/v1/tashkil/diacritize")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"ذهب الطالب الى المدرسة\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.munsit.com/api/v1/tashkil/diacritize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"ذهب الطالب الى المدرسة\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"data": {
"original_text": "ذهب الطالب الى المدرسة",
"diacritized_text": "ذَهَبَ الطَّالِبُ إِلَى المَدْرَسَةِ"
},
"message": "Success"
}Endpoint
POST /tashkil/diacritize
Authentication
Requires API key authentication with thex-api-key header.
x-api-key: YOUR_MUNSIT_API_KEY
Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Arabic text to diacritize |
Response
| Field | Type | Description |
|---|---|---|
statusCode | number | HTTP-style status code |
data.original_text | string | Original input text |
data.diacritized_text | string | Text with Arabic diacritics |
message | string | Request status message |
Example
curl 'https://api.munsit.com/api/v1/tashkil/diacritize' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_MUNSIT_API_KEY' \
-d '{
"text": "ذهب الطالب الى المدرسة"
}'
{
"statusCode": 200,
"data": {
"original_text": "ذهب الطالب الى المدرسة",
"diacritized_text": "ذَهَبَ الطَّالِبُ إِلَى المَدْرَسَةِ"
},
"message": "Success"
}
Notes
- The model performs best on Fusha and formal Arabic text.
- Dialectal, noisy, or highly informal text may need additional review.
Error responses
| HTTP status | errorCode | Scenario |
|---|---|---|
400 | 40001 | Missing or invalid text field |
401 | 40101 | Missing, invalid, expired, or revoked API key |
413 | 41301 | Request body exceeds the maximum size limit |
500 | 50001 | Internal error or upstream Tashkil service failure |
Missing API key
{
"errorCode": 40101,
"errorMessage": "API key required"
}
Invalid API key
{
"errorCode": 40101,
"errorMessage": "Invalid API key"
}
Validation error
{
"errorCode": 40001,
"errorMessage": "text: Expected string"
}
Authorizations
API key for authentication
Body
application/json
Arabic text to diacritize. Fusha and formal Arabic text are recommended for best results.
Minimum string length:
1⌘I
