HTTP JSONDecode returning nil

Hey devs,
I am currently making an automatic translation system for my game using the DeepL API and HTTPservice, but decoding the response gives me everything as nil

the code :

local http = game:GetService("HttpService")


local response = http:GetAsync("https://api-free.deepl.com/v2/translate?auth_key=XXXXXXXXXXXXXXXXXX&text=hello&target_lang=nl")
local data = http:JSONDecode(response)
wait(2)
print(data.translations.text)
print(response)

The 7th line gives me this :
image

and that is the actual response (printed on line 8) :
image

As you may have guessed, I am trying to get the text value from this JSON table, but the decoded value only gives me nil… Any help appreciated !

1 Like

Hello @fabrice1236 ,Try This:

data.translations[1].text

Since, It’s return another table inside the table translations
image

2 Likes

thank you ! It fixed the issue !