Translate any normal English sentence to Morse Code. Use it in your App or workflow.
The endpoint for connecting: If you subscribe directly from us, use this endpoint.
https://api.funtranslations.com/translate/
| Parameter Name | Parameter Type | Description |
|---|---|---|
| text | string | Text to Translate |
To maintain our service level, we rate limit the number of API calls. For paid plans, this limit is increased according to the service level described in the plan.
We support API Key based authentication. Set your Authorization: Bearer request header with your API key value.
Using cURL:
curl -X POST "https://api.funtranslations.com/translate/morse-code" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello, how are you?"}'
Using PHP:
$authorization = "Authorization: Bearer YOUR_API_KEY";
$ch = curl_init('https://api.funtranslations.com/translate/morse-code');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', $authorization]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['text' => 'Hello, how are you?']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode($result, true);
Using JavaScript:
fetch('https://api.funtranslations.com/translate/morse-code', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ text: 'Hello, how are you?' })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Using Python:
import requests
url = "https://api.funtranslations.com/translate/morse-code"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {"text": "Hello, how are you?"}
response = requests.post(url, json=data, headers=headers)
print(response.json())
The above calls should return a response similar to this.
{
"success": {
"total": 1
},
"contents": {
"translated": "< translated text >",
"text": "Morse code is a dit and dah",
"translation": "morse-code"
}
}
| Parameter Name | Parameter Type | Description |
|---|---|---|
| text | string | Text to Translate |
The above calls should return a response similar to this.
{
"success": {
"total": 1
},
"contents": {
"translated": "morse code is a dit and dah",
"text": "-- --- .-. ... . -.-. --- -.. . .. ... .- -.. .. - .- -. -.. -.. .- .... ",
"translation": "morse2english"
}
}
| Parameter Name | Parameter Type | Description |
|---|---|---|
| text | string | Text to Translate |
| speed(optional) | number | Audio Speed |
| tone(optional) | number | Audio Tone |
The above calls should return a response similar to this.
{
"success": {
"total": 1
},
"contents": {
"translated": {
"audio": "data:audio/wave;base64,UklGRjiBCQBXQVZFZm1...
},
"text": "Morse code is dit and dash",
}
}
Authorization: Bearer YOUR_API_KEY
Sign up now and start integrating Morse Code Translator into your applications.