Intrinio's stock API was designed by financial professionals for developers, a rare situation in the world of FinTech. This makes the API easy to integrate and scale for a developer while the data structures are intuitive for financial analysts.

Even with this solid foundation,  getting started with the API can be challenging - developers need to understand how to work with a RESTful API AND understand financial data. This article explains a few of the resources Intrinio has made available to help you get started. It contains 4 major sections:

  • A summary of the tools you'll need to get started using the API
  • An explanation of how to make your first API call
  • A list of sample API calls to show you what is possible
  • A list of SDKs that include sample code in many languages

Tools you'll need

Making Your First API Call

Start by looking at the API documentation.  There you will see that the API uses Basic Authentication administered over HTTPS. You can see what this means, and build your first API call, by pasting the following text into your browser:

https://api.intrinio.com/data_point?ticker=AAPL&item=close_price&api_key=[your key here]

Make sure to insert your API key to the syntax/URL like the example above.

Your access key is located in your account page under tab ACCESS KEYS.

All you need to do is copy and paste the above syntax to your browser and you have authenticated over HTTPS. When you do, you will see the result of your API call- the current close price for Apple's stock. Later, your application will do this part with code instead of copy and paste.

Notice that the API call is broken into several parts.

The base URL- https://www.api.intrinio.com/

A data type- data_point?

A ticker- ticker=AAPL&

And an item - item=close_price

By varying the data type, the ticker, and the item, you can use the API to call many different pieces of data from Intrinio's database for thousands of securities in numerous formats.

The API explorer is a great tool that will help you build API calls. 

Our help page has links to the various tag look up pages in our documentation including the data tag directory which includes all of the tags for Intrinio's various data types.

Once you have made a few sample API calls and taken a look at the tools Intrinio offers, you might also want to check out this article that explains paging with the Intrinio API. When you start making API calls for more data, you'll have to "page" through the results.

Sample Stock API calls

While sample stock API calls are included in the API documentation, it can be useful to see a few together to get an idea of the breadth of data types available through Intrinio. Once you learn the format of a few data types, its easy to change the building blocks of the API call to get a different piece of data, especially if you use the API explorer.

https://api.intrinio.com/securities?page_number=2

Often times you will notice that there are limits to the amount of data available in a single call. This limit is 100 items per page in general, but adding a pager, page_number=2 in this case, allows you to pull multiple pages. Here is the paging documentation.

This grabs AAPL's income statement from Q2, 2015:

https://api.intrinio.com/financials/standardized?identifier=AAPL&statement=income_statement&fiscal_year=2015&fiscal_period=Q2

That shows all companies with a new filing date on or after 2017-03-06, which is useful for determining which fundamentals need to be updated.

https://api.intrinio.com/companies?latest_filing_date=2017-03-06

This call uses data_point, a data type that returns the most current piece of data. In this case, I have simply changed out "close_price" in the first API call in this post for "pricetoearnings" so that instead of the current stock price for Apple, I will see the current price to earnings ratio.

https://api.intrinio.com/data_point?ticker=AAPL&item=pricetoearnings

This call returns the current federal funds interest rate from the federal reserve. Your API calls are not limited to just stocks- Intrinio covers 200,000 economic data series as well. This article explains how to pull economic data.

https://api.intrinio.com/data_point?ticker=$FEDFUNDS&item=level

This stock api call uses the historical data format to pull Apple's price to earnings ratio over the course of 2014. Historical data allows you to pull data as a time series or to pull data from a specific point in time.

https://api.intrinio.com/historical_data?ticker=AAPL&item=pricetoearnings&start_date=2014-01-01&end_date=2015-01-01

Here, we combine the previous two calls to return economic data as a time series. In this case, its the VIX volatility index.

https://api.intrinio.com/historical_data?identifier=$VIXCLS&item=level&start_date=2014-01-01&end_date=2015-01-01

This call will return the entire price history of Apple if you use a pager. You can use this data type to specify a specific date range or pull it all in at once, with a default page size of 100 rows. See our Page Size Limits documentation for more info.

https://api.intrinio.com/prices?ticker=AAPL

This call pulls in the median annual price to earnings ratio for the Oil and Gas industry for every year going back to 2007. Learning how to use SIC codes to pull data on sectors and industries is a lucrative method for obtaining benchmarking data.

https://api.intrinio.com/historical_data?ticker=$SIC.5410&item=pricetoearnings&frequency=yearly&stat=median

Here we move into the realm of dimensional calling, which is a single API call that returns multiple data points for a security, up to 100, or multiple securities for a datapoint, up to 100. This call will pull in all of the latest news for both Microsoft and Apple. 

https://api.intrinio.com/news?ticker=AAPL&ticker=MSFT

In this call, instead of multiple items for a single stock we get a single item for multiple stocks. In this case, the real time stock price for Apple and Microsoft.

https://api.intrinio.com/data_point?ticker=AAPL,MSFT&item=last_price

This dimensional call uses the data_point endpoint to pull in 3 metrics for AAPL. Dimensional calls do not work with historical data, however they can save you time with data_point and news.

https://api.intrinio.com/data_point?ticker=AAPL&item=open_price,last_price,volume

That will limit your news to the most recent 5 articles.

https://api.intrinio.com/news?identifier=GOOGL&page_size=5

This is a handy call that returns the first 100 companies that Intrinio covers, including the ticker symbols you can parse out to use in other API calls. Since the number of items that can be returned in a single call is limited to 100, and Intrinio covers way more than 100 tickers, you will need to change the "1" to "2" to get the second 100. This requires a loop to get the entire list.

https://api.intrinio.com/companies?page_number=1

This call extends the previous call to get the basic company information for Apple.

https://api.intrinio.com/companies?identifier=AAPL

This article explains how to use the stock screener api, including sample calls for multiple screening parameters. The call below will return companies with a price to earnings ratio greater than 15.

https://api.intrinio.com/securities/search?conditions=pricetoearnings~gt~15

This call will return your current number of API calls if you add your own API password at the end. Most Intrinio plans put a daily limit on the number of API calls you can make, this documentation shows how to track your usage.

https://api.intrinio.com/usage/current?access_code={access_code}

That will pull securities that had their 10Q or 10K updated on a specific date.

https://api.intrinio.com/securities?last_crisp_adj_date=2018-03-29

Or the adjusted date for an entire exchange.

https://api.intrinio.com/securities?identifier=AAPL&exch_symbol=^XNAS

Or companies with a filing date on a specific date. 

https://api.intrinio.com/companies?latest_filing_date=2018-03-29

Sample Code and SDKs in Numerous Languages

Once you have mastered the syntax for Intrinio stock API calls, you will want to use your coding language of choice to automatically input your API username and password and parse the data for use in your application. 

Intrinio officially supports many REST API SDKs in it's API v2. If you're interested, click here to know more.


Did this answer your question?