Graph

GET /api/1/graph/(graph_query)/

Provide fast access to the graph representation of the Software Heritage archive.

That endpoint acts as a proxy for the Software Heritage Graph service.

It provides fast access to the graph representation of the Software Heritage archive.

The full documentation of the available Graph REST API can be found here.

Warning

That endpoint is not publicly available and requires authentication and special user permission in order to be able to request it.

Parameters
  • graph_query (string) – query to forward to the Software Heritage Graph archive (see its documentation)

Query Parameters
  • resolve_origins (boolean) – extra parameter defined by that proxy enabling to resolve origin urls from their sha1 representations

Status Codes

Examples:

https://archive.softwareheritage.org/api/1/graph/leaves/swh:1:dir:432d1b21c1256f7408a07c577b6974bbdbcc1323/
https://archive.softwareheritage.org/api/1/graph/neighbors/swh:1:rev:f39d7d78b70e0f39facb1e4fab77ad3df5c52a35/
https://archive.softwareheritage.org/api/1/graph/randomwalk/swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2/ori?direction=backward
https://archive.softwareheritage.org/api/1/graph/randomwalk/swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2/ori?direction=backward&limit=-2
https://archive.softwareheritage.org/api/1/graph/visit/nodes/swh:1:snp:40f9f177b8ab0b7b3d70ee14bbc8b214e2b2dcfc?direction=backward&resolve_origins=true
https://archive.softwareheritage.org/api/1/graph/visit/edges/swh:1:snp:40f9f177b8ab0b7b3d70ee14bbc8b214e2b2dcfc?direction=backward&resolve_origins=true
https://archive.softwareheritage.org/api/1/graph/visit/paths/swh:1:dir:644dd466d8ad527ea3a609bfd588a3244e6dafcb?direction=backward&resolve_origins=true