0

I want to use the Github Search API to find all files that can be close to a given word. For example, if i search for https://api.github.com/search/code?q=COPY+in:file,path+repo:yvonndjamen/Endevor i will receive 6 items matching my request because i gave the word "COPY"

But if i do the same request with: https://api.github.com/search/code?q=CO+in:file,path+repo:yvonndjamen/Endevor
There will not be any answer.

Is there a way to solve this problem and make a research like with the Github File Finder?
Over there when i just type "C" i get lots of results and i want to perform something like that with the Search API.

I want to be able to search for a letter ("C") or two ("CO") and get results where the API find files with those letters.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Based on the docs I don't think this is possible because you can't use wildcards. See: https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-code#considerations-for-code-search – astrochun Aug 12 '21 at 11:47
  • @astrochun i really looked for it and though i could find a work around, but it is really not possible. Thank you – uncletonton Aug 13 '21 at 11:59
  • What was your workaround? – astrochun Aug 14 '21 at 11:45
  • 1
    @astrochun since i wanted to implement my own frontend file finder, i gave it 3 search criteria. If the user look for "element", my backend make a request to Github with the "q" index -> "q=element_name"...If he gives an "extension", the request look like this "q=+extension=extension_name" and if he gives a location, the request use another url that gives every files present in the provided location – uncletonton Aug 17 '21 at 07:27

0 Answers0