Jump to content


Get clan language with API?

api language clans

  • Please log in to reply
4 replies to this topic

JustAMistake #1 Posted 23 July 2020 - 12:46 PM

    Private

  • Player
  • 5044 battles
  • 4
  • [-RLD-] -RLD-
  • Member since:
    11-26-2016

Hello,

 

I'm new to the Wargaming API and so far it's been pretty great. For my discord bot I'd like to be able to get the clan language(s), however I couldn't find anything like this in the documentation.

Right now I do that by scraping for this here: https://eu.wargaming.net/clans/wot/{clan_id}/api/claninfo/  I get a abbreviation here, that I can convert to a more readable version with an outside library that I installed.

 

So my question is: Is there a posibility to get it from the API, instead of scraping it? If it's not in the API, I'd like to request to the developers to add it, as it is definitely useful information.

 

What I am trying to get:

What I am trying to get

 

How I get it now:

Code preview

 

How I use it:

Embedded bot preview

 

Sincerely, JustAMistake


Edited by JustAMistake, 23 July 2020 - 03:21 PM.


lgfrbcsgo #2 Posted 23 July 2020 - 01:39 PM

    Second Lieutenant

  • Player
  • 36403 battles
  • 1,082
  • [OOUUF] OOUUF
  • Member since:
    04-04-2012

The clan language seems to be located at clanview.profiles[1].languages_list within the response of that request. Please be aware that you're using a "private" endpoint which is not part of the developer program afaik.

 

Edit: I've reread you're post. Sorry, I was a bit confused by "scraping" as in parsing HTML. Looking at the attached code, you're already reading it from the "private" API. The public API does not return the clan language and it is unlikely that it will be added anytime soon. The last release of the API was in June 2018. https://developers.wargaming.net/documentation/guide/release-notes/


Edited by lgfrbcsgo, 23 July 2020 - 01:57 PM.


JustAMistake #3 Posted 23 July 2020 - 03:21 PM

    Private

  • Player
  • 5044 battles
  • 4
  • [-RLD-] -RLD-
  • Member since:
    11-26-2016

View Postlgfrbcsgo, on 23 July 2020 - 01:39 PM, said:

The clan language seems to be located at clanview.profiles[1].languages_list within the response of that request. Please be aware that you're using a "private" endpoint which is not part of the developer program afaik.

 

Edit: I've reread you're post. Sorry, I was a bit confused by "scraping" as in parsing HTML. Looking at the attached code, you're already reading it from the "private" API. The public API does not return the clan language and it is unlikely that it will be added anytime soon. The last release of the API was in June 2018. https://developers.wargaming.net/documentation/guide/release-notes/

Ahh feelsbad.. Yeah ig this works but I rather use the public API with my token.


Edited by JustAMistake, 23 July 2020 - 03:21 PM.


LUF3N #4 Posted 23 July 2020 - 11:31 PM

    Lance-corporal

  • Player
  • 16792 battles
  • 57
  • [HXND] HXND
  • Member since:
    11-17-2012

Hi,

 

you "could" get the language of a single player but WG decided to remove this information so its empty for every user.

personal data request -> "client_language": ""

 

The clan information won't give u any more about that too. I think they removed it because of racim in the ingame chat (i think with this methode XVM was able to set the flags as well, not sure).

 

Another idea could be to set a default language for all clans in your bot, for example english.

Than u can check in the clan details the clan description. You could run it throw google translator to check which language  it is. I am sure there are same apis that are able to do that, maybe even directly by google.

If the bot get a result its the language you get and if it can't get any result you just use the default language.

 

Hope i could give u an idea :)



JustAMistake #5 Posted 24 July 2020 - 10:13 AM

    Private

  • Player
  • 5044 battles
  • 4
  • [-RLD-] -RLD-
  • Member since:
    11-26-2016

View PostLUF3N, on 23 July 2020 - 11:31 PM, said:

Hi,

 

you "could" get the language of a single player but WG decided to remove this information so its empty for every user.

personal data request -> "client_language": ""

 

The clan information won't give u any more about that too. I think they removed it because of racim in the ingame chat (i think with this methode XVM was able to set the flags as well, not sure).

 

Another idea could be to set a default language for all clans in your bot, for example english.

Than u can check in the clan details the clan description. You could run it throw google translator to check which language  it is. I am sure there are same apis that are able to do that, maybe even directly by google.

If the bot get a result its the language you get and if it can't get any result you just use the default language.

 

Hope i could give u an idea :)

 

Thanks yeah, the method I use now works fine, I just wanted to know if there was a possibility of getting it through the official API.







Also tagged with api, language, clans

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users