Count number of results of a code search

I know that the search API limits the number of results of a search to 1000. I’m wondering if there’s a way to get the total number of results (I don’t need the actual results, just how many there are).

Specifically, I’m trying to get the number of JavaScript projects which use the “await” keyword.

Thanks!

Hi @emarteca,

Thank you for being here! You could try:

{search(query: "keyword", type: REPOSITORY, first: 10) {
    repositoryCount
    edges {
      node {
        ... on Repository {
          name
        }
      }
    }
  }
}

That should return a total count of all repos including your keyword.  I hope this helps! 

Best,

Andrea

>> edit: I misunderstood what was being returned from the query provided. I was actually hoping for a way to get the total number of repositories whose code contains a particular keyword!

The query you provided gives the total number of repos whose descriptions or titles contain the keyword, and the query I’ve been using (initially with the v3 search API) was returning the total number of occurrences of the keyword across github. 

Thanks again for your time!