如何使用GitHub Search API进行多条件仓库查询?
GitHub搜索API多关键词正确用法
- 你现在用的请求
https://api.github.com/search/repositories?q=Tensorflow, meta-learning+language:python写法不对,逗号加空格的格式不被GitHub搜索API识别。 - 多关键词的正确组合方式:
- 用**加号(+)**连接多个关键词,表示必须同时包含这些内容,比如要找同时涉及TensorFlow和meta-learning的Python仓库,正确的参数应该是:
q=TensorFlow+meta-learning+language:python - 如果meta-learning是固定术语,怕被拆分成单个词搜索,可以用双引号包裹短语,比如:
q="TensorFlow"+"meta-learning"+language:python
- 用**加号(+)**连接多个关键词,表示必须同时包含这些内容,比如要找同时涉及TensorFlow和meta-learning的Python仓库,正确的参数应该是:
- 额外技巧:如果需要“或”逻辑,用大写的
OR分隔关键词,比如想找用TensorFlow或PyTorch做meta-learning的Python仓库:q=TensorFlow+OR+PyTorch+meta-learning+language:python - 要按星数排序的话,直接追加排序参数就行,比如:
https://api.github.com/search/repositories?q=TensorFlow+meta-learning+language:python&sort=stars&order=desc
内容的提问来源于stack exchange,提问作者desert_ranger
相关产品推荐
相关产品推荐

