Github dependency graph API

Hey everyone! First of all, congrats on the dependency graph feature, it is incredibly useful, especially now that it also handles npm packages. The question is: is there a way to access it via API? It would be really helpful for us to monitor new projects using our libraries.

Thanks!

13 Likes

I don’t see anything about it in the developer documentation at https://developer.github.com and I don’t see anything about it in the API Preview section either. You might be able to approximate it using a code search though. For example, this search finds package.json files that contain “greenkeeper”:

https://github.com/search?utf8=%E2%9C%93&q=greenkeeper+in%3Afile+filename%3Apackage.json&type=Code

4 Likes

In case anyone else stumbles across this, it does appear that there is an API in “preview” as of April 2018:

https://developer.github.com/changes/2018-04-24-preview-dependency-graph-and-vulnerability-hooks/

https://developer.github.com/v4/previews/#access-to-a-repositories-dependency-graph

https://developer.github.com/v4/object/repository/#connections

1 Like

It would seem that the API provides access to dependencies, but not dependent projects. Maybe I’m missing something…?

5 Likes

That’s my takeaway from the documentation, I have been trying to find a way to query that but so far no luck finding the dependents of a project, I guess it is not supported yet…