API Documentation

Complete developer guide for Vector AI's blockchain intelligence API

API Overview

Vector AI API provides programmatic access to our advanced blockchain intelligence platform. Get real-time token analysis, security scanning, and market insights directly in your applications.

API Specifications

Base URL: https://api.vector-ai.pro/v1
Protocol: HTTPS/REST
Authentication: Bearer Token
Rate Limits: 1000 requests/hour (Free), Unlimited (Premium)
Response Format: JSON
Uptime SLA: 99.9%


🚀 Quick Start Guide

🔑 Authentication Setup

# All requests require Bearer token authentication
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

First API Call

curl -X POST https://api.vector-ai.pro/v1/analyze \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "0x569Dd3298E114Da858415ee5672C8F2AB57938Bf",
    "chain": "ethereum"
  }'

📝 Getting Started

Step 1: Get API Key

Request an API key:

curl -X POST https://api.vector-ai.pro/v1/keys \
  -H "Content-Type: application/json" \
  -d '{
    "email": "your@email.com",
    "name": "Your App"
  }'

Step 2: Make First Request

curl -X POST https://api.vector-ai.pro/v1/analyze \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "0x569Dd3298E114Da858415ee5672C8F2AB57938Bf",
    "chain": "ethereum"
  }'

Step 3: Parse Response

The API returns comprehensive analysis data:


{
  "success": true,
  "data": {
    "token": {
      "name": "Vector AI",
      "symbol": "VECTOR",
      "address": "0x569Dd3298E114Da858415ee5672C8F2AB57938Bf",
      "chain": "ethereum"
    },
    "vectorScore": {
      "overall": 85,
      "grade": "B+",
      "confidence": 0.92
    },
    "analysis": {
      "security": {...},
      "market": {...},
      "social": {...}
    }
  },
  "meta": {
    "timestamp": "2024-01-15T10:30:00Z",
    "processingTime": 3.2,
    "version": "1.0"
  }
}

API Keys Authentication

What are API Keys?

API keys are unique identifiers that authenticate requests to the Vector AI API. They ensure secure access, enable usage tracking, and provide rate limiting based on your subscription tier.

Key Features

  • Secure Authentication - Cryptographically secure tokens
  • Usage Tracking - Monitor API consumption and patterns
  • Rate Limiting - Automatic limits based on subscription tier
  • Easy Rotation - Simple key management and rotation
  • Granular Permissions - Control access to specific endpoints

API Key Request Parameters

Required Fields:

  • email (string) - Your contact email address
  • name (string) - Application or project name

Optional Fields:

  • tier (string) - Requested tier: "free", "basic", "pro", "enterprise"
  • description (string) - Detailed description of intended use
  • webhook_url (string) - URL for webhook notifications
  • ip_whitelist (array) - Allowed IP addresses (enterprise only)

Response Format

Success Response:

{
  "success": true,
  "data": {
    "api_key": "vapi_1234567890abcdef",
    "tier": "basic",
    "rate_limit": {
      "requests_per_minute": 60,
      "requests_per_day": 1000
    },
    "permissions": ["analyze", "monitor", "alerts"],
    "expires_at": "2025-01-15T10:30:00Z"
  }
}

Authentication Methods

Primary Method: Header Authentication (Recommended)

Authorization: Bearer YOUR_API_KEY

Alternative: Query Parameter (Not Recommended)

?api_key=YOUR_API_KEY

Note: Header authentication is strongly recommended for security reasons.

Headers Reference

Required Headers:

  • Authorization: Bearer YOUR_API_KEY
  • Content-Type: application/json

Optional Headers:

  • X-Request-ID: unique_request_id - For request tracking
  • User-Agent: YourApp/1.0 - Application identification

Rate Limiting

Rate Limit Tiers

| Tier | Requests/Minute | Requests/Day | Features | |------|----------------|--------------|----------| | Free | 10 | 100 | Basic analysis | | Basic | 60 | 1,000 | All analysis features | | Pro | 300 | 10,000 | Priority processing, webhooks | | Enterprise | Custom | Custom | SLA, dedicated support |

Rate Limit Headers

The API includes rate limit information in response headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1642248600
X-RateLimit-Tier: basic

Handling Rate Limits

429 Too Many Requests Response:

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Try again in 30 seconds.",
    "retry_after": 30
  }
}

Best Practices:

  • Implement exponential backoff
  • Monitor rate limit headers
  • Cache responses when possible
  • Use webhooks for real-time updates

Token Analysis Endpoint

Endpoint URL

POST /v1/analyze

What it does

Performs comprehensive blockchain intelligence analysis on any token, providing security assessment, market analysis, and social validation.

Use Cases

  • Pre-investment token screening
  • Portfolio risk assessment
  • Automated trading bot integration
  • DeFi protocol token whitelisting
  • Research and due diligence

Request Format

Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Body

Basic Request:

{
  "address": "0x569Dd3298E114Da858415ee5672C8F2AB57938Bf",
  "chain": "ethereum"
}

Advanced Request:

{
  "address": "0x569Dd3298E114Da858415ee5672C8F2AB57938Bf",
  "chain": "ethereum",
  "features": ["security", "market", "social", "technical"],
  "depth": "comprehensive",
  "include_historical": true,
  "webhook_url": "https://yourapp.com/webhook"
}

Parameters

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | address | string | Yes | Token contract address | | chain | string | Yes | Blockchain network (ethereum, bsc, polygon, arbitrum) | | features | array | No | Analysis modules to include | | depth | string | No | Analysis depth: "quick", "standard", "comprehensive" | | include_historical | boolean | No | Include historical data analysis | | webhook_url | string | No | URL for async result delivery |

Supported Chains

| Chain | Network ID | RPC Support | Features | |-------|------------|-------------|----------| | Ethereum | ethereum | Full | All features | | BSC | bsc | Full | All features | | Polygon | polygon | Full | All features | | Arbitrum | arbitrum | Full | All features | | Optimism | optimism | Limited | Basic analysis | | Avalanche | avalanche | Limited | Basic analysis |

Available Features

| Feature | Description | Processing Time | |---------|-------------|----------------| | security | Smart contract vulnerability analysis | 2-3 seconds | | market | Price, volume, and liquidity analysis | 1-2 seconds | | social | Community and sentiment analysis | 3-4 seconds | | technical | Technical indicators and patterns | 2-3 seconds | | historical | Historical performance analysis | 5-10 seconds |

Response Format

Success Response

{
  "success": true,
  "data": {
    "token": {
      "name": "Vector AI",
      "symbol": "VECTOR",
      "address": "0x569Dd3298E114Da858415ee5672C8F2AB57938Bf",
      "chain": "ethereum",
      "decimals": 18,
      "total_supply": "1000000000000000000000000000",
      "verified": true
    },
    "vectorScore": {
      "overall": 85,
      "grade": "B+",
      "confidence": 0.92,
      "risk_level": "low"
    },
    "analysis": {
      "security": {
        "score": 88,
        "vulnerabilities": [],
        "honeypot_risk": "none",
        "contract_verified": true,
        "owner_privileges": "limited",
        "liquidity_locked": true,
        "lock_duration": "365 days"
      },
      "market": {
        "score": 82,
        "price_usd": 0.0245,
        "market_cap": 24500000,
        "volume_24h": 145000,
        "liquidity_usd": 850000,
        "price_change_24h": 5.2,
        "volatility": "medium"
      },
      "social": {
        "score": 85,
        "twitter_followers": 15420,
        "telegram_members": 8950,
        "community_engagement": "high",
        "sentiment": "positive",
        "social_volume": 125
      }
    },
    "recommendations": [
      "Strong security fundamentals with verified contract",
      "Healthy liquidity and trading volume",
      "Active community engagement",
      "Consider for portfolio inclusion"
    ],
    "warnings": [],
    "metadata": {
      "analysis_timestamp": "2024-01-15T10:30:00Z",
      "processing_time": 4.2,
      "data_sources": ["etherscan", "dexscreener", "twitter", "telegram"],
      "version": "1.0"
    }
  }
}

Python Examples

Required Dependencies

pip install requests python-dotenv asyncio aiohttp

Environment Setup

# .env file
VECTOR_API_KEY=your_api_key_here
VECTOR_BASE_URL=https://api.vector-ai.pro/v1

Basic Example

import requests
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

class VectorAI:
    def __init__(self, api_key=None):
        self.api_key = api_key or os.getenv('VECTOR_API_KEY')
        self.base_url = os.getenv('VECTOR_BASE_URL', 'https://api.vector-ai.pro/v1')
        self.headers = {
            'Authorization': f'Bearer {self.api_key}',
            'Content-Type': 'application/json'
        }
    
    def analyze_token(self, address, chain='ethereum', features=None):
        """Analyze a token with specified parameters"""
        if features is None:
            features = ['security', 'market', 'social']
        
        payload = {
            'address': address,
            'chain': chain,
            'features': features
        }
        
        response = requests.post(
            f'{self.base_url}/analyze',
            headers=self.headers,
            json=payload
        )
        
        return response.json()

# Usage
client = VectorAI()
result = client.analyze_token('0x569Dd3298E114Da858415ee5672C8F2AB57938Bf')
print(f"VectorScore: {result['data']['vectorScore']['overall']}")

Advanced Example with Error Handling

import requests
import asyncio
import aiohttp
import logging
from typing import Dict, List, Optional

class VectorAIClient:
    def __init__(self, api_key: str, base_url: str = None):
        self.api_key = api_key
        self.base_url = base_url or 'https://api.vector-ai.pro/v1'
        self.session = None
        
        # Setup logging
        logging.basicConfig(level=logging.INFO)
        self.logger = logging.getLogger(__name__)
    
    async def __aenter__(self):
        self.session = aiohttp.ClientSession(
            headers={'Authorization': f'Bearer {self.api_key}'}
        )
        return self
    
    async def __aexit__(self, exc_type, exc_val, exc_tb):
        if self.session:
            await self.session.close()
    
    async def analyze_token(
        self, 
        address: str, 
        chain: str = 'ethereum',
        features: Optional[List[str]] = None,
        depth: str = 'standard'
    ) -> Dict:
        """Analyze a token asynchronously"""
        if features is None:
            features = ['security', 'market', 'social']
        
        payload = {
            'address': address,
            'chain': chain,
            'features': features,
            'depth': depth
        }
        
        try:
            async with self.session.post(
                f'{self.base_url}/analyze',
                json=payload
            ) as response:
                
                if response.status == 200:
                    result = await response.json()
                    self.logger.info(f"Analysis completed for {address}")
                    return result
                elif response.status == 429:
                    retry_after = int(response.headers.get('Retry-After', 60))
                    self.logger.warning(f"Rate limited. Retry after {retry_after} seconds")
                    await asyncio.sleep(retry_after)
                    return await self.analyze_token(address, chain, features, depth)
                else:
                    error_data = await response.json()
                    self.logger.error(f"API error: {error_data}")
                    return {'error': error_data}
                    
        except Exception as e:
            self.logger.error(f"Request failed: {str(e)}")
            return {'error': {'message': str(e)}}
    
    async def batch_analyze(self, tokens: List[Dict]) -> List[Dict]:
        """Analyze multiple tokens concurrently"""
        tasks = []
        for token in tokens:
            task = self.analyze_token(**token)
            tasks.append(task)
        
        results = await asyncio.gather(*tasks, return_exceptions=True)
        return results

# Usage Example
async def main():
    api_key = os.getenv('VECTOR_API_KEY')
    
    async with VectorAIClient(api_key) as client:
        # Single analysis
        result = await client.analyze_token(
            '0x569Dd3298E114Da858415ee5672C8F2AB57938Bf',
            chain='ethereum',
            features=['security', 'market', 'social'],
            depth='comprehensive'
        )
        
        print(f"Token: {result['data']['token']['name']}")
        print(f"Score: {result['data']['vectorScore']['overall']}")
        
        # Batch analysis
        tokens_to_analyze = [
            {'address': '0x...', 'chain': 'ethereum'},
            {'address': '0x...', 'chain': 'bsc'},
            {'address': '0x...', 'chain': 'polygon'}
        ]
        
        batch_results = await client.batch_analyze(tokens_to_analyze)
        for i, result in enumerate(batch_results):
            if 'error' not in result:
                print(f"Token {i+1}: {result['data']['vectorScore']['overall']}")

# Run the async example
if __name__ == "__main__":
    asyncio.run(main())

JavaScript Examples

Basic JavaScript Example

const axios = require('axios');

class VectorAI {
    constructor(apiKey) {
        this.apiKey = apiKey;
        this.baseURL = 'https://api.vector-ai.pro/v1';
        this.headers = {
            'Authorization': `Bearer ${apiKey}`,
            'Content-Type': 'application/json'
        };
    }
    
    async analyzeToken(address, chain = 'ethereum', features = null) {
        if (!features) {
            features = ['security', 'market', 'social'];
        }
        
        const payload = {
            address,
            chain,
            features
        };
        
        try {
            const response = await axios.post(
                `${this.baseURL}/analyze`,
                payload,
                { headers: this.headers }
            );
            
            return response.data;
        } catch (error) {
            if (error.response) {
                throw new Error(`API Error: ${error.response.data.error.message}`);
            } else {
                throw new Error(`Network Error: ${error.message}`);
            }
        }
    }
}

// Usage
const client = new VectorAI(process.env.VECTOR_API_KEY);

client.analyzeToken('0x569Dd3298E114Da858415ee5672C8F2AB57938Bf')
    .then(result => {
        console.log(`VectorScore: ${result.data.vectorScore.overall}`);
        console.log(`Grade: ${result.data.vectorScore.grade}`);
    })
    .catch(error => {
        console.error('Analysis failed:', error.message);
    });

Common Errors & Solutions

Authentication Errors

401 Unauthorized

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}

Solutions:

  • Verify API key is correct
  • Check Authorization header format
  • Ensure API key hasn't expired

403 Forbidden

{
  "error": {
    "code": "forbidden",
    "message": "Insufficient permissions for this endpoint"
  }
}

Solutions:

  • Upgrade API key tier
  • Request additional permissions
  • Check endpoint access requirements

Request Errors

400 Bad Request

{
  "error": {
    "code": "invalid_request",
    "message": "Invalid contract address format",
    "details": {
      "field": "address",
      "expected": "0x prefixed hex string"
    }
  }
}

Solutions:

  • Validate input parameters
  • Check required fields
  • Verify data types and formats

404 Not Found

{
  "error": {
    "code": "token_not_found",
    "message": "Token not found on specified chain"
  }
}

Solutions:

  • Verify contract address
  • Check chain parameter
  • Ensure token exists and is deployed

Rate Limiting

429 Too Many Requests

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded",
    "retry_after": 60
  }
}

Solutions:

  • Implement exponential backoff
  • Monitor rate limit headers
  • Upgrade to higher tier
  • Optimize request frequency

Server Errors

500 Internal Server Error

{
  "error": {
    "code": "internal_error",
    "message": "An internal error occurred",
    "request_id": "req_1234567890"
  }
}

Solutions:

  • Retry the request
  • Contact support with request_id
  • Check system status page
  • Implement fallback mechanisms

Best Practices

Error Handling

  • Always implement proper error handling
  • Use exponential backoff for retries
  • Log errors with request IDs
  • Provide meaningful error messages to users

Performance Optimization

  • Cache responses when appropriate
  • Use batch operations when available
  • Implement request queuing for high volume
  • Monitor API response times

Security

  • Never expose API keys in client-side code
  • Use environment variables for configuration
  • Implement proper access controls
  • Rotate API keys regularly

Rate Limit Management

  • Monitor usage against limits
  • Implement client-side rate limiting
  • Use webhooks for real-time updates
  • Upgrade tiers as needed

Support & Resources

Getting Help

Additional Resources

  • API Status: Real-time API health monitoring
  • Changelog: API updates and version history
  • SDKs: Official client libraries
  • Examples: Code samples and tutorials