Stock API For Fintech Developers: How to Get Started

Andrew Carpenter
August 17, 2016

Get the Intrinio Financial Data API

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. This article explains a few of the resources Intrinio has made available to help you get started. It contains three 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 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-v2.intrinio.com/companies/AAPL/data_point/close_price/number?api_key=

Notice that the API call is broken into several parts.

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

A ticker – companies/AAPL/

A data type – data_point/

An item – close_price/number

Your API key - ?api_key=

Your browser will prompt you to enter your API key - you can get that on your account page. Copy the API key by clicking the little clipboard in the "Key(s)" section, then paste it at the end of your API call.

All you need to do is copy and paste the keys in 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.

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. Read our tutorial for more information about making API calls via browser, command line, code, and SDKs. The API Explorer is a great tool that will help you build API calls.

Our help page has links to the various tag lookup pages in our documentation, including the data tag directory which includes all of the tags for Intrinio's various data types. You can use the Security Master to search Intrinio's coverage and find the unique identifiers you need for the securities you are interested in.

Once you have made a few sample API calls and taken a look at the tools Intrinio offers for developers, 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, it's 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-v2.intrinio.com/securities/AAPL/prices?next_page=[next_page_value]

Oftentimes you will notice that there are limits to the amount of data available in a single call. While users are able to make requests with a page_size up to 10,000 for any API request, the default page size is 100 for all requests (except historical data, which has a default page size of 1,000). Adding a page, such as page_number=2, allows you to pull multiple pages. View the paging documentation for more. 

https://api-v2.intrinio.com/companies/AAPL/fundamentals/lookup/income_statement/2015/Q2  

This grabs AAPL’s income statement from Q2, 2015. 

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

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-v2.intrinio.com/companies/AAPL/data_point/pricetoearnings/number 

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-v2.intrinio.com/indices/economic/$FEDFUNDS/data_point/level/number  

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.

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

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-v2.intrinio.com/indices/stock_market/$VIXCLS/historical_data/level?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, it's the VIX volatility index. 

https://api-v2.intrinio.com/securities/AAPL/prices 

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.  

https://api-v2.intrinio.com/companies/STT/fundamentals?filed_after=2012-09-30 

This call returns the FDIC call report for State Street Corporation, which provides banking services, from 2012-09-30. All banks must file call reports with the FDIC and the Intrinio API allows a developer to access any item from any call report for any bank. 

https://api-v2.intrinio.com/indices/sic/$SIC.5410/historical_data/pricetoearnings?type=median 

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

https://api-v2.intrinio.com/companies/GOOGL/news?page_size=5 

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

https://api-v2.intrinio.com/companies 
https://api-v2.intrinio.com/companies?next_page=MTAz 

This is a handy call that returns the first 100 companies that Intrinio covers, including the ticker/id 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 to the second page to get the second 100. This requires a loop to get the entire list. 

https://api-v2.intrinio.com/companies/AAPL 

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

https://api-v2.intrinio.com/companies/search?query=pricetoearnings~gt~15 

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

Sample Code and SDKs in Numerous Languages

Once you’ve mastered the syntax for Intrinio stock API calls, you’ll want to use your coding language of choice to automatically input your API keys and parse the data for use in your application. The API will work with any language and we provide SDKs in many popular programming languages, including:

Click on the links above for installation instructions and documentation.

New to Intrinio? Visit intrinio.com to explore our data packages.

Sorry, we no longer support Internet Explorer as a web browser.

Please download one of these alternatives and return for the full Intrinio Experience.

Google Chrome web browser icon
Chrome
Mozilla Firefox web browser icon
Firefox
Safari web browser icon
Safari
Microsoft Edge web browser icon
Microsoft Edge