Market Data API Guides — Python, WebSocket & AI | TickDB Blog · Page 3

Choose a market data API, fetch quotes with Python and check historical data for backtests. Explore code examples, WebSocket reconnection guides and AI data workflows.

Moving a Hong Kong stock data API into Docker? Check the first quote after restart

Before moving a Hong Kong stock dashboard, alerting service, or risk monitor to Docker, what should count as recovery? In our local Tencent test, the first quote request returned HTTP 403. A later run returned a valid snapshot. The controlled restart command returned after 0.223 seconds, and the first quote passed validation after 1.580 seconds. It was still the previous session's quote. This article shows what to check on a weekend and what to verify again during trading.

TickDB Research ·

How to Test a US Stock Historical Data API for Stop-Loss and Take-Profit Backtests

Before buying minute data for a US stock strategy with stop-loss and take-profit exits, test whether the two levels first appear in separate bars. We reran the same check on one unadjusted session each for AAPL and NVDA. AAPL’s upper and lower levels first fell within the ranges at 09:30 and 09:41. Both NVDA levels fell inside the 09:30 bar. The worksheet and script help you identify which windows are worth checking at a finer resolution.

TickDB Research ·

How to Trial a China A-Share Market Data API Before Switching Your Intraday Screener

Before switching an intraday A-share screener to a new feed, start with your own stock list. All 300 CSI 300 constituents matched in our weekend snapshot and carried the expected quote date. Seven stocks outside the list had earlier quotes. Use the worksheet below to take the same check into a parallel intraday trial.

TickDB Research ·

Anthropic IPO: Add Tech Exposure? A U.S. Stock Minute Data API Replay

ANT’s first Nasdaq trade was 34.34% above the Anthropic IPO price. Did the tech holdings in your portfolio follow? Use TickDB’s U.S. stock minute data API to align QQQ and Nvidia with ANT’s first trade, mark a hypothetical $10,000 position and build a reusable event watchlist.

TickDB Research ·

How to Track Hong Kong Stock Buybacks with a Market Data API and Filings

How do you check a Hong Kong stock buyback announcement and calculate the change in shares in issue? Tencent's FY2025 disclosures show how to reconcile a buyback plan, actual repurchases, share cancellations and new issuance. Compare the market data API aggregate with HKEX filings, then use the share count reconciliation to explain why Tencent bought back 153.4 million shares but ended the year with 1.13% fewer issued shares.

TickDB Research ·

Crypto Market Data API or Trading API? Use a Feed for Prices, Not Orders

Does your crypto app need to show what the market is doing, or does it need to change something in an account? Use a market data API for the first job and a trading API for the second. The difference is visible in exchange API documentation: a ticker returns a market observation, while a new-order endpoint submits an instruction to the exchange.

TickDB Research ·

Trailing P/E (TTM): Financial Data API Guide to Adjusted Earnings and Peer Valuation

How do you calculate trailing P/E (TTM) for peer valuation without mixing earnings definitions? This financial data API research example combines dated market prices with official Cambricon and Hygon reports to compare reported and adjusted earnings—specifically, parent-attributable income excluding the reports' non-recurring items. The relative reference-multiple gap narrows from 10.33% to 6.34%. Includes a revenue-to-shareholder-earnings decomposition, an earnings sensitivity table and runnable Python.

TickDB Research ·

TradingView Chart Time Looks Wrong? Check the Timestamp Before the Feed

If a chart label disagrees with an API candle or a Pine label, start with one completed intraday bar. Compare the same open or close boundary in Unix milliseconds before deciding whether the mismatch comes from display formatting, timestamp units, session settings, or a different trading-day label.

TickDB Research ·

TTM Net Income from Financial Data APIs: Calculate It, Reconcile It, Check When It Was Available

A correct trailing twelve-month calculation can still be the wrong input for a research model. Use Cambricon's actual filings and a saved financial data API response to align reporting periods, distinguish parent-attributable from consolidated net income, and separate the reporting date from information availability. Includes a worked reconciliation, runnable Python, a checklist, and two explanatory figures.

TickDB Research ·

What Does XAUUSD Mean? Read a Gold Quote Without Assuming a Contract

XAUUSD commonly denotes gold quoted in US dollars per troy ounce. It tells you how to read a price, not how much gold an order represents or which contract you are buying. Separating the quote unit from quantity and product terms makes a simple ounce-to-gram conversion useful without turning it into an invented lot calculator.

TickDB Research ·

Choosing a Live Crypto Candlestick API: Verify the Open Bar Before Comparing Feeds

A live crypto chart needs the candle that is still forming, not just the latest trade price or a history of completed intervals. Before comparing feeds, verify current-bar updates, interval alignment, market scope, and the evidence used to confirm closure. A repeatable acceptance fixture should replace observations for the same candle, preserve uncertainty about finality, and keep cumulative volume from being counted again on every poll.

TickDB Research ·