{"id":3387,"date":"2021-10-03T15:23:55","date_gmt":"2021-10-03T13:23:55","guid":{"rendered":"https:\/\/eodhd.com\/financial-apis\/?p=3387"},"modified":"2026-08-26T15:51:31","modified_gmt":"2026-08-26T13:51:31","slug":"new-real-time-data-api-websockets","status":"publish","type":"post","link":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets","title":{"rendered":"Real-Time Data API via Websockets"},"content":{"rendered":"\n<p class=\"docs-content__text wp-block-paragraph\">EODHD offers one of the best ways for investors, developers, and data analysts to incorporate real-time finance data for the stocks, 1100+ Forex pairs, 1000+ Digital Currencies into their decision-making projects with a delay of <strong>less than 50ms<\/strong> via WebSockets. For stocks our real-time data API supports <strong>pre-market and post-market hours<\/strong> (from 4 am to 8 pm ET; the session is computed in the America\/New_York timezone, so those clock times hold all year regardless of daylight saving).<\/p>\n\n\n    <div class=\"admonition admonition--info\">\n        <span class=\"admonition__icon\" aria-hidden=\"true\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" width=\"20\" height=\"20\"><path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\"\/><\/svg><\/span>\n        <div class=\"admonition__body\">\n\n<p class=\"docs-content__text wp-block-paragraph\">The subscription provides real-time access to prices for <strong>50 tickers simultaneously<\/strong> via WebSockets. Additionally, the 50-symbol limit can be increased through the <a href=\"https:\/\/eodhd.com\/cp\/dashboard#\">user dashboard<\/a>.<\/p>\n\n<\/div>\n    <\/div>\n    \n\n\n<p class=\"docs-content__text wp-block-paragraph\">For global markets and all exchanges around the world we also offer <a href=\"https:\/\/eodhd.com\/financial-apis\/live-realtime-stocks-api\/\">Live (Delayed) data<\/a> with 15min delay.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><!--TOC--><\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-what-is-websocket-protocol\">What is WebSocket protocol<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">WebSockets is a communication protocol that provides full-duplex communication channels over a single TCP connection. It enables real-time communication between a client and a server, allowing them to exchange messages continuously without the overhead of repeatedly establishing new connections. In the case of financial data providers, Websockets API provides real-time stock market information with minimal delay. <\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Because real-time WebSocket streaming is resource-intensive, it is offered on paid plans rather than a free tier.<\/p>\n\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-what-you-get-data-availability\">What you get (Data availability)<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Stocks<\/strong> (<a href=\"https:\/\/eodhd.com\/exchange\/US\">full list of tickers available<\/a>)<br>\u2022\u00a0<em>Trade<\/em>\u00a0stream (last price, size, conditions, etc.)<br>\u2022\u00a0<em>Quote<\/em>\u00a0stream (bid\/ask, sizes)<br>\u2022\u00a0Extended hours supported\u00a0(pre\u2011 and post\u2011market)<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>FOREX<\/strong> <a href=\"https:\/\/eodhd.com\/exchange\/FOREX\">(full list of available currency pairs)<\/a><br>\u2022 Bid\/ask + day change\/difference<br>\u2022 Tickers like&nbsp;EURUSD,&nbsp;AUDUSD, etc.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Digital Currencies <\/strong>(<a href=\"https:\/\/eodhd.com\/exchange\/CC\">Full list of available crypto pairs<\/a>)<br>\u2022 Last price, quantity, day change\/difference<br>\u2022 Tickers like&nbsp;ETH-USD,&nbsp;BTC-USD<br><br>Lists of available tickers and pairs for Real-Time feeds can be retrieved in JSON format via <a href=\"https:\/\/eodhd.com\/financial-apis\/exchanges-api-list-of-tickers-and-trading-hours\">this API endpoint<\/a>, providing the full list of exchange or asset class components (use&nbsp;&#8220;US&#8221;&nbsp;for US stocks,&nbsp;&#8220;CC&#8221;&nbsp;for cryptocurrencies,&nbsp;&#8220;FOREX&#8221;&nbsp;for currency pairs).<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><em>Demo access&nbsp;is available with API key&nbsp;&#8220;demo&#8221;&nbsp;for:&nbsp;AAPL,&nbsp;MSFT,&nbsp;TSLA,&nbsp;EURUSD,&nbsp;ETH-USD,&nbsp;BTC-USD.<\/em><\/p>\n\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-data-source\">Data source and what the data represents<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Real-time US and European equities are delivered directly from <strong>Cboe Global Cloud<\/strong>, our official exchange data source. Because this is a direct-from-exchange feed rather than an aggregated one, it is worth being precise about what it contains.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-source-us\">US equities<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">US trades and quotes come from <strong>Cboe EDGX<\/strong>, one of Cboe&#8217;s four US equity exchanges. Trades are executions that occurred on EDGX \u2014 this is not a consolidated (SIP) tape, so it does not include executions from other exchanges, or off-exchange and FINRA TRF prints. Quotes are the EDGX top of book with sizes, not a national best bid and offer aggregated across venues. Pre-market and post-market trades are delivered and flagged through the market status field.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">On a normal trading session the US stream carries about <strong>12,700 symbols<\/strong>. Measured over a longer window the count is slightly higher \u2014 around 13,100 across 21 trading days \u2014 because a symbol that does not print on a given day is simply absent from that day&#8217;s stream.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-source-eu\">European equities<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">European trades and quotes come from <strong>Cboe Europe<\/strong>, across its BXE, CXE and DXE order books, covering UK-listed names and continental large-caps over a single endpoint. Trading hours follow each instrument&#8217;s home venue, so the last trade for a symbol may lag once that venue enters its closing auction while quotes continue elsewhere.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Coverage spans <strong>18 European markets<\/strong> and about <strong>9,400 symbols<\/strong> on a normal session \u2014 London, XETRA, the Euronext venues, the Nordic exchanges, Madrid, Milan, Vienna and Warsaw among them. As with the US stream, a longer window gives a slightly higher count.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">European quotes differ from the US ones in one important way: they are a <strong>consolidated best bid and offer across all three books<\/strong>. The best price wins, and where two books show the same price their sizes are added, so the size you see is the depth available at that price across the venues we carry.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-updates-amp-latency\">Updates &amp; Latency<\/h2>\n\n\n\n<ul class=\"docs-content__list wp-block-list\">\n<li><strong>Streaming<\/strong>&nbsp;updates pushed in real time over a persistent WebSocket connection.<\/li>\n\n\n\n<li>Typical transport latency&nbsp;<strong>&lt; 50 ms<\/strong>&nbsp;from our gateway to your client (excluding network distance).<\/li>\n\n\n\n<li>Market status flag indicates\u00a0<strong>open<\/strong>,\u00a0<strong>closed<\/strong>, or\u00a0<strong>extended hours<\/strong>\u00a0for stocks.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-endpoints\">Endpoints<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Open connection &#8211; use&nbsp;<strong>wss:\/\/<\/strong>&nbsp;in production.&nbsp;<strong>ws:\/\/<\/strong>&nbsp;is available for local testing.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-equities-trades-and-quotes\">Equities (Trades and Quotes):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/us?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/us-quote?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-eu-endpoints\">European Equities (Trades and Quotes):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/eu?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/eu-quote?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-candles-endpoints\">Minute Bars (US and Europe):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/us-candles?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/eu-candles?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-status-endpoints\">Trading Status (US and Europe):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/us-status?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/eu-status?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-forex\"><br>Forex<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/forex?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-crypto\">Crypto<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/crypto?api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-subscribe-unsubscribe\">Subscribe \/ Unsubscribe<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">After the socket is open, send JSON commands.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Connection and status messages: on a successful connection the server first sends an authorization message. If you subscribe to a symbol your plan does not allow, for example a non-demo ticker on the demo key, the server replies with a status message instead of data.<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code class=\"language-json\">{\"status_code\": 200, \"message\": \"Authorized\"}\n{\"status_code\": 422, \"message\": \"Only limited symbols allowed for demo\"}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Subscribe:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"action\": \"subscribe\", \"symbols\": \"ETH-USD\"}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Multiple symbols (comma\u2011separated):<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"action\": \"subscribe\", \"symbols\": \"AAPL,TSLA\"}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Unsubscribe:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"action\": \"unsubscribe\", \"symbols\": \"ETH-USD,BTC-USD\"}<\/code><\/pre>\n<\/div>\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-response-schemas\">Response Schemas<\/h2>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-trades-endpoint-ws-us\">Trades (endpoint:\u00a0\/ws\/us):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"AAPL\",             \/\/ ticker\n\"p\": 309.19,             \/\/ last trade price\n\"c\": [],                 \/\/ trade conditions (array) - empty on this feed, see note\n\"v\": 2,                  \/\/ trade size (shares)\n\"dp\": false,             \/\/ dark pool flag - always false on this feed, see note\n\"ms\": \"extended-hours\",  \/\/ market status: open | closed | extended-hours\n\"t\": 1787671313868       \/\/ epoch ms, UTC\n}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Two fields need a word of explanation.<\/strong> The conditions field <strong>c<\/strong> is an array, and on this feed it is always empty: the exchange top-of-book source does not carry per-trade sale conditions. The field is kept so the message shape stays identical across all our equity streams. The dark-pool flag <strong>dp<\/strong> is always false, because this is a single lit-exchange feed with no off-exchange or FINRA TRF prints in it.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-quotes-endpoint-ws-us-quote\">Quotes (endpoint:\u00a0\/ws\/us-quote):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"AAPL\",         \/\/ ticker\n\"ap\": 317.297,       \/\/ ask price\n\"as\": 160,           \/\/ ask size\n\"bp\": 316.988,       \/\/ bid price\n\"bs\": 40,            \/\/ bid size\n\"t\": 1784115291977   \/\/ epoch ms\n}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-eu-schema\">European Equities (endpoints: \/ws\/eu and \/ws\/eu-quote):<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">European equities use exactly the same schemas as US equities \u2014 the trade stream matches \/ws\/us and the quote stream matches \/ws\/us-quote. Only the symbol format differs. Example trade message:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"GSK.LSE\",          \/\/ ticker (TICKER.EXCHANGE)\n\"p\": 1911,               \/\/ last trade price, in the venue's quoting units\n\"c\": [],                 \/\/ trade conditions (array) - empty on this feed\n\"v\": 155,                \/\/ trade size (shares)\n\"dp\": false,             \/\/ dark pool flag - always false on this feed\n\"ms\": \"open\",            \/\/ market status: open | closed\n\"t\": 1787671304945       \/\/ epoch ms, UTC\n}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Prices are JSON numbers and may arrive with no decimal part when the venue quotes in whole units, as above. Do not assume a fractional component.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-candles-schema\">Minute Bars (endpoints: \/ws\/us-candles and \/ws\/eu-candles):<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">A rolling one-minute OHLCV bar per subscribed symbol, built from the trade stream.<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"AAPL\",             \/\/ ticker\n\"i\": \"1m\",               \/\/ bar interval\n\"t\": 1787671260000,      \/\/ bar OPEN time, epoch ms UTC\n\"o\": 309.25,             \/\/ open\n\"h\": 309.26,             \/\/ high\n\"l\": 309.19,             \/\/ low\n\"c\": 309.19,             \/\/ close\n\"v\": 1101                \/\/ volume in shares, accumulated within the bar\n}<\/code><\/pre>\n<\/div>\n\n    <div class=\"admonition admonition--warning\">\n        <span class=\"admonition__icon\" aria-hidden=\"true\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" width=\"20\" height=\"20\"><path fill-rule=\"evenodd\" d=\"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625l6.28-10.875zM10 6a1 1 0 011 1v3a1 1 0 11-2 0V7a1 1 0 011-1zm0 8a1 1 0 100-2 1 1 0 000 2z\"\/><\/svg><\/span>\n        <div class=\"admonition__body\">\n\n<p class=\"docs-content__text wp-block-paragraph\">The field c means two different things depending on the stream: on the trade streams it is the conditions array, and on the minute-bar streams it is the bar close price. The current bar is also re-sent every time it changes, so the same bar-open timestamp arrives repeatedly with a growing volume until the minute rolls over. Treat the newest message for a given timestamp as authoritative rather than adding them together.<\/p>\n\n<\/div>\n    <\/div>\n    \n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-status-schema\">Trading Status (endpoints: \/ws\/us-status and \/ws\/eu-status):<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Trading-status and halt messages for a subscribed symbol. This is a separate stream from the market status field <strong>ms<\/strong> carried inside each trade: <strong>ms<\/strong> tells you which session the market is in, while this stream reports the venue&#8217;s own status for the individual instrument.<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"AAPL\",             \/\/ ticker\n\"h\": \"T\",                \/\/ trading status code from the venue\n\"r\": \"0\",                \/\/ status reason code\n\"t\": 1787731200000       \/\/ epoch ms, UTC\n}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">While an instrument is trading normally you will see the status <strong>T<\/strong>, with an empty reason on the European stream and <strong>0<\/strong> on the US one. Other codes are issued by the venue when an instrument is halted, paused or in an auction, and they are the venue&#8217;s own values rather than something we translate \u2014 so treat any status other than T as a signal to stop relying on the last price until it returns to T.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">As with the other streams, you receive one message per symbol immediately on subscribing, so you can read the current status without waiting for it to change.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-forex-endpoint-ws-forex\">FOREX (endpoint: \/ws\/forex):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"EURUSD\",       \/\/ symbol\n\"a\": 1.1419,         \/\/ ask\n\"b\": 1.1416,         \/\/ bid\n\"dc\": \"0.3005\",      \/\/ daily change, % (string)\n\"dd\": \"0.0034\",      \/\/ daily difference, price units (string)\n\"ppms\": true,        \/\/ pre\/post market status flag\n\"t\": 1784115288241   \/\/ epoch ms\n}<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-crypto-endpoint-ws-crypto\">Crypto (endpoint: \/ws\/crypto):<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n\"s\": \"ETH-USD\",       \/\/ symbol\n\"p\": \"1881.0931\",     \/\/ last price (string)\n\"q\": \"1.9e-7\",        \/\/ trade quantity (string, may use exponent notation)\n\"dc\": \"5.6041\",       \/\/ daily change, % (string)\n\"dd\": \"105.4177\",     \/\/ daily difference, price units (string)\n\"t\": 1784115286805    \/\/ epoch ms\n}<\/code><\/pre>\n<\/div>\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-symbol-limits-amp-usage-notes\">Symbol Limits &amp; Usage Notes<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Concurrent subscriptions: up to <strong>50 symbols per connection<\/strong> by default (upgradeable in user dashboard for extra fee).<br><br>Tickers:<\/p>\n\n\n\n<ul class=\"docs-content__list wp-block-list\">\n<li>US Stocks: use plain tickers like AAPL, MSFT \u2014 no exchange suffix<\/li>\n\n\n\n<li>European Stocks: use TICKER.EXCHANGE, e.g., GSK.LSE, SAP.XETRA, ASML.AS \u2014 the native Cboe symbol is accepted too<\/li>\n\n\n\n<li>Forex: no separator, e.g., EURUSD<\/li>\n\n\n\n<li>Crypto: dash\u2011separated, e.g., BTC-USD<\/li>\n<\/ul>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Resubscribe on reconnect: if the socket reconnects, re\u2011send your current subscriptions.<br>Compression\/Throughput: consider batching symbol lists in a single subscribe call for efficiency.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-silent-symbols\">Symbols that never arrive<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">A symbol that is unknown, or correct-looking but in the wrong format for the market, is <strong>accepted silently<\/strong> \u2014 no error is returned and the symbol simply never streams. If one symbol arrives and others stay quiet, check the format of the quiet ones first. The most common cause is an exchange suffix on a US ticker, or a missing one on a European ticker.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">One input mistake does produce an error: sending the symbols value as a JSON array instead of a comma-separated string is rejected with a 422.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-hyphen-limitation\">European tickers containing a hyphen<\/h3>\n\n\n    <div class=\"admonition admonition--warning\">\n        <span class=\"admonition__icon\" aria-hidden=\"true\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" width=\"20\" height=\"20\"><path fill-rule=\"evenodd\" d=\"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625l6.28-10.875zM10 6a1 1 0 011 1v3a1 1 0 11-2 0V7a1 1 0 011-1zm0 8a1 1 0 100-2 1 1 0 000 2z\"\/><\/svg><\/span>\n        <div class=\"admonition__body\">\n\n<p class=\"docs-content__text wp-block-paragraph\">European tickers that contain a hyphen \u2014 mostly Nordic dual-class shares such as ERIC-B.ST or NOVO-B.CO \u2014 work under their normal EODHD name. The un-hyphenated form, for example ERICB.ST, is also accepted as an alias, so client code written against either spelling keeps working. Whichever form you subscribe with, <strong>every message comes back carrying the canonical hyphenated ticker in the s field<\/strong> \u2014 subscribe to ERICB.ST and the data arrives as ERIC-B.ST. Key your state on the s value you receive rather than on the string you sent, or the two will not match. Note that some hyphenated tickers are not carried on the venues behind this feed at all and return nothing in either form.<\/p>\n\n<\/div>\n    <\/div>\n    \n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-connection-limits\">Connection limits<\/h3>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">You may hold up to <strong>64 concurrent connections per API token<\/strong>. That budget is shared across every market \u2014 trades, quotes, minute bars, forex and crypto sockets all count toward the same total. Opening one beyond it is refused with a 429 before the WebSocket opens.<\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Opening a separate connection per stream is expected and supported. The cap exists so one runaway client cannot degrade the feed for everyone, so if you legitimately need more, contact support rather than retrying in a loop.<\/p>\n\n\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text has-text-align-center wp-block-paragraph\"><a class=\"btn btn--orange\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Sign up &amp; Get Data<\/span><\/a><\/p>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-history\">Minute Bars over REST<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Closed one-minute bars for a single symbol are also available over plain HTTPS. This is the straightforward way to fill a gap after a dropped connection, rather than waiting for the streams to rebuild.<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">GET https:\/\/ws.eodhistoricaldata.com\/history?market=us&amp;symbol=AAPL&amp;api_token=YOUR_API_KEY<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">The response is a JSON array of closed bars, oldest first, in the same shape as the minute-bar streams:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">[\n  {\"s\":\"AAPL\",\"i\":\"1m\",\"t\":1787701620000,\"o\":309.32,\"h\":309.32,\"l\":309.31,\"c\":309.31,\"v\":223},\n  {\"s\":\"AAPL\",\"i\":\"1m\",\"t\":1787701680000,\"o\":309.31,\"h\":309.36,\"l\":309.29,\"c\":309.36,\"v\":418}\n]<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">The <strong>market<\/strong> parameter takes <strong>us<\/strong> or <strong>eu<\/strong>, and <strong>symbol<\/strong> takes the same form you would subscribe with. Only minutes in which the symbol actually traded produce a bar, so for a less active name the list is sparse rather than one bar per consecutive minute. Forex and crypto have no minute bars and return an empty array, as does an unknown market or symbol \u2014 this endpoint reports an empty result rather than an error for those.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-errors\">Errors and status codes<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Error frames come in two shapes, and the difference matters if you write one parser for both. An <strong>authentication<\/strong> failure uses the key <strong>status<\/strong>. Every other frame uses <strong>status_code<\/strong>.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-errors-auth\">Authentication, before the connection opens<\/h3>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"status\":422,\"message\":\"Server error\"}   \/\/ api_token missing\n{\"status\":403,\"message\":\"Server error\"}   \/\/ token not recognised, or no real-time entitlement<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">These are returned as the HTTP response to the handshake, so the WebSocket never opens and nothing arrives on the socket. Browsers deliberately hide the details of a failed WebSocket handshake, so a browser client sees only a generic connection error \u2014 to tell a missing token from an unentitled one, read the HTTP status from a server-side client.<\/p>\n\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-errors-open\">After the connection is open<\/h3>\n\n\n\n<figure class=\"docs-content__table-wrap wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Message<\/th><th>Cause<\/th><\/tr><\/thead><tbody><tr><td>404<\/td><td>No market &#8216;&#8230;&#8217; found<\/td><td>The endpoint path is not one of the markets listed above.<\/td><\/tr><tr><td>422<\/td><td>Invalid request<\/td><td>The command was not valid JSON.<\/td><\/tr><tr><td>422<\/td><td>action and symbols should be passed in a command<\/td><td>One of the two required keys is missing.<\/td><\/tr><tr><td>422<\/td><td>Action and symbols should be string<\/td><td>Wrong types \u2014 most often symbols sent as a JSON array instead of a comma-separated string.<\/td><\/tr><tr><td>422<\/td><td>Unknown action. Possible actions: subscribe, unsubscribe<\/td><td>The action value is not recognised.<\/td><\/tr><tr><td>422<\/td><td>Symbols limit reached<\/td><td>The subscription would exceed your plan&#8217;s symbol limit.<\/td><\/tr><tr><td>422<\/td><td>Only limited symbols allowed for demo<\/td><td>A demo token asked for a symbol outside the demo list.<\/td><\/tr><tr><td>429<\/td><td>Too many connections (token)<\/td><td>The 64-connection budget for this token is full.<\/td><\/tr><tr><td>500<\/td><td>Internal error. Try again later<\/td><td>Server-side failure.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-examples-copy-paste-ready\">Examples (copy\u2011paste ready)<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Open connection for trades:<\/strong><\/p>\n\n\n\n<ol class=\"docs-content__list docs-content__list--ordered wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/us?api_token=demo<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Then send:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"action\": \"subscribe\", \"symbols\": \"AMZN,TSLA\"}<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-\"><\/h3>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Open connection for Forex pairs:<\/strong><\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/forex?api_token=demo<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Then send:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"action\": \"subscribe\", \"symbols\": \"EURUSD,AUDUSD\"}<\/code><\/pre>\n<\/div>\n\n\n<h3 class=\"docs-content__heading docs-content__heading--h3 wp-block-heading\" id=\"h-\"><br><\/h3>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Open connection for Crypto:<\/strong><\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"\" class=\"\">wss:\/\/ws.eodhistoricaldata.com\/ws\/crypto?api_token=demo<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Then send:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">{\"action\": \"subscribe\", \"symbols\": \"ETH-USD,BTC-USD\"}<\/code><\/pre>\n<\/div>\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-tools-for-testing\">Tools for Testing<\/h2>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Chrome<\/strong>:&nbsp;<em><a href=\"https:\/\/chromewebstore.google.com\/detail\/simple-websocket-client\/gobngblklhkgmjhbpbdlkglbhhlafjnh?pli=1\">Simple WebSocket Client<\/a><\/em>&nbsp;extension (open a socket, paste open URL, send JSON quote).<br><\/p>\n\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>EODHD Chrome extension<\/strong>: free mini ticker window for live Stocks\/FX\/Crypto. Perfect to see our real-time data feed. No commands needed. <a href=\"https:\/\/chromewebstore.google.com\/detail\/eodhd-ticker-prices-stock\/kgnlncdmcpebnpigmbggeloheigdlboe\">Install from here.<\/a><br><\/p>\n\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><strong>Postman (or Insomnia) &#8211; point-and-click<\/strong>:<\/p>\n\n\n\n<ol class=\"docs-content__list docs-content__list--ordered wp-block-list\">\n<li>New \u2192&nbsp;WebSocket Request<\/li>\n\n\n\n<li>URL:&nbsp;wss:\/\/ws.eodhistoricaldata.com\/ws\/crypto?api_token=demo<\/li>\n\n\n\n<li>Connect \u2192 send: {&#8220;action&#8221;:&#8221;subscribe&#8221;,&#8221;symbols&#8221;:&#8221;BTC-USD&#8221;}<br><\/li>\n<\/ol>\n\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><br><strong>Python (minimal script):<\/strong><\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"python\" class=\"language-python\">import asyncio, websockets, json\n\nURL = \"wss:\/\/ws.eodhistoricaldata.com\/ws\/crypto?api_token=demo\"\nasync def main():\n    async with websockets.connect(URL) as ws:\n        await ws.send(json.dumps({\"action\":\"subscribe\",\"symbols\":\"BTC-USD\"}))\n        while True:\n            print(await ws.recv())\n\nasyncio.run(main())\n<\/code><\/pre>\n<\/div>\n\n\n<div style=\"height:31px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\"><br><strong>Mac Os Terminal &#8211; websocat (via Homebrew):<\/strong><\/p>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">Install websocat:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code class=\"\">brew install websocat<\/code><\/pre>\n<\/div>\n\n\n<p class=\"docs-content__text wp-block-paragraph\">One-liner command:<\/p>\n\n\n<div class=\"code-block\">\n<pre class=\"docs-content__code-block wp-block-code\"><code lang=\"json\" class=\"language-json\">printf '{\"action\":\"subscribe\",\"symbols\":\"BTC-USD\"}\\n' | \\\nwebsocat \"wss:\/\/ws.eodhistoricaldata.com\/ws\/crypto?api_token=demo\"<\/code><\/pre>\n<\/div>\n\n\n<div style=\"height:51px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"docs-content__heading docs-content__heading--h2 wp-block-heading\" id=\"h-quick-comparison-with-live-delayed-api-and-intraday-api\">Quick Comparison with Live (Delayed) API and Intraday API<\/h2>\n\n\n\n<figure class=\"docs-content__table-wrap wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Aspect<\/th><th><strong>Real-Time (WebSockets)<\/strong><\/th><th><strong><a href=\"https:\/\/eodhd.com\/financial-apis\/live-realtime-stocks-api\">Live (Delayed)<\/a><\/strong><\/th><th><strong><a href=\"https:\/\/eodhd.com\/financial-apis\/intraday-historical-data-api\">Intraday Historical<\/a><\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Transport<\/strong><\/td><td>WebSocket (push)<\/td><td>HTTPS REST (pull)<\/td><td>HTTPS REST (pull)<\/td><\/tr><tr><td><strong>Latency \/ Freshness<\/strong><\/td><td>~live (&lt;50 ms transport)<\/td><td>Stocks: 15\u201320 min delay; Currencies: ~1 min<\/td><td>Finalized ~2\u20133 h after US after-hours close<\/td><\/tr><tr><td><strong>Data types<\/strong><\/td><td>Trades &amp; quotes; FX ticks; crypto ticks<\/td><td>Latest OHLCV snapshot (1-min updates)<\/td><td>OHLCV bars at 1m \/ 5m \/ 1h<\/td><\/tr><tr><td><strong>Time ranges<\/strong><\/td><td>n\/a (streaming)<\/td><td>n\/a (snapshot feed)<\/td><td>1m: 120 d \u00b7 5m: 600 d \u00b7 1h: 7200 d<\/td><\/tr><tr><td><strong>Markets &amp; assets<\/strong>*<\/td><td><strong>US stocks<\/strong>&nbsp;(pre\/post supported),&nbsp;<strong>Forex &amp;  Digital Currencies<\/strong><\/td><td><strong>US &amp; Global Stocks<\/strong>,&nbsp;<strong>Forex &amp;  Digital Currencies<\/strong><\/td><td><strong>US &amp; Global Stocks<\/strong>,&nbsp;<strong>Forex &amp;  Digital Currencies<\/strong><\/td><\/tr><tr><td><strong>Best for<\/strong><\/td><td>Dashboards, signals, market-making tools<\/td><td>Quote tickers, watchlists, lightweight UIs<\/td><td>Backtests, analytics, charting<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"docs-content__text wp-block-paragraph\">* <a href=\"https:\/\/eodhd.com\/financial-apis\/covered-tickers-eodhd\">Get the full list of covered tickers.<\/a><\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n    <div class=\"spotlight spotlight--accent spotlight--wide\">\n        <div class=\"spotlight__content\">\n            \n                            <div class=\"spotlight__title\">Compare plans and find your fit<\/div>\n            \n                            <div class=\"spotlight__desc\">Free and paid plans for individual and commercial use<\/div>\n                    <\/div>\n\n                    <a class=\"spotlight__action btn btn--white\"\n               href=\"https:\/\/eodhd.com\/pricing\"\n               target=\"_blank\"\n               rel=\"noopener\">\n                Go to Pricing            <\/a>\n            <\/div>\n    \n\n\n\n","protected":false},"excerpt":{"rendered":"<p>EODHD offers one of the best ways for investors, developers, and data analysts to incorporate real-time finance data for the stocks, 1100+ Forex pairs, 1000+ Digital Currencies into their decision-making projects with a delay of less than 50ms via WebSockets. For stocks our real-time data API supports pre-market and post-market hours (from 4 am to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6519,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2],"tags":[],"class_list":["post-3387","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-historical-prices-live-data-apis"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.6 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Real-Time Stock, Forex &amp; Crypto Data API (WebSockets) | EODHD<\/title>\n<meta name=\"description\" content=\"Stream real-time stock, forex and crypto prices over WebSockets with under-50ms delay \u2014 1,100+ FX pairs and 1,000+ digital currencies.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Real-Time Data API via Websockets\" \/>\n<meta property=\"og:description\" content=\"Stream real-time stock, forex and crypto prices over WebSockets with under-50ms delay \u2014 1,100+ FX pairs and 1,000+ digital currencies.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\" \/>\n<meta property=\"og:site_name\" content=\"Stock Price Data, Financial and Stock Market API\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eodhistoricaldata\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-03T13:23:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-26T13:51:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png\" \/>\n\t<meta property=\"og:image:width\" content=\"270\" \/>\n\t<meta property=\"og:image:height\" content=\"270\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"EOD Historical Data Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:site\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"EOD Historical Data Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#article\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\"},\"author\":{\"name\":\"EOD Historical Data Support\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415\"},\"headline\":\"Real-Time Data API via Websockets\",\"datePublished\":\"2021-10-03T13:23:55+00:00\",\"dateModified\":\"2026-08-26T13:51:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\"},\"wordCount\":2186,\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png\",\"articleSection\":[\"1. Market Data APIs\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\",\"name\":\"Real-Time Stock, Forex & Crypto Data API (WebSockets) | EODHD\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png\",\"datePublished\":\"2021-10-03T13:23:55+00:00\",\"dateModified\":\"2026-08-26T13:51:31+00:00\",\"description\":\"Stream real-time stock, forex and crypto prices over WebSockets with under-50ms delay \u2014 1,100+ FX pairs and 1,000+ digital currencies.\",\"breadcrumb\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png\",\"width\":270,\"height\":270,\"caption\":\"Real-Time Data API WebSockets\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eodhd.com\/financial-apis\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Real-Time Data API via Websockets\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#website\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/\",\"name\":\"Historical Stock Prices and Fundamental Financial Data APIs | EODHD\",\"description\":\"End Of Day (EOD), Fundamental and Real-time\/Live Data Market API\",\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eodhd.com\/financial-apis\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\",\"name\":\"EODHD (EOD Historical Data)\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"width\":159,\"height\":82,\"caption\":\"EODHD (EOD Historical Data)\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/eodhistoricaldata\",\"https:\/\/x.com\/EOD_data\",\"https:\/\/www.reddit.com\/r\/EODHistoricalData\/\",\"https:\/\/eod-historical-data.medium.com\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415\",\"name\":\"EOD Historical Data Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g\",\"caption\":\"EOD Historical Data Support\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Real-Time Stock, Forex & Crypto Data API (WebSockets) | EODHD","description":"Stream real-time stock, forex and crypto prices over WebSockets with under-50ms delay \u2014 1,100+ FX pairs and 1,000+ digital currencies.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets","og_locale":"en_US","og_type":"article","og_title":"Real-Time Data API via Websockets","og_description":"Stream real-time stock, forex and crypto prices over WebSockets with under-50ms delay \u2014 1,100+ FX pairs and 1,000+ digital currencies.","og_url":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets","og_site_name":"Stock Price Data, Financial and Stock Market API","article_publisher":"https:\/\/www.facebook.com\/eodhistoricaldata","article_published_time":"2021-10-03T13:23:55+00:00","article_modified_time":"2026-08-26T13:51:31+00:00","og_image":[{"width":270,"height":270,"url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png","type":"image\/png"}],"author":"EOD Historical Data Support","twitter_card":"summary_large_image","twitter_creator":"@EOD_data","twitter_site":"@EOD_data","twitter_misc":{"Written by":"EOD Historical Data Support","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#article","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets"},"author":{"name":"EOD Historical Data Support","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415"},"headline":"Real-Time Data API via Websockets","datePublished":"2021-10-03T13:23:55+00:00","dateModified":"2026-08-26T13:51:31+00:00","mainEntityOfPage":{"@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets"},"wordCount":2186,"publisher":{"@id":"https:\/\/eodhd.com\/financial-apis\/#organization"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png","articleSection":["1. Market Data APIs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets","url":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets","name":"Real-Time Stock, Forex & Crypto Data API (WebSockets) | EODHD","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-apis\/#website"},"primaryImageOfPage":{"@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png","datePublished":"2021-10-03T13:23:55+00:00","dateModified":"2026-08-26T13:51:31+00:00","description":"Stream real-time stock, forex and crypto prices over WebSockets with under-50ms delay \u2014 1,100+ FX pairs and 1,000+ digital currencies.","breadcrumb":{"@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#primaryimage","url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png","contentUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png","width":270,"height":270,"caption":"Real-Time Data API WebSockets"},{"@type":"BreadcrumbList","@id":"https:\/\/eodhd.com\/financial-apis\/new-real-time-data-api-websockets#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eodhd.com\/financial-apis"},{"@type":"ListItem","position":2,"name":"Real-Time Data API via Websockets"}]},{"@type":"WebSite","@id":"https:\/\/eodhd.com\/financial-apis\/#website","url":"https:\/\/eodhd.com\/financial-apis\/","name":"Historical Stock Prices and Fundamental Financial Data APIs | EODHD","description":"End Of Day (EOD), Fundamental and Real-time\/Live Data Market API","publisher":{"@id":"https:\/\/eodhd.com\/financial-apis\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eodhd.com\/financial-apis\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eodhd.com\/financial-apis\/#organization","name":"EODHD (EOD Historical Data)","url":"https:\/\/eodhd.com\/financial-apis\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/","url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","contentUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","width":159,"height":82,"caption":"EODHD (EOD Historical Data)"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eodhistoricaldata","https:\/\/x.com\/EOD_data","https:\/\/www.reddit.com\/r\/EODHistoricalData\/","https:\/\/eod-historical-data.medium.com\/"]},{"@type":"Person","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415","name":"EOD Historical Data Support","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g","caption":"EOD Historical Data Support"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2021\/10\/Real-Time-Data-API-WebSockets.png","jetpack_shortlink":"https:\/\/wp.me\/p8NjB1-SD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/3387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/comments?post=3387"}],"version-history":[{"count":163,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/3387\/revisions"}],"predecessor-version":[{"id":8130,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/3387\/revisions\/8130"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/media\/6519"}],"wp:attachment":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/media?parent=3387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/categories?post=3387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/tags?post=3387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}