total_count in code search accessed via API different than web results #56494
Replies: 2 comments 1 reply
-
You can either loop through the pages and do your count that way, until you get to the last page, or use Github's newer GraphQL API (which I think doesn't have the same limits). |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hello,
I'm using code search to get the total count of
CITATION.cff
files across GitHub (or a best effort estimate thereof).In the past, I've had sensible values for
total_count
in the API response to authorized searchhttps://api.github.com/search/code?q=filename:CITATION.cff
. NOw that thefilename
qualifier doesn't seem to exist anymore, I still get sensible results in web search with querypath:CITATION.cff
, returning ~12.5k of CFF files in the root of repositories globally. However, the same query against the API always returns ~1000 as value fortotal_count
, leading me to believe that instead of the total count of the global search result, this gives me the total count of results up to the 1k results limit.Is this true, or is it a bug, or something that has changed in the API?
(I have a feeling that blank queries with just a qualifier are being discouraged.)
Any other way I can get the real result again?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions