v2.4.0 Home Dashboard
Docs/ Getting Started/ Introduction

Introduction

Graph API Data is a high-performance graph database platform accessible via REST and GraphQL. This guide will get you up and running in minutes.

Installation

Install the official Graph API Data SDK for your language of choice:

bash
# Node.js / TypeScript
npm install @Graph API Data/sdk

# Python
pip install Graph API Data

# Go
go get github.com/Graph API Data/Graph API Data-go

Authentication

All API requests must include your API key in the Authorization header. You can find your API keys in the dashboard.

â„šī¸ Keep your API key secret. Never commit it to version control. Use environment variables in production.
javascript
import { Graph API Data } from '@Graph API Data/sdk';

const gd = new Graph API Data({
  apiKey: process.env.Graph API Data_API_KEY, // gd_live_xxxxx
  region: 'us-east-1',              // optional
});

Your First Query

Once authenticated, you can start querying your graphs. Here's a simple node lookup and a traversal:

javascript
// Get a single node by ID
const user = await gd.nodes.get({
  graph: 'social_network',
  id: 'user_42',
});
// { id: 'user_42', name: 'Alice', age: 28, ... }

// Traverse outgoing FOLLOWS edges to depth 2
const network = await gd.traverse({
  graph: 'social_network',
  start: 'user_42',
  edge: 'FOLLOWS',
  direction: 'outgoing',
  depth: 2,
});
// → { nodes: [...], edges: [...], took: '1.2ms' }

Traversal Parameters

ParameterTypeDescription
graph requiredstringThe name of the target graph database.
start requiredstringThe starting node ID for the traversal.
edgestring | string[]Edge type(s) to follow. If omitted, all edge types are traversed.
direction'outgoing' | 'incoming' | 'both'Direction to traverse edges. Defaults to 'outgoing'.
depthnumberMaximum traversal depth (hops). Defaults to 1, max 10.
limitnumberMax nodes to return. Defaults to 1000, max 100000.
filterobjectProperty filters to apply on traversed nodes or edges.
💡 For traversals deeper than depth 5, we recommend adding a filter to reduce result size and improve performance.

Error Handling

The SDK throws typed errors for all failure cases. Always wrap your queries in try/catch:

javascript
try {
  const result = await gd.traverse({ ... });
} catch (err) {
  if (err.code === 'GRAPH_NOT_FOUND') { ... }
  if (err.code === 'RATE_LIMIT_EXCEEDED') { ... }
  if (err.code === 'UNAUTHORIZED') { ... }
}