Jump to content


Player list for Account's season Data in API


  • Please log in to reply
5 replies to this topic

Born_in_Dakota13 #1 Posted 25 April 2020 - 10:55 PM

    Private

  • Player
  • 18817 battles
  • 5
  • [BEYOU] BEYOU
  • Member since:
    04-17-2012

Hey,
I'm using Pythons "requests" to pull some data e.g battles in current season for each clan member and I'm getting timeout errors.
I think the problem is, that every player needs his own request which sums up to 100 requests per clan (kinda inefficient).

 

Would it be possible to implement the account_id list "feature" into this method like in others where you can put in a list of account IDs separated by commas or do you know a Workaround?

 

Realm: EU

Method: https://developers.w...nfo/?r_realm=eu << "Account's season data"

Info I need: seasons.battles for up to 100 players
Problem: Timeout error after around 10 requests, sometimes it doesn't even get a single one.
Error:
('Connection aborted.', TimeoutError(10060, 'Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat', None, 10060, None))

Translated: ('Connection aborted.', TimeoutError(10060, 'Connection aborted, the server did not respond in a given timespan, or the connection was interrupted, because the connected Host did not respond', None, 10060, None))

 

I'm also pretty sure that my own connection is fine and I know that its worked a few weeks ago perfectly fine. Could also be a problem from pythons side tho...

Thanks in advance!
 


Edited by Born_in_Dakota13, 25 April 2020 - 11:03 PM.


Born_in_Dakota13 #2 Posted 26 April 2020 - 01:27 AM

    Private

  • Player
  • 18817 battles
  • 5
  • [BEYOU] BEYOU
  • Member since:
    04-17-2012
Kinda fixed the issue a few hours ago by implementing a retry session routine... Not very elegant but does its job.

tbence99 #3 Posted 29 May 2020 - 02:07 PM

    Private

  • Player
  • 26560 battles
  • 10
  • [GUST] GUST
  • Member since:
    05-18-2013
Hello, can i ask which language do you use?

trispect #4 Posted 29 May 2020 - 02:36 PM

    Lieutenant

  • Beta Tester
  • 36581 battles
  • 1,982
  • [F2PAY] F2PAY
  • Member since:
    01-16-2011

View Posttbence99, on 29 May 2020 - 03:07 PM, said:

Hello, can i ask which language do you use?

It's said there: Python



Just0rz #5 Posted 29 May 2020 - 03:39 PM

    Private

  • Player
  • 7053 battles
  • 29
  • Member since:
    02-21-2013

WG implemented API Protection and there's a limited number of calls you can make to the API within a time frame for example 200 calls per minute if you exceed this you will automatically have the connection reset.

 

More about this here:

https://developers.wargaming.net/documentation/guide/principles/

 

Block Quote

 

LIMITATIONS

To provide the stable service functioning, the number of requests sent to API is limited.

  • Server applications. Request limit per second is set to 20 requests per second.
  • Standalone applications. The limit is set on the number of requests sent from one IP address at the same time and in general equal to 10 requests per second.

 

Sleep for 150ms between calls and you should be ok.


Edited by Just0rz, 29 May 2020 - 03:40 PM.


Born_in_Dakota13 #6 Posted 30 May 2020 - 01:45 PM

    Private

  • Player
  • 18817 battles
  • 5
  • [BEYOU] BEYOU
  • Member since:
    04-17-2012
Ty for the link :) Thought the connection would just "slow down" but this explains a lot!




1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users