/translate-api

A translation web scraper REST API

Primary LanguageTypeScriptMIT LicenseMIT

translate-api

GitHub top language Repository size GitHub last commit GitHub Codacy Badge

๐ŸŽฏ About

A simple yet very useful S.O.L.I.D. principles-based web scraper API using DeepL Translate and extending its capacities.

๐ŸŒ Supported Languages
  • ๐Ÿ‡ง๐Ÿ‡ฌ Bulgarian
  • ๐Ÿ‡จ๐Ÿ‡ณ Chinese
  • ๐Ÿ‡จ๐Ÿ‡ฟ Czech
  • ๐Ÿ‡ฉ๐Ÿ‡ฐ Danish
  • ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch
  • ๐Ÿ‡บ๐Ÿ‡ธ English
  • ๐Ÿ‡ช๐Ÿ‡ช Estonian
  • ๐Ÿ‡ซ๐Ÿ‡ฎ Finnish
  • ๐Ÿ‡ซ๐Ÿ‡ท French
  • ๐Ÿ‡ฉ๐Ÿ‡ช German
  • ๐Ÿ‡ฌ๐Ÿ‡ท Greek
  • ๐Ÿ‡ญ๐Ÿ‡บ Hungarian
  • ๐Ÿ‡ฎ๐Ÿ‡น Italian
  • ๐Ÿ‡ฏ๐Ÿ‡ต Japanese
  • ๐Ÿ‡ฑ๐Ÿ‡ป Latvian
  • ๐Ÿ‡ฑ๐Ÿ‡น Lithuanian
  • ๐Ÿ‡ต๐Ÿ‡ฑ Polish
  • ๐Ÿ‡ต๐Ÿ‡น Portuguese
  • ๐Ÿ‡ท๐Ÿ‡ด Romanian
  • ๐Ÿ‡ท๐Ÿ‡บ Russian
  • ๐Ÿ‡ธ๐Ÿ‡ฎ Slovenian
  • ๐Ÿ‡ธ๐Ÿ‡ฐ Slovak
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish
  • ๐Ÿ‡ธ๐Ÿ‡ช Swedish

๐Ÿ™‹ Usage

๐Ÿ“œ Check languages.ts for the ISO 639-1 standard language codes.

Request Example

Curl/Bash

curl -X POST http://translate.api.jpfb.me
  -H 'Content-Type: application/json'
  -d '{ "language": { "source": "pt", "target": "en" }, "texts": { "phrase": "Olรก mundo!" } }'

JavaScript/Axios

const axios = require("axios");

axios
  .post("http://translate.api.jpfb.me", {
    language: {
      source: "pt",
      target: "en",
    },
    texts: {
      phrase: "Olรก mundo!",
    },
  })
  .then((response) => {
    console.log(response.data);
  })
  .catch((err) => {
    console.log(err);
  });

Response Example

{
  "translation": {
    "language": "en",
    "texts": {
      "phrase": "Hello world!"
    }
  }
}

๐Ÿš€ Technologies

โœ๏ธ Author

A project made by Joรฃo Pedro Ferreira Barbosa.

๐ŸŒŽ License

This project in under MIT license. Check LICENSE for more information.