# Get associations from different ids

**URL:** <https://community.opentargets.org/t/get-associations-from-different-ids/909>\
**Category:** GraphQL API\
**Created:** [2 January 2023 13:21 UTC](https://community.opentargets.org/t/get-associations-from-different-ids/909 "2023-01-02T13:21:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgv94](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jgv94](https://community.opentargets.org/u/jgv94)\
**Post date:** [2 January 2023 13:21 UTC](https://community.opentargets.org/t/get-associations-from-different-ids/909/1 "2023-01-02T13:21:29Z")

</div>

Hello,

I would like to know if it is possible to query OpenTargets API to get target-disease associations using a target id different than Ensembl (e.g. HGNC approved symbol)

Also, querying by disease id, using, for instance MONDO or OMIM ids.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![dsuveges](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/dsuveges/32/30_2.png) [@dsuveges](https://community.opentargets.org/u/dsuveges)\
**Post date:** [4 January 2023 15:32 UTC](https://community.opentargets.org/t/get-associations-from-different-ids/909/2 "2023-01-04T15:32:21Z")

</div>

Hi,

Welcome to the OpenTargets community portal! Although it is possible to retrieve association data via other than disease and target identifiers, it is not advised. You can use the search endpoint then resolve the target/disease object as follows:

```plaintext
  search(
    queryString: $queryString
    entityNames: ["target"]
    page: { index: 0, size: 1 }
  ) {
    hits {
      id
      entity
      object {
        ... on Target {
          id
          approvedSymbol
          approvedName
					associatedDiseases {
						rows {
              disease {
                name
              }
              datasourceScores{
                id
                score
              }
            }
          }
        }
      }
    }
  }
}

```

You can generalize the above example to diseases as well. But as I mentioned, I would rather map my genes to Ensembl gene identifiers first using Ensembl’s [REST API](https://rest.ensembl.org/lookup/symbol/human/EGFR?;content-type=application/json) for example. Please let us know more about your use case, so we can advise furhter.
