I am trying to pass multiple text variables with the DeepL API using Python 3's requests
library, but as yet have been unable to pass multiple text parameters to a request. The documentation states that "Up to 50 text parameters can be submitted in one request" but after trying to pass multiple text variables using "&text":
and the regular "text":
keys, the call only returns a single translation.
For reference, here is the code I used:
two_s = r.post(url="https://api.deepl.com/v2/translate", data={"target_lang": "EN", "auth_key": auth_key, "text": s2t1, "text":s2t2})
and
two_s = r.post(url="https://api.deepl.com/v2/translate", data={"target_lang": "EN", "auth_key": auth_key, "text": s2t1, "&text":s2t2})
Where auth_key is my authentication key, and s2t1
and s2t2
are different "strings 2 translate." How can multiple "text":
parameters be passed to the DeepL API using Python?