Can I get all games from user?

I am trying to use a GET request to get all the games by user id so I can filter them but then I get a cap at 10 games or 100 when I specify say 10,000.

Short term I would like to get every games played in x month.

Long term I would like to get every game with x filter.

1 Like

https://online-go.com/api/v1/players/568679/games/?ordering=ended&ended__gte=2022-02-01%2000:00

Here’s all my games since feb 1, does that help?

you can use ended_gte and ended__lte to specify a date range. And page_size to change how many results you get back at one time. There may be a limit on page size idk.

EDIT: Oh I see perhaps you are already editing page size. Yes you will hit a limit because otherwise you will swamp OGS servers. May I ask what is the relevant information you would like to gather? If you just need the count, that is easy. If you need to actually extract some info from each game, consider pulling one page at a time and aggregating the result incrementally.

2 Likes

Was thinking about displaying the number of games in the WSC challenge for each user but I have to check some filters like ranked and such.

I would love to show a win/loss ratio as well if possible.

&ranked=true

for most fields you can add an filter to the url

2 Likes

Off topic, but do you really expect anyone to play 10,000 games? :open_mouth:

2 Likes

I invite you to fox go.

image

That said I saw people with crazy amount of games on OGS too. I think I saw 3k once.

I have 28k games I think, stinkygobasket 100k+.
I was referring to “10k games in a month” since he said he wanted to use it for the WSC. But maybe I misunderstood

2 Likes

Oh I see. I misunderstood then.

What is each column?

1 Like

Name flag rank wins losses

1 Like

Thanks

It was a stress test idea for future ideas in addition to this one.

1 Like

Can you make an AND statement in the url? Like get user’s ranked games AND rengo games?

Why not make two separate GET requests?

1 Like

I am not a programmer, but what I understood, which could be wrong, is that GET (as the name implies) is a way to get data, about games in this case. In the second message benjito gave some information on how to do this. AND seems pretty obvious, Clossius was asking if he can filter two categories.
If you want to know more, wait for someone else to answer :sweat_smile:

2 Likes

Am I doing this Get request wrong?

https://online-go.com/api/v1/players/126739/games/?ordering=ended&ended__gte=2022-02-01%2000:00&ranked=true&width=19&height=19

When I search my profile I get the right number of games. But for this one it is way off compared to the user profile in the same range.

Also, is there a way to get games between date x and date y instead of all games since date x?

1 Like

I think the problem is that annulled games aren’t excluded.

With this user (_zaki_) it’s more evident

1 Like

ahh, that lowered the number quite a bit. But still not quite perfect to the graph on the profile page :confused: Is there another result that is possible that I should ignore?

As @benjito said, you can use endend__lt(e) (less than equal) and ended__gte to get games between date x and y and you can also exclude annulled games with annulled=false.
For example: https://online-go.com/api/v1/players/126739/games/?ended__gte=2021-03-01+00%3A00&ended__lt=2021-04-01+00%3A00&height=19&width=19&ordering=ended&ranked=true&annulled=false
All ranked, 19x19, not annulled games ended in march 2021 by used 126739

2 Likes

%3A00

What does this part represent?