Knowledge Hub
Learn to build with market data
Guides, tutorials and explainers for stocks, forex, crypto and every market in between. Each one comes with code you can run on a TickerLayer key.
- 50 articles
- 10 topics
- Python and JavaScript
WebSocket vs REST API: which to use for real-time data
REST asks, a WebSocket listens. For market data the choice is mostly arithmetic: count the requests polling would cost you, and the seconds of staleness it would add.Stock market hours: regular, pre-market and after-hours times by time zone
Nine-thirty to four, Eastern, is the easy part. The bugs live at the edges: a 1 p.m. close the day after Thanksgiving, three weeks every March when London and New York sit four hours apart, and a clock in Phoenix that never moves.Start with TickerLayer
Keys, requests, streams and the habits that keep an integration healthy.
How to get stock prices in Python: real-time and historical
Scraping libraries break the week you come to depend on them. A key-based REST API, `requests` and `pandas` give you prices you can fetch again tomorrow and get the same answer.WebSocket market data: stream stocks, forex and crypto in real time
One socket, one JSON subscribe message, every asset class. The bugs live in the parts most docs skim: the ready frame, the snapshot, prices sent as strings and the close code.Exchange calendar API: check if a market is open, in code
Market hours look like a constant until the first half day, lunch break or clock change. Put the calendar behind one request and let your code ask.Market data APIs
What each kind of market data is, how it is served, and how to choose.
Stock API guide: real-time and historical stock prices, with code
Most stock APIs are a US ticker list with a price attached. A useful one also tells you which market a symbol trades in, what time each price is from, and which close a daily bar carries.Exchange rate API: live and historical FX rates, with code
Converting currencies is a three-line problem until someone asks which rate, taken when, from whom. Answer those first and the code stays small.Crypto price API: aggregated real-time prices, bars and streams
Bitcoin does not have one price. It has hundreds, one per venue and quote currency, and the API you pick decides which of them your users see.Gold price API: live XAU, silver and precious metals prices
Fetching the price of gold takes one request. Knowing which gold, in which unit and as of which millisecond is what decides whether your app is right.Indices API: real-time index levels for US500, US100, DE40 and JP225
An index is a formula, not an order book. A useful indices API tells you which formula sits behind each code, when the number moves, and which fields not to over-read.ETF API: real-time and historical ETF prices for developers
Fetching an ETF price is the easy part. Knowing which number you hold, a quote, a trade, a bar or the fund's own NAV, is what keeps an ETF screen honest.Build something
Working projects, from a price alert bot to a live chart, with every line of code.
Candlestick chart in JavaScript with Lightweight Charts and live data
Most candlestick tutorials stop at a static CSV. A chart people watch needs history for context and a last candle that moves, and the join between the two is where the bugs are.Python WebSocket client: stream live market prices with asyncio
Most Python WebSocket tutorials talk to an echo server. This one streams real quotes and trades, survives a dropped connection and leaves you a CSV file that pandas can read.Live stock and crypto prices in Google Sheets, beyond GOOGLEFINANCE
GOOGLEFINANCE is fine for a casual watchlist. The moment you need a bid, a crypto pair, a non-US listing or a number your code also sees, about a hundred lines of Apps Script do the job better.Build a stock and crypto price alert bot for Discord and Telegram
Most alert bots poll a price every few seconds and spam the channel at the open. This one listens to a stream, knows when the market is shut, and posts each alert once, to Discord, Telegram or both.Python trading bot for crypto: from live WebSocket data to signals
Most bot tutorials are an exchange SDK plus a moving average. The parts that decide whether a bot survives are elsewhere: clean bars, honest fills, position sizing, and a kill switch you trust.Next.js WebSocket tutorial: build a real-time market dashboard
The fastest way to leak a market-data key is to open the WebSocket from the browser. Keep one socket on the server, fan it out, and the key never leaves your machine.How markets work
The market mechanics behind the numbers, drawn instead of described.
Bid-ask spread explained: bid, ask, mid price and spread in bps
Every quote is two prices. The gap between them is the cheapest signal of liquidity you will ever get, and most dashboards throw it away.What is a pip in forex? Pip value, pipettes and a calculator
A pip is the smallest move most traders bother to name. Its size per pair, and what it is worth in your own currency, is nearly all the arithmetic forex asks of you.OHLC and OHLCV explained: how price bars are built from ticks
A bar is a lossy summary of every trade in a window. Knowing exactly what it keeps and what it throws away is the difference between a chart and a bug.VWAP explained: formula, calculation and Python code on live data
VWAP is the price the whole market actually paid today. Computing it is one division; computing the same number your broker shows means getting the session, the bars and the volume right.Trading halts explained: LULD pauses, circuit breakers and halt reasons
A halt is the market saying the price cannot be trusted right now. Most apps find out when the quotes stop moving. You can find out from the event itself.After-hours and pre-market trading: times, risks and data
The stock market does not stop at the closing bell: it just empties out. Extended hours are where earnings land, where spreads widen, and where a price on your screen may not survive the open.Browse by market
- StocksQuotes, trades and bars across 20 markets30
- ForexExchange rates, spreads and sessions15
- CryptoRound-the-clock prices and trade tapes24
- IndicesBenchmark levels from US500 to JP2258
- ETFsFund prices next to the markets they track6
- CommoditiesGold, silver, oil and farm markets7
- BondsGovernment yield curves, tenor by tenor1
- PerpetualsContracts that trade through the weekend5
- AI agentsMCP, pay-per-call and agent workflows4
- PlatformREST, WebSocket and the patterns around them11
Every article
50 articles, page 1 of 5
Perpetual futures explained: funding rate, mark price and index price
A perpetual is a futures contract that never expires, held near its underlying by a payment between traders. It now prices stocks, indices and gold through the weekend, which makes it useful data long before it is a trade.VWAP explained: formula, calculation and Python code on live data
VWAP is the price the whole market actually paid today. Computing it is one division; computing the same number your broker shows means getting the session, the bars and the volume right.Python trading bot for crypto: from live WebSocket data to signals
Most bot tutorials are an exchange SDK plus a moving average. The parts that decide whether a bot survives are elsewhere: clean bars, honest fills, position sizing, and a kill switch you trust.Bad ticks and stale prices: how to detect them in market data
Most bad data is not dramatic. It is a price that stopped moving an hour ago and still looks perfectly reasonable on a chart.Yield curve inversion: what it is and how to track it by API
An inverted curve is the bond market pricing short-term money above long-term money. It has an impressive record as a warning and a poor one as a timer.Trading halts explained: LULD pauses, circuit breakers and halt reasons
A halt is the market saying the price cannot be trusted right now. Most apps find out when the quotes stop moving. You can find out from the event itself.Financial data providers: how to choose one in 2026
Most buying guides are a wall of logos. The questions that decide whether a feed works for you are about licences, clocks and coverage, and you can answer all of them in a one-week trial.What is float in stocks? Float vs shares outstanding explained
Shares outstanding tells you how big a company is. The float tells you how much of it can actually change hands, and that is the number that moves prices.Exchange calendar API: check if a market is open, in code
Market hours look like a constant until the first half day, lunch break or clock change. Put the calendar behind one request and let your code ask.Next.js WebSocket tutorial: build a real-time market dashboard
The fastest way to leak a market-data key is to open the WebSocket from the browser. Keep one socket on the server, fan it out, and the key never leaves your machine.Build an AI trading bot with live market data and guardrails
A language model is good at reading a market and bad at knowing what time it is. So let it propose, and let a hundred lines of boring Python decide.Contango and backwardation: futures curves, roll yield and commodity ETFs
The slope of a futures curve decides whether holding a commodity quietly pays you or quietly costs you. Most commodity ETF surprises start here.After-hours and pre-market trading: times, risks and data
The stock market does not stop at the closing bell: it just empties out. Extended hours are where earnings land, where spreads widen, and where a price on your screen may not survive the open.What is x402? HTTP 402 payments for APIs and AI agents
HTTP reserved status 402 for payments decades ago and then left it empty. x402 finally gives it a job: letting software pay for exactly one request, with no account in between.Correlation matrix in Python for stocks, FX, gold and crypto
The corr() call is one line. The three things that decide whether the number means anything come before it: returns instead of prices, aligned calendars, and knowing when each market closed.Build a stock and crypto price alert bot for Discord and Telegram
Most alert bots poll a price every few seconds and spam the channel at the open. This one listens to a stream, knows when the market is shut, and posts each alert once, to Discord, Telegram or both.WebSocket reconnect: heartbeats, backoff and close codes in production
Reconnecting is one line of code. Reconnecting without a thundering herd, a silent half-open socket or a client that falls further behind every minute takes about a hundred.Live stock prices in Excel with Power Query and an API
The Stocks data type is great for a glance and awkward as a foundation. Power Query can call a real API with a header key, refresh on a timer, and put bid, ask, FX, crypto and history into ordinary tables.Claude MCP setup: connect Claude to real-time market data
The setup takes a minute. The interesting part is what Claude does with the data afterwards, especially when the market you ask about closed hours ago.Financial MCP server: give AI agents live market data
A model that guesses a price is worse than one that admits it doesn't know. MCP lets it ask instead, and the way the tools are designed decides whether it asks well.ETF vs index fund: key differences, costs and what the price data shows
Most of the difference is plumbing: when you can trade, and at what price. Price data makes the plumbing visible.ETF API: real-time and historical ETF prices for developers
Fetching an ETF price is the easy part. Knowing which number you hold, a quote, a trade, a bar or the fund's own NAV, is what keeps an ETF screen honest.Live stock and crypto prices in Google Sheets, beyond GOOGLEFINANCE
GOOGLEFINANCE is fine for a casual watchlist. The moment you need a bid, a crypto pair, a non-US listing or a number your code also sees, about a hundred lines of Apps Script do the job better.What is a stock index? Price-weighted vs cap-weighted, with US30 and US500
An index is a recipe, not a price. Change the recipe and the same five stocks tell a different story, as the numbers below show.Indices API: real-time index levels for US500, US100, DE40 and JP225
An index is a formula, not an order book. A useful indices API tells you which formula sits behind each code, when the number moves, and which fields not to over-read.Free stock API: what free tiers really include, and their limits
Every free tier is a trade. The provider gives you data, and the limits decide what you are allowed to build with it, so read them before you write the integration.RSI indicator: formula, Wilder smoothing and Python code
The relative strength index is fourteen days of arithmetic that most people use without ever checking. Do it once by hand and the usual bugs stop being mysterious.Golden cross and death cross: definition, examples and a Python backtest
The most quoted signal in technical analysis, tested on ten years of index data. It did one job well and paid for it everywhere else.429 Too Many Requests: handle API rate limits with retries that work
A 429 is the politest error on the web: the server tells you what went wrong and, often, exactly how long to wait. Most clients ignore both halves of the message.WTI vs Brent: the two oil benchmarks compared
Two light, sweet crudes, two delivery points, and one spread that moves on pipelines, tankers and the contract calendar.Oil price API: WTI, Brent and natural gas prices in JSON
An oil price is a futures market wearing a spot price’s clothes. Know the benchmark, the unit and the contract calendar behind a number before you chart it.What is a troy ounce? Gold, silver and commodity price units explained
Every commodity price quietly assumes a unit. Get it wrong and a chart is off by 9.7%, or by a factor of a hundred.Gold price API: live XAU, silver and precious metals prices
Fetching the price of gold takes one request. Knowing which gold, in which unit and as of which millisecond is what decides whether your app is right.Candlestick chart in JavaScript with Lightweight Charts and live data
Most candlestick tutorials stop at a static CSV. A chart people watch needs history for context and a last candle that moves, and the join between the two is where the bugs are.Python WebSocket client: stream live market prices with asyncio
Most Python WebSocket tutorials talk to an echo server. This one streams real quotes and trades, survives a dropped connection and leaves you a CSV file that pandas can read.WebSocket vs REST API: which to use for real-time data
REST asks, a WebSocket listens. For market data the choice is mostly arithmetic: count the requests polling would cost you, and the seconds of staleness it would add.Forex market hours: sessions, overlaps and the best time to trade
Forex never closes on a weekday, but it is not the same market at 03:00 and at 14:00 UTC. Liquidity follows the sun from Sydney to New York, and the best hours are the ones when two financial centres are awake at once.Stock market hours: regular, pre-market and after-hours times by time zone
Nine-thirty to four, Eastern, is the easy part. The bugs live at the edges: a 1 p.m. close the day after Thanksgiving, three weeks every March when London and New York sit four hours apart, and a clock in Phoenix that never moves.Historical stock data: OHLC bars, adjustments and intraday history by API
A price history looks like a simple table until you ask which close, which session and which time zone. Get those three wrong and a backtest lies to you politely.What is a ticker symbol? Stock, FX, crypto and futures symbol formats
A ticker names a listing, not a company. Hold on to that one idea and numeric Tokyo codes, share-class dots and six-letter currency pairs all start to make sense.Unix timestamps in milliseconds: convert, compare and avoid time-zone bugs
Thirteen digits, no time zone, no ambiguity. Almost every timestamp bug happens after the parse: in the unit you assumed, the zone you forgot, or the event you thought it marked.Crypto price API: aggregated real-time prices, bars and streams
Bitcoin does not have one price. It has hundreds, one per venue and quote currency, and the API you pick decides which of them your users see.What is a pip in forex? Pip value, pipettes and a calculator
A pip is the smallest move most traders bother to name. Its size per pair, and what it is worth in your own currency, is nearly all the arithmetic forex asks of you.Exchange rate API: live and historical FX rates, with code
Converting currencies is a three-line problem until someone asks which rate, taken when, from whom. Answer those first and the code stays small.Stock API guide: real-time and historical stock prices, with code
Most stock APIs are a US ticker list with a price attached. A useful one also tells you which market a symbol trades in, what time each price is from, and which close a daily bar carries.OHLC and OHLCV explained: how price bars are built from ticks
A bar is a lossy summary of every trade in a window. Knowing exactly what it keeps and what it throws away is the difference between a chart and a bug.Bid-ask spread explained: bid, ask, mid price and spread in bps
Every quote is two prices. The gap between them is the cheapest signal of liquidity you will ever get, and most dashboards throw it away.How to get stock prices in Python: real-time and historical
Scraping libraries break the week you come to depend on them. A key-based REST API, `requests` and `pandas` give you prices you can fetch again tomorrow and get the same answer.WebSocket market data: stream stocks, forex and crypto in real time
One socket, one JSON subscribe message, every asset class. The bugs live in the parts most docs skim: the ready frame, the snapshot, prices sent as strings and the close code.Market data API explained: REST, WebSocket, symbols and timestamps
Endpoints are the easy part. The bugs live in four quieter decisions every provider makes for you: what a symbol means, which unit a price is in, which clock a timestamp reads, and how often you may ask.Ready to integrate?
Start with the free tier, explore the docs, and connect via REST or WebSocket in minutes.