Translate
curl --request POST \
--url https://api.agntdata.dev/v1/data/x/translate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"dest": "en",
"text": "Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé)."
}
'import requests
url = "https://api.agntdata.dev/v1/data/x/translate"
payload = {
"dest": "en",
"text": "Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé)."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dest: 'en',
text: 'Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).'
})
};
fetch('https://api.agntdata.dev/v1/data/x/translate', 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.agntdata.dev/v1/data/x/translate",
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([
'dest' => 'en',
'text' => 'Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.agntdata.dev/v1/data/x/translate"
payload := strings.NewReader("{\n \"dest\": \"en\",\n \"text\": \"Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.agntdata.dev/v1/data/x/translate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dest\": \"en\",\n \"text\": \"Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agntdata.dev/v1/data/x/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dest\": \"en\",\n \"text\": \"Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).\"\n}"
response = http.request(request)
puts response.read_body{
"destination_language": "en",
"original_language": "fr",
"original_text": "Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).",
"translated_text": "I tell you that the round table of the #PPF @ParisPeaceForum “Navigating the #AI revolution” where there was notably @ylecun (Meta) @BradSmi (Microsoft) and @ianbremmer is certainly worth listening to on replay.(Yes, it clashed a bit)."
}Translation
Translate
Return Translated Text and the source language if it wasn’t specified
POST
/
v1
/
data
/
x
/
translate
Translate
curl --request POST \
--url https://api.agntdata.dev/v1/data/x/translate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"dest": "en",
"text": "Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé)."
}
'import requests
url = "https://api.agntdata.dev/v1/data/x/translate"
payload = {
"dest": "en",
"text": "Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé)."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dest: 'en',
text: 'Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).'
})
};
fetch('https://api.agntdata.dev/v1/data/x/translate', 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.agntdata.dev/v1/data/x/translate",
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([
'dest' => 'en',
'text' => 'Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.agntdata.dev/v1/data/x/translate"
payload := strings.NewReader("{\n \"dest\": \"en\",\n \"text\": \"Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.agntdata.dev/v1/data/x/translate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dest\": \"en\",\n \"text\": \"Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agntdata.dev/v1/data/x/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dest\": \"en\",\n \"text\": \"Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).\"\n}"
response = http.request(request)
puts response.read_body{
"destination_language": "en",
"original_language": "fr",
"original_text": "Moi je vous dis que la table ronde du #PPF @ParisPeaceForum “Navigating the #AI revolution” où il y avait notamment @ylecun (Meta) @BradSmi (Microsoft) et @ianbremmer est assurément à réécouter en replay. (Oui, cela a un peu clashé).",
"translated_text": "I tell you that the round table of the #PPF @ParisPeaceForum “Navigating the #AI revolution” where there was notably @ylecun (Meta) @BradSmi (Microsoft) and @ianbremmer is certainly worth listening to on replay.(Yes, it clashed a bit)."
}⌘I