swh.web.api.views.graph module#
- swh.web.api.views.graph.api_graph(request: Request) None[source]#
- 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. - For more details please refer to the Graph RPC API documentation. - 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:
- 200 OK – no error 
- 400 Bad Request – an invalid graph query has been provided 
- 404 Not Found – provided graph node cannot be found 
 
 - 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/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