Warning: Cannot modify header information - headers already sent by (output started at /home/www/dynamic/pluto.ro/traduceri.pluto.ro/public_html/index.php:2) in /home/www/dynamic/pluto.ro/traduceri.pluto.ro/public_html/wordpress/wp-includes/feed-rss2.php on line 8 Deepl – Traduceri http://traduceri.pluto.ro Translations - Übersetzungen Sat, 23 Mar 2024 06:08:09 +0000 en-US hourly 1 https://wordpress.org/?v=5.1.18 Simple Deepl Free API Python example http://traduceri.pluto.ro/2021/10/simple-deepl-free-api-python-example/ Sun, 17 Oct 2021 05:07:42 +0000 http://traduceri.pluto.ro/?p=658 import requests, sys

# Usage: python DeeplFreeAPI.py RO “Was ist das?”

# Response: {“translations”:[{“detected_source_language”:”DE”,”text”:”Ce este?”}]}

auth_key = ‘your_API_key_here’
target_lang = sys.argv[1]
text = sys.argv[2]
data = {
‘auth_key’: auth_key,
‘text’: text,
‘target_lang’: target_lang}

response = requests.post(‘https://api-free.deepl.com/v2/translate’, data=data)

print(response.json()[“translations”][0][“text”])

]]>