Official support for looking up resources by ID

Hello! Is there a way to look up users, repositories, and organizations by their unchanging ID? There are the endpoints mentioned in, but none of them are attested in API documentation. They do seem to appear in the official Ruby client, however:

(edited down because as a new user I can only post two links)

Will those endpoints be made official and documented?

Alternatively, is there a way to look up these resources by ID in the GraphQL API?

:wave: @aterweele, welcome to the GitHub Support Community. We appreciate you asking these questions here!

We can’t speak to specific timelines for if or when endpoints will be made official and documented. That said, we checked internally with our team and have an open issue discussing this. For now, we recommend following and for the latest updates to and our API respectively.

If you have any other notes to share about your use case, would you mind submitting this through our official product feedback form so that our product team can track your request? That’s the best place to share requests like these in consideration for future iterations of GitHub features.

Yes, but I think some additional context is warranted.

As you observed, the GitHub REST API can resolve a repository by its database ID. It can also resolve an organization or a user account by its database ID.

The GitHub GraphQL API’s query root exposes the following fields:

  • a node field to fetch an object given its node ID.
  • a repository field to lookup a given repository by the owner and repository name, but no arguments exist for lookup by database ID.
  • a user field to lookup a given repository by the owner and repository name, but no arguments exist for lookup by database ID.

A node ID and database ID effectively point to the same resource, but their values are formatted differently.

Let’s use github/linguist as an example. We can get this repository via the GitHub REST API:

curl -v -H "Authorization: token $TOKEN" ""

The response exposes its id and its node_id:

  "id": 1725199,
  "node_id": "MDEwOlJlcG9zaXRvcnkxNzI1MTk5",
  // ... truncated for brevity

Here’s a GraphQL query for fetching it by its node ID:

query {
  node(id:"MDEwOlJlcG9zaXRvcnkxNzI1MTk5") {
    ... on Repository {

That ... on Repository is an inline fragment since a Node is implemented by many other types that communicates that if the node ID happens to match that Repository object, expand it and list its nameWithOwner. It’s possible that your query may target more than just repositories and you may want to expand certain fields differently. I hope this helps!