Search Repository Technology wise ? #49434
Replies: 1 comment
-
|
First, you can try to find or define repositories based on a specific technology you want to find. Some examples of filters we can use:
As far as I know, the GitHub API allows you to search for repositories with a query like this: Example for Rust: If you want more results in a single request, you can add If you want, you can write a simple script like this to get the results using an HTTP GET request in Python. Keep in mind that GitHub limits unauthenticated requests to 60 per hour. If you need more, you can use a GitHub token: import requests
# Technology to search for
tech = "rust"
url = f"https://api.github.com/search/repositories?q=language:{tech}+is:public&per_page=100"
# Make the request to GitHub
response = requests.get(url, headers={'Accept': 'application/vnd.github.v3+json'})
# Check if the request was successful
if response.status_code == 200:
data = response.json()
for repo in data['items']:
print(f"Name: {repo['nane']}")
print(f"Description: {repo['description']}")
print(f"URL: {repo['html_url']}")
print(f"Stars: {repo['stargazers_count']} | Forks: {repo['forks_count']}")
print('---')
else:
print(f"Error: {response.status_code}")To increase the request limit, you can authenticate with a personal access token.
headers = {
'Authorization': 'token YOUR_TOKEN_HERE',
'Accept': 'application/vnd.github.v3+json'
}
response = requests.get(url, headers = headers)This increases the limit to 5000 requests per hour. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Show & Tell
Body
I am trying to find a way that I provide technology in api and GitHub return me repositories which are open source and belongs to that technology.
This will help users to find repositories to collaborate more quickly.
Beta Was this translation helpful? Give feedback.
All reactions