API Documentation

Comprehensive guide to integrating with the Graphbank Search API. Learn about authentication, endpoints, and best practices.

Quick Start

Get up and running with the Graphbank Search API in minutes. This guide will walk you through the essential steps to make your first API call.

Prerequisites

Make sure you have an API key ready. If you don't have one, contact our team to get started.

1. Set up your environment

Environment Variables
GRAPHBANK_API_URL=http://localhost:3001/graphql GRAPHBANK_API_KEY=your-api-key-here

2. Make your first request

cURL Example
curl -X POST http://localhost:3001/graphql \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{
    "query": "query Search($query: String!, $limit: Int!) { search(query: $query, limit: $limit) { type itemId similarity } }",
    "variables": { "query": "mathematics", "limit": 5 }
  }''

3. JavaScript/Node.js example

JavaScript Example
const response = await fetch('http://localhost:3001/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'your-api-key-here'
  },
  body: JSON.stringify({
    query: `query Search($query: String!, $limit: Int!) {
      search(query: $query, limit: $limit) {
        type
        itemId
        similarity
        title
      }
    }`,
    variables: { query: 'mathematics', limit: 5 }
  })
});

const data = await response.json();
console.log(data);