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

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.

Related

Azure Devops API - Can't find a way to get permission groups/membership using API

I am looking for a way to use the Azure DevOps API to get membership of permission groups. The data I am looking for is in the following location on the front end:
I had the same requirement to get team membership within Azure DevOps and was able to do so using the following URI:
https://dev.azure.com/{organization}/_apis/projects/hrs/teams/{teamname}/members?api-version=6.0
I could not find a similar URI to get permission groups and need a way to pull this information using the API.
I've tried many of the API endpoints on the official api documentation (below) focusing on any that seem like they may pull security group related information. In all cases I came up short either because the endpoint did not provide me with what I was looking for, or the documentation for an endpoint wasn't clear on how parameters need to be structured for more advanced use cases.
https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/groups/get?view=azure-devops-rest-7.0&tabs=HTTP
I also tried asking this question to ChatGPT however the endpoints the chatbot provided me with did not work either.
I found a way to get what I am looking for, but I am not a big fan of the approach.
You can use the graph API to list all permission groups
once you have the permission groups, you can write a script to filter for the group object within the API response you want to get the members of.
The group object has the appropriate API endpoint to hit to get the member objects within the _links.memberships property.
Call the API with the memberships link from above. It will return an array of descriptors which can be used in further API calls.
For each descriptor, hit the appropriate API endpoint to resolve the object for that descriptor. If the descriptor starts with aad then it is a user and you can use the user get api. If the descriptor starts with aadgp then it is a group and you use the group get api.
This strategy is rather complicated and requires an API call for each member of the group. I'd hope there is a better solution.

LinkedIn API reference

I'm trying to pull all the data associated with my companies LinkedIn page, but I can't figure out how to navigate the API... (I already have a bearer token).
I've looked at these reference fields, but the only GET request that gives me anything back is https://api.linkedin.com/v1/people/~?format=json and that gives me my personal profile info, which is not what I want.
If I change "people" to "visitors" for example, I get back:
"Unknown field {visitors} in resource {Root}"
Is there any documentation on what resources are available in {Root} or is there a GET request I can send that will show me the available resources?
Note: the only reason I'm using v1 here is because that's the only request I can get to work...
well, the V1 you are using is outdated. it will actually be terminated in March 2019. The reason why V2 is not working. is because V2 requires a LinkedIn partnership. you can request one here.
there are multiple ways you can request company data. for V1 it is called:
the manage company pages API, click here for more information
for V2 you should look at organization API, click here for more information
PS: im not sure if there is a way to get the root information. but hopefully this helps.

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).

GitHub API v3 get all issues for user

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

How to retrieve multiple user account details through their Facebook IDs in graph API?

This could be a duplicate of here and here, but can some one provide a complete working example for following.
I have set of different Facebook account Ids, and i need to get the respective account details(user name etc) from these account ids. I need to send a Batch Request for Graph API. Something as follows,
(https://graph.facebook.com?ids=user1, user2, user3,...)
Is this possible as pure HTTP GET request ?
I am using Facebook SDK with Android for the moment. I have gone through the API doc but unable to build the required query yet. Please help.
Maybe post a snippet of your code so we can try to solve your problem better. With the info you provided, the URL https://graph.facebook.com/?ids=user1,user2,user3 works just fine and returns 3 users.
The URL format looks correct. Keep in mind the total character limit, but otherwise I suspect you are stuck in a different place (e.g. sending the query or saving the result).