2

Using the Meetup API, I'm able to successfully get exactly 200 members from any given group. There are a lot of groups that have more members than that. I want to know how to get them all.

The issue
I haven't been able to find where &page=### is documented. I'm assuming it sets how many results are returned in the response from Meetup.

I have tried using, for example, &page=1000, but I still only get 200 members back.

The request URL
I'm using this URL to request the data:

let meetupReqUrl = "https://api.meetup.com/2/members?&sign=true&group_id=" 
                  + groupId 
                  + "&key=" 
                  + apiKeys.meetup
                  + "&order=joined"
                  + "&page=1000"

This variation also returns exactly 200 members:

let meetupReqUrl = "https://api.meetup.com/2/members?&sign=true&group_id=" 
                  + groupId 
                  + "&order=joined"
                  + "&page=1000" 
                  + "&key=" 
                  + apiKeys.meetup

It may be worth noting that &order=joined is not sorting the results at all. This leads me to believe I am doing something wrong in forming the URL.

Related documentation
Meetup's /2/members API is documented here.

Ash Ryan Arnwine
  • 1,471
  • 1
  • 11
  • 27

3 Answers3

2

It seems the maximum number of results you can get at once through the API is 200 - see https://github.com/jkutianski/meetup-api/wiki#limits.

You can however make multiple requests as per http://www.meetup.com/meetup_api/#making_request. It says you need to use the page and offset parameters. From the meetup.com link:

page -- the page size (maximum number of results in each response) to use on the results

offset -- the starting page for results to return. For example, when page = 10, specifying "offset=0" will bring back records 1-10, "offset=1" will bring records 11-20, etc.

Ben
  • 2,143
  • 2
  • 19
  • 27
  • It is necessary to include both the `page` and `offset` parameter. `Offset` will not return any results if the `page` arg isn't included. – Jesse Kerr Feb 11 '19 at 21:34
0

(I'm answering again because I don't have enough reputation to edit my previous answer, since it was turned into a comment).

The way offset and page work is not so intuitive. They actually are dependent on and multiply each other. For example, if page is set to 20 and offset is 2, you will skip 40 entries down. I figured this out using the API console because I couldn't find any documentation that specified their relationship.

This also explains why offset does not work on its own.

Jesse Kerr
  • 341
  • 1
  • 8
0

Be aware though, offset does not work if order is set to time. order=time. Also, if you order the response by time, it will reduce the amount of returned results (around 80%), so if you set your page=20 you will receive around 16 results.

StanKosy
  • 109
  • 1
  • 4