Get the graph url

Hi

Is there any way to get the url of the graph generated in neo4j?

Asking gpt, it says the url in the browser should be something like

https://localhost:7473/browser/#graph/neo4j/XXXX

but the url in the browser is always the same, http://localhost:7474/browser

I dont know if with py2neo i could get that id, would that be possible?

Thanks

@javi.xeneize

I'm not sure what is requested here. can you provide more specifics.

Also documentation describes the available browser url parameters

Hi

the ultimate goal i have is to run a query in a python script, and export as a png, or render, the graph generated. I think that if i can get the url of the graph that has been generated, then, i can easily export it as a png, thats why i am interested in getting that url, but maybe there is a better approach to do that

I know in the neo4j browser you can export as png the graph created, so i was wondering how does it work, and replicate the same functionality in my script

Thanks :slight_smile:

@javi.xeneize

so its the result from a query that you want to export? Is that correct.
if so I'm not aware of how to do this via a URL / api

yes, thats it, its the graph generated via query what i want to export

i dont know if would be easier to reformulate it in a different way.. in neo4j browser, you have an option to export the png of the graph. How does it work? Because thats exactly what i need to replicate

Actually there is an indirect way you can achieve this. You need some kind of framework that takes care of the rendering for you. The Neo4j Browser uses its own engine for this but it is hard to “just extract” the graph. I suggest you use a small JavaScript and a framework like Three or so (GitHub - vasturiano/3d-force-graph: 3D force-directed graph component using ThreeJS/WebGL) and run your Cypher query right in it (if the query is static - otherwise you have to ingest the Cypher query accordingly). Thus allows you to visualize the graph right in an HTML container

1 Like

or GitHub - neo4j-contrib/neovis.js: Neo4j + vis.js = neovis.js. Graph visualizations in the browser with data from Neo4j.

1 Like

Thanks both!! Great suggestions