@fin.cx/opendata
Version:
A comprehensive TypeScript library for accessing business data and real-time financial information. Features include German company data management with MongoDB integration, JSONL bulk processing, automated Handelsregister interactions, and real-time stoc
71 lines (70 loc) • 1.76 kB
TypeScript
export interface IStockPrice {
ticker: string;
price: number;
currency: string;
change: number;
changePercent: number;
previousClose: number;
timestamp: Date;
provider: string;
marketState: 'PRE' | 'REGULAR' | 'POST' | 'CLOSED';
exchange?: string;
exchangeName?: string;
volume?: number;
open?: number;
high?: number;
low?: number;
adjusted?: boolean;
dataType: 'eod' | 'intraday' | 'live';
fetchedAt: Date;
companyName?: string;
companyFullName?: string;
}
export interface IStockPriceError {
ticker: string;
error: string;
provider: string;
timestamp: Date;
}
export interface IPaginatedResponse<T> {
data: T[];
pagination: {
currentPage: number;
totalPages: number;
totalRecords: number;
hasMore: boolean;
limit: number;
offset: number;
};
}
export type TIntervalType = '1min' | '5min' | '10min' | '15min' | '30min' | '1hour';
export type TSortOrder = 'ASC' | 'DESC';
export interface IStockCurrentRequest {
type: 'current';
ticker: string;
exchange?: string;
}
export interface IStockHistoricalRequest {
type: 'historical';
ticker: string;
from: Date;
to: Date;
exchange?: string;
sort?: TSortOrder;
limit?: number;
offset?: number;
}
export interface IStockIntradayRequest {
type: 'intraday';
ticker: string;
interval: TIntervalType;
exchange?: string;
limit?: number;
date?: Date;
}
export interface IStockBatchCurrentRequest {
type: 'batch';
tickers: string[];
exchange?: string;
}
export type IStockDataRequest = IStockCurrentRequest | IStockHistoricalRequest | IStockIntradayRequest | IStockBatchCurrentRequest;