# Retrieving all targets associated with a disease using the API (pagination)

**URL:** <https://community.opentargets.org/t/retrieving-all-targets-associated-with-a-disease-using-the-api-pagination/917>\
**Category:** GraphQL API\
**Created:** [11 January 2023 10:22 UTC](https://community.opentargets.org/t/retrieving-all-targets-associated-with-a-disease-using-the-api-pagination/917 "2023-01-11T10:22:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamalika\_ray](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/kamalika_ray/32/310_2.png) [@kamalika\_ray](https://community.opentargets.org/u/kamalika_ray)\
**Post date:** [11 January 2023 10:22 UTC](https://community.opentargets.org/t/retrieving-all-targets-associated-with-a-disease-using-the-api-pagination/917/1 "2023-01-11T10:22:31Z")

</div>

Hi,

I am trying to retrieve all the targets associated with IBD. I am using graphql API to retrieve them. I am only getting 25 targets with the efoID ( EFO\_0003767). However, in the open target genetics platform browser there seem to be many more. How do I retrieve all the associated genes?

Thanks

---

<div class="post-metadata">

**Author:** ![ochoa](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/ochoa/32/189_2.png) [@ochoa](https://community.opentargets.org/u/ochoa)\
**Post date:** [11 January 2023 12:39 UTC](https://community.opentargets.org/t/retrieving-all-targets-associated-with-a-disease-using-the-api-pagination/917/2 "2023-01-11T12:39:38Z")

</div>

You might find this example useful:

> [@Retrieving \>50 pathways from evidences](https://community.opentargets.org/t/retrieving-50-pathways-from-evidences/767/4):
>
> Hi Keith Pagination on Evidence is possible, although it is a little more tricky than other areas. Consider the following query and parameters: query PaginatedEvidence($ensgId: String!, $efo: [String!]!, $ds: [String!]!) { target(ensemblId: $ensgId) { evidences(efoIds:$efo, datasourceIds:$ds) { count rows { id } cursor } } } parameterised over: { "ensgId": "ENSG00000141736", "efo": ["EFO\_0000311"], "ds": ["reactome", "slapenrich"] } The res…
