GraphQL API - Search results end after 10 pages

I’m trying to get Python repos with over 1000 stars using this query:

query OpenGraph($after: String) {
  search(type:REPOSITORY, query:"language:Python stars:>1000 sort:stars-desc", first:100, after:$after) {
    pageInfo {
    ... on SearchResultItemConnection {
      nodes {
        ... on Repository {

And it seems that the API doesn’t allow to go after 10th page (I’m using endCursor from last query as after parameter to search query), even though there’s like 2k Python repos (which should mean at least another 10 pages)

Is this a limitation of GraphQL API or do I need to do this differently?

Hi @jack1142,

Thanks for being here! The behavior you observed is expected – it’s not possible to fetch more than 1000 results for a specific search query. This is true for the web UI, REST API and GraphQL API. There’s no way around this restriction.

However, there might be a different approach you might use. You could slice your query, e.g. based on the date the repository was created (for example, repositories created in first week of 2017, then second week, and so on). You’d then run multiple searches to collect the results for each slice (and the number of results would be less than 1000 since you’re limiting the query to a small period), then combine results for all slices, and finally sort the whole list as you like.


Hope this helps.


Is it normal that the following sort options for a search query don’t work?

  • sort:author-date
  • sort:author-date-asc
  • sort:author-date-desc
  • sort:created
  • sort:created-asc
  • sort:created-desc
  • sort:created-at-asc
  • sort:created-ar-desc

Basically what I’m trying to do it sort the search results of my query by the repository’s creation date. According to this Sorting search results  , the first 3 should work…