Skip to main content
Version: v0.1.0

Graph Query API

API for querying the graph database.

Overview

The Graph Query API allows you to execute Cypher queries and retrieve metadata from the graph database.

Endpoints

GET /api/v1/neo4j/info

Retrieves graph database 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": {}
}
FieldTypeRequiredDescription
querystringYesCypher query
parametersobjectNoQuery 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 a 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"}'