Has pagination gone away for Groups endpoint?

Hi,

I’m in the middle of revamping our API code and I noticed that the ‘page’ parameter is no longer in the Groups endpoint. Am looking at it wrong? https://docs.discourse.org/#tag/Groups

Regards,

Mark Pemburn
Blue Ocean Ideas

It’s still there. It probably just isn’t documented yet.

https://meta.discourse.org/groups.json?page=1
1 Like

Thanks! Is there a way to know how many per page? Or what is returned when you’ve reached the last page?

See here:

https://meta.discourse.org/groups.json?page=2

Looks like it will return an empty array if there are no more results.

{"groups":[],"extras":{"type_filters":["my","owner","public","close","automatic"]},"total_rows_groups":60,"load_more_groups":"/groups?page=3"}
2 Likes

Thanks!

I found this post from a while ago that suggests that there are parameters for limit and offset. I tried them, and they do nothing.

https://meta.discourse.org/t/groups-api-now-requires-pagination-in-latest-release/120982

Mark
P.S. We’re on version 2.6.0.beta1 which I gather is the latest.

Looks like there are no limit or offset parameters on the groups endpoint. The default page size is 36 though.

Just curious how many groups do you have?

2 Likes

The Discourse Ruby API Gem does not accept a “page:” parameter, so there’s no way to retrieve more than the first 36 records. From github:

  def groups
    response = get("/groups.json")
    response.body
  end

The repository does not appear to allow me to create new issues, so I’m not sure how we go about getting this fixed?

1 Like