# Only get active patrons

**URL:** <https://www.patreondevelopers.com/t/only-get-active-patrons/4850>\
**Category:** Uncategorized\
**Created:** [October 22, 2021, 9:28am UTC](https://www.patreondevelopers.com/t/only-get-active-patrons/4850 "2021-10-22T09:28:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwood](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@gwood](https://www.patreondevelopers.com/u/gwood)\
**Post date:** [October 22, 2021, 9:28am UTC](https://www.patreondevelopers.com/t/only-get-active-patrons/4850/1 "2021-10-22T09:28:12Z")

</div>

I use `fetch_page_of_members_from_campaign()` in the PHP library. Is there anyway to **only** get the **active** patrons? By default, it seems we get _all_ patrons, including the ones you have cancelled their pledges.

I can easily adjust the PHP library, but simply need to know how to filter it to active only. Do we have anything useful in the API?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [October 22, 2021, 9:35am UTC](https://www.patreondevelopers.com/t/only-get-active-patrons/4850/2 "2021-10-22T09:35:37Z")

</div>

I dont think that would be possible at this point. However if you add includes to the call, you could get more membership details for each user in that same call and you could speed up processing the data that way since you wont have to query the member for additional details.

---

<div class="post-metadata">

**Author:** ![gwood](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@gwood](https://www.patreondevelopers.com/u/gwood)\
**Post date:** [October 22, 2021, 9:51am UTC](https://www.patreondevelopers.com/t/only-get-active-patrons/4850/3 "2021-10-22T09:51:30Z")

</div>

How do you mean add includes to speed up the process?

This is how I do it currently:

1. Get campaign tier ids via `fetch_campaign_details()`.
2. Get members of campaign via `fetch_page_of_members_from_campaign()`.
3. And then finally loop through results and fetch each member via `fetch_member_details()`.

Are you telling me there is a way to _decrease_ this workflow and get the same data? Presumably by avoiding looping through each result and get each member via `fetch_member_details()`.

Please share your helpful insights, ideally with code example! I think it will be useful for others as well. Thanks.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [October 22, 2021, 11:15pm UTC](https://www.patreondevelopers.com/t/only-get-active-patrons/4850/4 "2021-10-22T23:15:11Z")

</div>

Basically you modify the call and add the includes and get the relationships you want, to get info in less calls.Check out how WP plugin does it, starting from below call:

> <https://github.com/Patreon/patreon-wordpress/blob/2eec51d7ff46bc633eed84835d0664dbecb15300/classes/patreon_api_v2.php#L22>
