VaultCharts

Can I Use My Own API or Data Provider?

VaultCharts supports advanced API configurations, allowing you to connect to any REST API with custom authentication, headers, parsing logic, and data normalization to OHLCV format.

Getting StartedCustom APIsData IntegrationREST APIData Configuration

Short Answer

Yes. VaultCharts supports advanced API configurations that allow you to connect to any REST API, use custom authentication, define custom parsing logic, and normalize data to OHLCV format. This makes VaultCharts suitable for quantitative research, institutional workflows, and proprietary data sources.

Detailed Explanation

Why Custom APIs Matter

While templates cover popular providers, custom APIs enable:

  • Proprietary data sources: Your own research data or institutional feeds
  • Specialized providers: Niche data sources not covered by templates
  • Custom requirements: Specific data formats or authentication methods
  • Enterprise integration: Connect to internal systems and databases
  • Advanced use cases: Quantitative research and backtesting

What You Can Configure

1. API Endpoint

Configure:

  • Base URL
  • Endpoint paths
  • Query parameters
  • Path parameters
  • Dynamic URL construction

2. Authentication

Support for:

  • API Keys: Header-based or query parameter
  • Bearer Tokens: OAuth 2.0 and similar
  • Basic Auth: Username/password
  • Custom Headers: Any authentication method
  • Token Refresh: Automatic token renewal

3. Request Configuration

Set up:

  • HTTP method (GET, POST, etc.)
  • Request headers
  • Query parameters
  • Request body (for POST)
  • Timeout settings

4. Data Parsing

Define:

  • Response format (JSON, CSV, XML)
  • Data extraction logic
  • Field mapping to OHLCV
  • Timezone handling
  • Data validation

5. Pagination

Handle:

  • Cursor-based pagination
  • Offset/limit pagination
  • Page-based pagination
  • Custom pagination logic

6. Rate Limiting

Configure:

  • Request rate limits
  • Retry logic
  • Backoff strategies
  • Error handling

Step-by-Step Setup

Step 1: Create Dataflow

  1. Open data import dialog
  2. Select "Custom API"
  3. Choose "Create New Dataflow"
  4. Name your dataflow

Step 2: Configure Endpoint

  1. Enter base URL
  2. Set endpoint path
  3. Configure query parameters
  4. Test endpoint connection

Step 3: Set Authentication

  1. Choose authentication type
  2. Enter credentials
  3. Configure token refresh (if needed)
  4. Test authentication

Step 4: Define Parsing

  1. Specify response format
  2. Map fields to OHLCV
  3. Configure timestamp parsing
  4. Set timezone

Step 5: Configure Symbol Format

  1. Define symbol format
  2. Set symbol parameter name
  3. Configure symbol transformation
  4. Test with sample symbol

Step 6: Set Timeframe

  1. Define timeframe parameter
  2. Map to provider format
  3. Configure timeframe conversion
  4. Test different timeframes

Step 7: Test and Save

  1. Test with sample symbol
  2. Verify data format
  3. Check data accuracy
  4. Save configuration

Common Use Cases

1. Proprietary Data Sources

Connect to:

  • Internal databases
  • Research datasets
  • Proprietary feeds
  • Custom data warehouses

2. Specialized Providers

Integrate:

  • Niche data providers
  • Regional exchanges
  • Alternative data sources
  • Custom market data

3. Quantitative Research

Use for:

  • Backtesting with historical data
  • Strategy development
  • Research analysis
  • Data validation

4. Institutional Workflows

Enterprise features:

  • Internal system integration
  • Secure data access
  • Custom authentication
  • Compliance requirements

Data Format Requirements

OHLCV Format

Your API should return data in OHLCV format:

{
  "timestamp": 1234567890,
  "open": 50000.00,
  "high": 51000.00,
  "low": 49000.00,
  "close": 50500.00,
  "volume": 1234.56
}

Supported Formats

  • JSON: Most common, flexible
  • CSV: Simple, efficient
  • XML: Less common, supported
  • Custom: Define parsing logic

Timestamp Handling

VaultCharts supports:

  • Unix timestamps (seconds or milliseconds)
  • ISO 8601 format
  • Custom date formats
  • Timezone conversion

Advanced Configuration

Custom Headers

Add custom headers for:

  • Authentication tokens
  • API versioning
  • Custom metadata
  • Provider-specific requirements

Query Parameters

Configure:

  • Symbol parameter
  • Timeframe parameter
  • Date range parameters
  • Custom filters

Error Handling

Set up:

  • Retry logic
  • Error messages
  • Fallback strategies
  • Connection timeouts

Data Validation

Validate:

  • Required fields
  • Data types
  • Value ranges
  • Timestamp validity

Best Practices

1. Start Simple

  • Begin with basic configuration
  • Test with one symbol
  • Verify data accuracy
  • Then expand

2. Document Configuration

  • Keep notes on API details
  • Document authentication
  • Record parsing logic
  • Save test results

3. Handle Errors

  • Implement retry logic
  • Handle rate limits
  • Manage timeouts
  • Log errors

4. Optimize Performance

  • Cache responses when possible
  • Minimize API calls
  • Use appropriate timeframes
  • Batch requests if supported

5. Test Thoroughly

  • Test with multiple symbols
  • Verify different timeframes
  • Check historical data
  • Validate real-time updates

Security Considerations

API Key Management

  • Store keys securely
  • Use environment variables
  • Rotate keys regularly
  • Limit key permissions

Data Privacy

  • Understand data usage
  • Comply with terms of service
  • Protect sensitive data
  • Monitor API access

Network Security

  • Use HTTPS
  • Verify SSL certificates
  • Secure connections
  • Monitor network traffic

Troubleshooting

Common Issues

Connection Errors

  • Check endpoint URL
  • Verify network connectivity
  • Test authentication
  • Review error messages

Parsing Errors

  • Verify data format
  • Check field mapping
  • Validate timestamps
  • Review parsing logic

Rate Limiting

  • Adjust request frequency
  • Implement backoff
  • Check API limits
  • Contact provider

Comparison: Custom API vs. Templates

FeatureCustom APITemplates
Setup complexityHighLow
FlexibilityMaximumLimited
MaintenanceManualAutomatic
Best forAdvanced usersQuick start
CustomizationFull controlPre-configured

Related Articles

Related Articles