Which tier would you like to upgrade your app to?
Starter
$10/Mo
Premium
$40/Mo
Enterprise
See Details
Developer Logs
Filter by error
Create a new app
Hey it looks like you are trying to create a new app. You can create 5 apps per account. Any developer subscriptions do not transfer between applications unless you have special permission
Cancel
Yes, get started
Tell us about your app
Oh no, you already used this name
Create App
Choose a plan
You can choose on of our three developer plans. You can choose view them on our solutions page. Alternatively you can do this later.
Skip for now
Select a plan
Start Programming
We have collections of REST APIs and packages in all yoru favourite languages to make integrating our data into your system as seamless as possible. Check out our documentation to start right away.
Finish Up
See documentation
Security check
We can provide custom documentation for your configuration if you authenticate. We ask you to authenticate as we populate the documentation with your auth credentials.
Authenticate
I'll do it later
New App
Get stock data with our Websockets
Our websockets are an easy way to access our data via a data stream without overloading your servers with requests.
Websocket
Starter
Premium
Enterprise

You can use websockets to stream data into your system as it is calculated. Data is currently streamed in every hour - but work is in progress to reduce this to minutes. If you prefer to not make requests you should use the websocket server.

Websockets do not use up API calls - instead they use up websocket "connections" which is the number of stocks you can be subscribed to at any point in time. Starter apps can be subscribed to 5 stocks concurrently. Premium and enterprise apps can be subscribed to unlimited stocks concurrently under our fair use policy.

Below is a step-by-step guide to listening on our websockets. We will include an example written in Node Js to illustrate the concepts sequentially as these apply to any language.

The /stocks socket

You can access stocks data through our stocks socket. You can subscribe to various stocks and you will recieve data for these


Step 1 - connect
You can connect to Sentiment's websocket at the following base url.
ws://socket.sentimentinvestor.com/stocks
In Node Js this involves setting a socket connection to listen on this server, using an valid websocket library.
const WebSocket = require('ws');
const ws = new WebSocket('ws://socket.sentimentinvestor.com/stocks');
Step 2 - authenticate
The next step is to authenticate your connection to the websocket. You do this by pass 3 parameters into a stringified JSON object - your API Key and Token which are the same as for the http endpoints along with an array of stocks you would like to subscribe to. The array can be arbitrarily long provided it fits within your "connections" limit and conforms to our fair use policy.
{
"key": "" ,
"token": "",
"symbols":['TSLA', 'GME']
}
In Node Js we can see that would involve setting up an object and passing it on "connection open".
const auth = {
key: '' ,
token: '',
symbols:['TSLA', 'GME']
}

ws.on('open', function open() {
ws.send(JSON.stringify(auth));
});
Next we await the response object to see if the connection auth has been successful. The "authState" parameter should be set to true in the response body. If there is an issue you will receive a "authState" parameter set to false along with an error message. You can view our errors documentation to understand how to debug and handle errors better. Below is an example of a successful response:
//expected output as a JSON object
{
"authState":true,
"timestamp":1624931020465,
}

Step 3 - Listen and Manage

The last part of the process is to listen and maintain the connection. Your server may terminate the connection after an amount of time so to prevent this you need to reinstantiate it on the websocket "on-close" event.

As data becomes available for a stock that you are subscribed to, you will be sent messages through the socket connection.

The /all socket

You can access data about every stock through our all stocks socket. You receive data about every stock which makes it great for findata products.


Step 1 - connect
You can connect to Sentiment's websocket at the following base url.
ws://socket.sentimentinvestor.com/all
In Node Js this involves setting a socket connection to listen on this server, using an valid websocket library.
const WebSocket = require('ws');
const ws = new WebSocket('ws://socket.sentimentinvestor.com/all');
Step 2 - authenticate
The next step is to authenticate your connection to the websocket. You do this by pass 2 parameters into a stringified JSON object - your API Key and Token which are the same as for the http endpoints. Since you are listening to every stock you do not need to pass on an array of stocks.
{
"key": "" ,
"token": "",
}
In Node Js we can see that would involve setting up an object and passing it on "connection open".
const auth = {
key: '' ,
token: '',
}

ws.on('open', function open() {
ws.send(JSON.stringify(auth));
});
Next we await the response object to see if the connection auth has been successful. The "authState" parameter should be set to true in the response body. If there is an issue you will receive a "authState" parameter set to false along with an error message. You can view our errors documentation to understand how to debug and handle errors better. Below is an example of a successful response:
//expected output as a JSON object
{
"authState":true,
"timestamp":1624931020465,
}

Step 3 - Listen and Manage

The last part of the process is to listen and maintain the connection. Your server may terminate the connection after an amount of time so to prevent this you need to reinstantiate it on the websocket "on-close" event.

As data becomes available for a stock that you are subscribed to, you will be sent messages through the socket connection.