We can use apoc.load.jsonParams to load a JSON file from a web API, setting the HTTP request headers in the second parameter of this procedure:
CALL apoc.load.json("neo4j_neo4j_contributors_github.json") YIELD value AS item
MATCH (u:User {login: item.login})
CALL apoc.load.jsonParams(item.followers_url, {Authorization: 'Token ' + $token}, null) YIELD value AS contrib
MERGE (f:User {login: contrib.login})
CREATE (f)-[:FOLLOWS]->(u)
When performing the import, I got the following results:
Added 439 labels, created 439 nodes, set 439 properties, created 601 relationships, completed after 12652 ms.
This may vary when you run this since a given user's followers evolve over time. Here is the resulting graph, where users are shown in green and repositories in blue:
You can use any of the provided URLs to enrich your graph, depending on the kind of analysis you want to perform: you can add commits, contributors, issues, and so...