diff --git a/README.md b/README.md index 7d90bde..747ea66 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Free and Open Source Machine Translation API, entirely self-hosted. Unlike other ## API Examples -### Plain Text +### Simple Request: @@ -40,6 +40,32 @@ Response: } ``` +### Auto Detect Language + +Request: + +```javascript +const res = await fetch("https://libretranslate.com/translate", { + method: "POST", + body: JSON.stringify({ + q: "Ciao!", + source: "auto", + target: "en" + }), + headers: { "Content-Type": "application/json" } +}); + +console.log(await res.json()); +``` + +Response: + +```javascript +{ + "translatedText": "Bye!" +} +``` + ### HTML (beta) Request: