GitHub API v3 get all issues for user - github

I am currently developing a project using githubs v3 api and I am trying to find a way to get all issues across all repositories a user owns and is watching. How can I do that? The /user/issues and /issues only returns issues that a person is assigned to.

The endpoint you are using is correct:
/api.github.com/user/issues
According to the GitHub API page on issues, you can get all issues a user is subscribed to by including the filter parameter set to subscribed with your request.
You can get all issues a user is subscribed to at
/api.github.com/user/issues?filter=subscribed

Related

How can a Github App list a user's private repositories?

I am trying to list a user's private github repositories via a github app.
(Note: I am not currently using OAuth, and I am looking for a user's repositories, not an org's.)
I am attempting to make this API call with an installation client, that is, using a client specific to an installation of an app and using a JWT with my private key.
This is the endpoint I am requesting:
https://api.github.com/user/repos?per_page=100&visibility=private
This yields the following response:
{
"message":"Resource not accessible by integration",
"documentation_url":"https://docs.github.com/rest/reference/repos#list-repositories-for-the-authenticated-user"
}
The /user/repos not listed in the list of valid app endpoints so I'm not surprised this doesn't work.
Once a user installs my app, how can I list their private repos?
The way to do this is by calling the /installation/repositories endpoint. An "installation" might have access to many repos across many users, and this endpoint will encompass them all.
This endpoint is documented here: https://docs.github.com/en/rest/reference/apps#list-repositories-accessible-to-the-app-installation

How to get github users from city using Github REST API?

Background
I am working on an app and I need to get all the projects of all github users that live in a given city using the GitHub Rest API v3: https://developer.github.com/v3/
Research
Now I know I can get all the users with the following url:
https://api.github.com/users
And once I have a user, I can get all his repos and info from there.
Problem
The problem is that I don't know how to filter those users by city!
I have tried adding a paramter location=London but it always returns the same, probably because this is not the real parameter...
Another option would be to get all the github users from the world, and then filter them by city .... which would be totally insane.
The best option I found so far was to use this link:
https://github.com/search?q=language:javascript+location:Barcelona&type=Users
However, this link is the web version, which does not use the REST API.
Question
How do I get all the users from a given city using the Github REST API?
You are using the /users endpoint. You need to use the /search/users endpoint:
https://api.github.com/search/users?q=location%3Aiceland
Will search for users located in Iceland
Using that gets me a response with a bunch of users and after cross checking the first 3, they all have their location set to "Iceland" in their profiles.

Get All Issues on GitHub repository in specific month using GitHub API

I am trying to get all Pull requests created by specific user in a specific month in my django application using GitHub API.
e.g:
https://api.github.com/repos/myrepo/example/issues?creator=person_name&start_date=2018-1-1&end_date=2018-1-31
You can find issues created by a user in a given month using the search issues API endpoint, e.g.
https://api.github.com/search/issues?q=author:username+created:2018-01-01..2018-01-31
created can take a value like YYYY-MM-DD..YYYY-MM-DD to set a date range.
You might also want to add type:issue so you don't see pull requests or repo:user-or-org/repo to restrict results to a single repository.
Note that there are restrictions on searching users' contributions, including issues. You may need to have your users authenticate before you can search their issues. You should be able to try the endpoint out with your own user account, as long as you've got an authenticated session (e.g. by using a search URL in a browser where you're logged into GitHub).

LinkedIn Group API changes

As far as I can tell, with the new changes to the API's, LinkedIn's Group api's are no longer public at all. Are there any ways to access the posts made in a group without using the Group api?
All I'm looking to do is to read the posts from a public group.
There is no way to access that API publicly any longer. You would need to apply to be part of their partner program to get access to those endpoints once again:
https://developer.linkedin.com/partner-programs/apply

Can I query the Github API for my repository quota?

I'm working on an app that creates private Github repositories (among other things). Every once in a while, we are over quota with our private repos.
I'd like to know how many repositories we have left before making the API call that will fail.
Can that be done, using the Github API? I couldn't find anything in the documentation, but that's doesn't mean it's not possible :)
awendt, I'm not quite familiar with private quotas, but authenticated users receive a Plan object when the API returns the call to /user. This will tell you what plan you have and will tell you how many private_repos you're allowed. With that information and the information from /user which tells you how many private repos you currently have, you should be able to figure it out.
Then again, you could use github3.py and you'd have the User object, with the plan attribute and could use those two together as described above.
Disclaimer I'm github3.py's author.