Jump to content


New to API Manipulation - HALP!

new API WoT Help

  • Please log in to reply
6 replies to this topic

iAmEbola #1 Posted 14 November 2018 - 01:46 PM

    Private

  • Player
  • 186 battles
  • 4
  • Member since:
    07-22-2016

As the title says, I am new to API access and manipulation.  I honestly have no idea on how to get started or where to go to learn.  The "Getting Started" guide is not written for someone that has zero clue as what they are doing.  So I need someone with the patience to give me a step by step procedure on how to get started.

 

Do I need a server domain if I am planning to pull data and then apply formulas for different aspects like the WN8 team does over at WotLabs.net?

 

I literally have no idea on how to get started, but it is something I want to learn.  I am familiar with several different computer languages, but it has been years since I've used any of them.  Any help would be wonderful.

 

Thank you.



Geno1isme #2 Posted 14 November 2018 - 02:06 PM

    General

  • Player
  • 44028 battles
  • 8,483
  • [TRYIT] TRYIT
  • Member since:
    09-03-2013

To start: What is your goal?

 

First thing you need is to register an API key (a license basically) in the WG dev room, for starters of the "mobile" variant (so you're not bound to a specific IP)

The API itself is using HTTP and JSON, so you should be somewhat familiar how to make HTTP requests in whatever programming language you want to use and how to process JSON data (many languages have specific modules or third-party libraries for that). If you want to use python for example there is even a package specifically for the WG API: https://github.com/s...ython-wargaming (don't know how complete or up-to-date it is)

Possibly similar modules exist for other languages.

 

Then it's mostly a matter to identify what data you actually want/need from the API. In the WG dev room you have the API explorer to experiment with the different endpoints and parameters.

 

You don't need a server or domain to analyze data, you can do that on your local system. Of course if you want to publish your results or want to make your service available to the public that's different, but no need to worry about that now.


Edited by Geno1isme, 14 November 2018 - 02:11 PM.


iAmEbola #3 Posted 14 November 2018 - 02:22 PM

    Private

  • Player
  • 186 battles
  • 4
  • Member since:
    07-22-2016

Thank you Geno1isme,

 

My goal is to do some analyzing of data across the player base to establish some guidelines on some theories I have.  I have done some hand typing in of data into spreadsheets to run some initial ideas, however I am needing to be able to check against a plethora of data to verify some things.  I can't go into much more detail than that currently.  

 

Ok, so the first sentence after your question makes sense.  I can do that.  

 

I am not familiar with making HTTP Requests to servers for data like this.  Most of the web-design I have done was pretty basic. I started getting into PhP, but life kinda got in the way and I haven't done much with it.   I have programmed in AuoLISP for AutoCAD; VBA, manipulating Microsoft Access; and things like that.  I have been able to modify java and pearl scripts on occasion without breaking anything.  I have heard of python, but never played with it.

 

Going to do step 1 and then review what JSON is.  Told ya, I'm completely new at this.  :child:



Geno1isme #4 Posted 14 November 2018 - 03:37 PM

    General

  • Player
  • 44028 battles
  • 8,483
  • [TRYIT] TRYIT
  • Member since:
    09-03-2013

Those languages are mostly pretty specialized stuff. Haven't touched VBA in ages (like 15-25 years), but I'd assume it has some support for HTTP and JSON.

 

Though I'd strongly recommend to learn a general (not bound to a special environment/application) programming language when dipping into this, preferrably something modern like Python, Go or Rust, but of course you can also stick with PHP, Java or Perl.

 

JSON = JavaScript Object Notation, it's just a simple but very flexible text format to store/transmit data that has become pretty much the standard for web applications / APIs in the last few years.
 



iAmEbola #5 Posted 14 November 2018 - 03:50 PM

    Private

  • Player
  • 186 battles
  • 4
  • Member since:
    07-22-2016

I'm not averse to learning Python and/or JSON.  I just don't know how to get started.

 

I was able to register my application.  I played with the web interface and pulled a few bits of data, but there is some things that I simply don't understand and the documentation is really no help.  

 

For example, I wanted to pull the top 1000 players by average xp earned.  

 

So xp_avg was put in the rank field, but I have no idea what to put in the "type".  It said to check the Types of rating method; so I clicked that link...and I don't get it.  I don't see any explanation of what they will accept for "type".  So I'm lost.


Edited by iAmEbola, 14 November 2018 - 03:50 PM.


Geno1isme #6 Posted 14 November 2018 - 04:20 PM

    General

  • Player
  • 44028 battles
  • 8,483
  • [TRYIT] TRYIT
  • Member since:
    09-03-2013

Well, never used the "Ratings" category of the API myself. Looking at it, you're supposed to call the "ratings/types" endpoint to obtain a list of available date-ranges. But it only returns RATINGS_NOT_FOUND, so it's probably broken.

 

Thinking about it, it was probably coupled to the old Hall of fame site which was disbanded somewhere last year. And when WG stops using an API it often becomes stale or breaks completely. Probably also why the whole category is marked as "Deprecated" aka "DO NOT USE".

 

EDIT: One legal value for type is "all", but even with that "ratings/top" also just returns RATINGS_NOT_FOUND. So you probably can't do what you want without actually pulling all player profiles yourself (which of course takes forever).


Edited by Geno1isme, 14 November 2018 - 04:26 PM.


iAmEbola #7 Posted 14 November 2018 - 04:25 PM

    Private

  • Player
  • 186 battles
  • 4
  • Member since:
    07-22-2016

Ah...I wasn't aware of what Depreciated meant in this context.  

 

So, the ONLY section I want to pull data from to do what I need to do is marked "DO NOT USE".  

 

Of course it is.  :facepalm:

 

Guess I won't be learning anything after all.  







Also tagged with new, API, WoT, Help

1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users