Search code with date range GitHub Search API

In November 2020 it was possible to search code files with a certain extension that are contained in repositories created within a specified date range through the GitHub search API as follows:

https://api.github.com/search/code?q=product%20created:2015-05-15..2015-05-16%20extension:csv

This returned 229 items.

In April 2021, queries to search code files in repositories created within a date range do not return anything. For example, the same url now returns the message:

Must include at least one user, organization, or repository

However, the documentation (accessed on 10-04-2021) explains the following:

This indicates that searching code in repositories created by date range should still be possible.

Does anyone have an idea what is going wrong, what has changed, or if it is still possible search code by repository creation date ranges another way as of April 2021?

:wave: Welcome!

The first thing I’d check is your authentication if your search isn’t scoped by repository, user, or organisation. I believe that there was a gap where unauthenticated global searches were possible, but that got fixed in December - so that might fit your timeline.

1 Like

Thanks for the welcoming response @canuckjacq!

I think the code search functionality of the Search API does not support the date range qualifier (anymore). I decided to break down queries exceeding the 1K result limit using the size qualifier!

1 Like