1. IEX API - kostmits83/m102 GitHub Wiki
Application programming interface (API)
is a set communication protocols and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer.
An API may be for a web-based system or operating system, database system, computer hardware or software library.
APIs as a way to serve your customers You’ve probably heard of companies packaging APIs as products. For example, Weather Underground sells access to its weather data API.
Example scenario: Your small business’s website has a form used to sign clients up for appointments. You want to give your clients the ability to automatically create a Google calendar event with the details for that appointment.
API use: The idea is to have your website’s server talk directly to Google’s server with a request to create an event with the given details. Your server would then receive Google’s response, process it, and send back relevant information to the browser, such as a confirmation message to the user.
Alternatively, your browser can often send an API request directly to Google’s server bypassing your server.
We chose a web API for stock markets and exchange. - IEX API
1) IEX API
is a free and reliable set of services designed for developers and engineers that are functioning and surrounding the IEX stock exchange (For further explanation how the stock market works see www.iextrading.com). The API can be used to build both high-quality or prototype application and services.
Features of IEX API
-
Active-Active Multiple copies of every IEX server to ensure high availability and to protect against regional failures.
-
Redundant 5 datacenters with multiple DNS providers.
-
Auto-Scaling Scaling of servers on-demand based on custom metrics.
Performance measures
-
99.981% web uptime.
-
100% database uptime.
-
3.5 million messages per second peak & Data loss protection
-
262 TB data transfered per month
-
RegSCI System that regulates the API for the highest level of integrity, resiliancy, and security.
-
Google Cloud. High performance, scale, and reliability ensured by Google, LLC.
-
We developed and patented multiple ways to ensure data integrity.
-
1.1 trillion database records with 72 TB database size
-
600,000 queries per second peak
-
Redis caching: 180 K average operations per second
-
10.51 B operations per day
More about IEX API at www.IEXtrading.com/Developer/.
1.1) Getting started
Authentication
The IEX API is currently open and does not require authentication to access its data.
Endpoints
All endpoints are prefixed with: https://api.iextrading.com/1.0 We support JSONP for all endpoints.
SSL
We provide a valid, signed certificate for our API methods. Be sure your connection library supports HTTPS with the SNI extension.
HTTP methods
The IEX API only supports GET requests at this time.
Parameters
Parameter values must be comma-delimited when requesting multiple. (i.e. ?symbols=SNAP,fb is correct.) Casing does not matter when passing values to a parameter. (i.e. Both ?symbols=fb and ?symbols=FB will work.) Be sure to url-encode the values you pass to your parameter. (i.e. ?symbols=AIG+ encoded is ?symbols=AIG%2b.) Filter results All HTTP request endpoints support a filter parameter to return a subset of data. Pass a comma-delimited list of field names to filter. Field names are case-sensitive and are found in the Reference section of each endpoint.
Example: ?filter=symbol,volume,lastSalePrice will return only the three fields specified.
WebSockets
WebSocket support is limited at this time to Node.js server clients and socket.io browser clients. We use socket.io for our WebSocket server. The WebSocket examples in our documentation assume a socket.io browser client is being used. We’re planning to rewrite our WebSocket server for broader support.
For socket.io clients, use: https://ws-api.iextrading.com/1.0 Examples that shows a connection to the tops channel and a subscribtion to snap,fb,aig+ topics
// Import socket.io with a connection to a channel (i.e. tops)
const socket = require('socket.io-client')('https://ws-api.iextrading.com/1.0/tops')
// Listen to the channel's messages
socket.on('message', message => console.log(message))
// Connect to the channel
socket.on('connect', () => {
// Subscribe to topics (i.e. appl,fb,aig+)
socket.emit('subscribe', 'snap,fb,aig+')
// Unsubscribe from topics (i.e. aig+)
socket.emit('unsubscribe', 'aig+')
})
// Disconnect from the channel
socket.on('disconnect', () => console.log('Disconnected.'))
Usages
To provide the best experience for all our users, we monitor for suspicious activity and overload. We reserve the right to revoke access to anyone who abuses the IEX API. We throttle endpoints by IP, but you should be able to achieve over 100 requests per second.
Changelog and other relevant information can be found at www.iextrading.com/developer/docs/#changelog