Neo4j API
API for querying Neo4j graph database.
Overview
Through the Neo4j API, you can execute Cypher queries and retrieve metadata from the graph database.
Endpoints
GET /api/v1/neo4j/info
Retrieves Neo4j server information.
Response
200 OK
{
"version": "5.x.x",
"edition": "community",
"database": "neo4j"
}
POST /api/v1/neo4j/query
Executes a Cypher query.
Request Body
{
"query": "MATCH (n:Person) RETURN n LIMIT 10",
"parameters": {}
}
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Cypher query |
parameters | object | No | Query parameters |
Response
200 OK
{
"records": [...],
"summary": {
"query_type": "r",
"counters": {},
"result_available_after": 5,
"result_consumed_after": 10
}
}
GET /api/v1/neo4j/labels
Retrieves a list of all node labels.
Response
200 OK
["Person", "Company", "Product"]
GET /api/v1/neo4j/relationships
Retrieves a list of all relationship types.
Response
200 OK
["KNOWS", "WORKS_FOR", "BOUGHT"]
Usage Examples
# Execute query
curl -X POST https://api.dhub.io/api/v1/neo4j/query \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"query": "MATCH (p:Person)-[:KNOWS]->(friend) RETURN p, friend LIMIT 50"}'