Build A Stock Quote SMS Bot with Twilio and TypeScript

Build A Stock Quote SMS Bot with Twilio and TypeScript

Twilio posts cloud communications trends, customer stories, and tips for building scalable voice and SMS applications with Twilio's APIs. Build A Stock Quote SMS Bot with Twilio and TypeScript. Node.js application with TypeScript, using Express, the Twilio Node package, and the Finnhub API.

We've seen  how to send an SMS with TypeScript and  how to receive and reply to SMS messages with TypeScript. Now let's create something we could use! If you're into investing, you can never have too many ways to check in on the stock market, so let's build an application you can send a stock symbol to and get back a stock quote.

In this post we will build a Node.js application with  TypeScript, using  Express, the  Twilio Node package, and the  Finnhub API to reply to incoming SMS messages with stock quotes.

What you will need

To build the application in this post you will need:

  • A Twilio account (if you don't have one yet,  sign up for a free Twilio account here and receive $10 credit when you upgrade)
  • A  Twilio phone number that can send and receive SMS messages
  • Node.js installed
  • ngrok so that you can  respond to webhooks in your local development environment
  • A  Finnhub API key (you can  register for a free Finnhub API key here)

With that prepared, let's get building.

A running start

In the  blog post on receiving and responding to SMS messages in TypeScript we built a good base for this application which we will work from. If you haven't followed that post, you can get up to speed quickly. First, download or clone this  repo of Twilio TypeScript examples and change into the receive-sms directory:

git clone
cd twilio-typescript-examples/receive-sms

Install the dependencies:

npm install

Compile the TypeScript:

npm run build

Start the server:

npm start

code typescript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Static Code Analysis: What It Is? How to Use It?

Static code analysis is a method of debugging by examining source code before a program is run. It's done by analyzing a set of code against a set (or multiple sets) of coding rules. Static code analysis and static analysis are often used interchangeably, along with source code analysis.

How to Find the Stinky Parts of Your Code (Part II)

There are more code smells. Let’s keep changing the aromas. We see several symptoms and situations that make us doubt the quality of our development. Let's look at some possible solutions.

Let's Talk About Selling Your Code

In this video, I'll be talking about when do I think code is ready to be sold. 🔴 Subscribe for more

Softagram - Making Code Reviews Humane

The story of Softagram is a long one and has many twists. Everything started in a small company long time ago, from the area of static analysis tools development. After many phases, Softagram is focusing on helping developers to get visual feedback on the code change: how is the software design evolving in the pull request under review.

Embold Is Like Autocorrect For Code, Says Vishal Rai, Founder & CEO

We, at Analytics India Magazine, spoke to founder and CEO, Vishal Rai, to understand how Embold can detect anti-patterns in code for seamless integration. Embold started a decade ago, with the vision of creating a product that can revolutionise the way developers write and design code.