REST API

The Datafye REST API provides request-response access to market data and platform services. This API is designed for own-container scenarios where you run your own algorithmic trading containers and need to fetch data on demand.

See Also: For an overview of all available API mechanisms, see Data Access Modes. For how the REST API relates to datasets, see Data APIs and Datasets.

Base URL

The REST API base URL depends on your deployment model and where your containers are running:

Local (Standalone) Deployments

http://localhost:8080/datafye-api/v1/...

Cloud (Distributed) Deployments

Internal Access (containers running within the deployment):

http://api.rumi.local/datafye-api/v1/...

External Access (containers running remotely, if configured):

http://<user>-<type>-<env>-api.datafye.io/datafye-api/v1/...

Where:

  • <user> - The unique name assigned to you by Datafye (e.g., acme)

  • <type> - Deployment type: foundry or trading

  • <env> - Environment identifier (omit for production, or use dev, staging, etc.)

Examples: acme-foundry-api.datafye.io, acme-foundry-dev-api.datafye.io

External Access: External URLs are disabled by default and must be explicitly configured. Security is enforced through IP allowlisting (not API keys or credentials). For self-managed deployments, configure IP allowlisting in your cloud provider's infrastructure. For Datafye Managed deployments, contact your administrator. See API URLs and Security Model for complete details.

URL Format

All REST API endpoints follow this consistent structure (regardless of deployment model):

Where <base-url> is one of the base URLs listed above, and:

Asset Class

Currently supported asset classes:

  • stocks - Equity market data

  • crypto - Cryptocurrency market data (if configured)

Category

Data is organized into the following categories:

  • reference - Security master and reference data

  • live - Current/live market data snapshots

  • history - Historical market data

Path

The specific endpoint path varies by data type. For example:

  • /securities - Security master data

  • /trades/lasttrade - Last trade for a symbol

  • /quotes/topofbook - Top of book quote data

Common Request Patterns

Query Parameters

Most endpoints support common query parameters:

Dataset Selection:

The dataset parameter specifies which dataset to query when multiple datasets are deployed. See Data APIs and Datasets for details.

Symbol Filtering:

Time Filtering:

Pagination:

Request and Response Format

Request Headers

Required for requests with body content:

Optional:

Response Format

All API responses use JSON format with a consistent structure:

Successful Response

Error Response

HTTP Status Codes

The API uses standard HTTP status codes:

Success Codes:

  • 200 OK - Request successful

  • 201 Created - Resource created successfully

  • 204 No Content - Successful request with no response body

Client Error Codes:

  • 400 Bad Request - Invalid request parameters or malformed JSON

  • 404 Not Found - Resource or endpoint not found

  • 422 Unprocessable Entity - Request validation failed

Server Error Codes:

  • 500 Internal Server Error - Unexpected server error

  • 503 Service Unavailable - System temporarily unavailable

  • 504 Gateway Timeout - Request timeout

Available Endpoints

Health Checks

Monitor system health and availability:

Reference Data

Access security master and reference data:

Live Data

Query current market data snapshots:

Tick Data:

Aggregate Data:

Historical Data

Retrieve historical market data:

Rate Limiting

Datafye does not enforce explicit rate limits in private cloud deployments. However, follow these guidelines:

  • Design your application to handle backpressure gracefully

  • Use WebSocket subscriptions for real-time data instead of polling REST endpoints

  • Batch requests when fetching data for multiple symbols

  • Cache security master data locally to minimize reference data requests

Best Practices

Error Handling

Always implement proper error handling:

Connection Pooling

For high-frequency requests, use HTTP connection pooling:

Timeouts

Always set appropriate timeouts:

Examples

Fetching Security Master

Local deployment:

Cloud deployment (internal access):

Cloud deployment (external access):

Getting Last Trade for Multiple Symbols

Local deployment:

Cloud deployment (internal access):

Cloud deployment (external access):

Fetching Historical OHLCs

Local deployment:

Cloud deployment (internal access):

Cloud deployment (external access):


Last updated: 2025-10-14

Last updated