2

so for example I am trying to use unirest for this so i put

base = 'translate.yandex.net'
post = '/api/v1.5/tr./getLangs?ui=en&key=' + api_key
request = unirest.get(base+post, headers={'accept' : "json"})

and the code says something about not a valid url this is directly from the docs.

What I am asking for is a working example on how to get this api to work with the unirest module. If not possible how would I use with another package.

This may be a stupid question but maybe I just don't comprehend the docs from Yandex.

update a link to the docs is here. https://tech.yandex.com/translate/doc/dg/reference/translate-docpage/

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
killer
  • 372
  • 1
  • 5
  • 15

1 Answers1

2

Try adding http:// or https:// in the base url:

base = 'http://translate.yandex.net'
post = '/api/v1.5/tr.json/getLangs?ui=en&key=' + api_key
request = unirest.get(base+post, headers={'accept' : "json"})

and it should be fine.

This is based on yandex documentation.

Gregzor
  • 302
  • 1
  • 3
  • 8