Base URL
https://edge.harktranslate.com/api/v1/translator
Send x-hark-key on every request. Keys come from the RapidAPI listing. Volume past MEGA uses the contact form. Every status and machine code is on the error catalog.
First call
- Put your key in the header, or export HARK_API_KEY for the JavaScript and Python samples.
- POST /text with from, to, and text.
- Read trans from the JSON body. Success is HTTP 200.
Plain text
curl -X POST "https://edge.harktranslate.com/api/v1/translator/text" \
-H "x-hark-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"from": "en",
"to": "vi",
"text": "Hello"
}
JSONconst response = await fetch("https://edge.harktranslate.com/api/v1/translator/text", {
method: "POST",
headers: {
"x-hark-key": process.env.HARK_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"from": "en",
"to": "vi",
"text": "Hello"
}),
});
if (!response.ok) {
throw new Error(`Hark responded ${response.status}`);
}
console.log(await response.json());import os
import requests
response = requests.post(
"https://edge.harktranslate.com/api/v1/translator/text",
headers={"x-hark-key": os.environ["HARK_API_KEY"]},
json={
"from": "en",
"to": "vi",
"text": "Hello",
},
timeout=30,
)
response.raise_for_status()
print(response.json())