Build

JavaScript + PHP = Real-time Stock Quote API

1 min readStephen Blum on Oct 30, 2013
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

How to build a real-time stock quote streaming application with PubNub using PHP and JavaScript

Have you ever wanted to build a stock quote app that updates in real time? Or more generally speaking, maybe you want to create an app that streams information and presents it on a real-time user interface on an HTML5 web browser. Well, it’s easy with PubNub.

We built a real-time stock streaming app with JavaScript, PHP, and PubNub to show you just how easy it is. You can check out the live working stock quote API demo, or go straight to the GitHub Repository to get started. We’ll supply the code you need.

stock quote APIThe app sends data from a PHP Server Process to an HTML5 JavaScript app in real-time. Stock quotes are broadcast from the PHP server into the PubNub network where the HTML5 JavaScript app receives the WebSockets data and displays it in real-time. A full stock quote API walk through is available here.

Note: Our data stream of stock prices is live data, but the numbers are randomized (so don’t make any financial decisions based on them.)

Get Started
Sign up for free and use PubNub to power real-time stock quotes

More from PubNub

Can Empathy Exist in the Metaverse
News May 16, 20221 min read

Can Empathy Exist in the Metaverse

A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.

PubNub Staff

PubNub Staff

How to Advance Telehealth and Virtual Care Technologies
News May 2, 20221 min read

How to Advance Telehealth and Virtual Care Technologies

Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...

PubNub Staff

PubNub Staff

Another Step Towards Data Security: ISO-27001 Implementation
BuildMay 2, 20221 min read

Another Step Towards Data Security: ISO-27001 Implementation

Today, we are glad to announce that we are currently in the process of implementing ISO-27001 security standards.

PubNub Staff

PubNub Staff