SDKs overview
Intrinio offers a suite of official software development kits (SDKs) designed to streamline interaction with its financial data APIs. These SDKs are available across multiple programming languages, providing developers with idiomatic access to various Intrinio datasets, including real-time stock prices, historical data, fundamental analysis, options, forex, and cryptocurrency information. By encapsulating HTTP request logic and response parsing, the SDKs aim to reduce development time and complexity when integrating financial data into applications, trading algorithms, or research projects.
The SDKs are built to support both the Intrinio REST API for on-demand data retrieval and, where applicable, WebSocket connections for real-time data streaming. This dual approach allows developers to choose the most suitable method for their data requirements, whether it's querying historical snapshots or subscribing to live market updates. The official documentation provides detailed API references and usage examples for each SDK, ensuring developers can quickly get started with data consumption.
While official SDKs cover the most common programming environments, the open nature of APIs often fosters a community of developers who create and maintain their own client libraries. These community-driven projects can sometimes offer specialized features, alternative architectural patterns, or support for less common languages. Users evaluating third-party libraries should consider factors such as maintenance, documentation quality, and community support.
Official SDKs by language
Intrinio maintains official SDKs for several popular programming languages, ensuring robust support and direct compatibility with their API improvements. These SDKs are typically hosted on respective package managers and version-controlled on platforms like GitHub, allowing for easy installation and updates. Each SDK is designed to reflect the nuances and conventions of its target language, providing a more natural development experience than direct API calls.
The following table outlines the officially supported SDKs, their typical package names, and the standard installation commands:
| Language | Package Manager / Name | Installation Command | Maturity |
|---|---|---|---|
| Python | pip install intrinio-sdk |
pip install intrinio-sdk |
Stable |
| Node.js | npm install intrinio-sdk |
npm install intrinio-sdk |
Stable |
| Ruby | gem install intrinio-sdk |
gem install intrinio-sdk |
Stable |
| Java | Maven / Gradle (see docs for dependency) | Add dependency to pom.xml or build.gradle |
Stable |
| C# | NuGet (IntrinioSDK) |
Install-Package IntrinioSDK |
Stable |
| R | CRAN (intrinio) |
install.packages("intrinio") |
Stable |
For detailed instructions and specific dependency configurations, especially for Java and C#, developers should refer to the official Intrinio SDK documentation.
Installation
Installing an Intrinio SDK typically involves using the package manager native to your chosen programming language. This process ensures that all necessary dependencies are resolved and the library is correctly integrated into your development environment. Before installation, ensure you have the appropriate language runtime and package manager installed.
Python
Python developers can install the Intrinio SDK using pip, the standard package installer for Python. It is recommended to use a virtual environment to manage project dependencies:
# Create a virtual environment
python -m venv myenv
source myenv/bin/activate # On Windows, use `myenv\Scripts\activate`
# Install the Intrinio SDK
pip install intrinio-sdk
Node.js
For Node.js projects, the Intrinio SDK is available via npm, the Node.js package manager:
# Initialize a new Node.js project (if not already done)
npm init -y
# Install the Intrinio SDK
npm install intrinio-sdk
Ruby
Ruby developers can install the Intrinio SDK as a gem using bundler or directly with gem install:
# Install the Intrinio SDK gem
gem install intrinio-sdk
# Or, add to your Gemfile and run bundle install
# gem 'intrinio-sdk'
# bundle install
Java
Java projects typically manage dependencies using Maven or Gradle. You'll need to add the Intrinio SDK as a dependency in your project's pom.xml (Maven) or build.gradle (Gradle) file. Refer to the Intrinio Java SDK setup guide for the specific dependency syntax.
// Maven (pom.xml example)
<dependency>
<groupId>com.intrinio</groupId>
<artifactId>intrinio-java-sdk</artifactId>
<version>X.Y.Z</version> <!-- Use the latest version -->
</dependency>
// Gradle (build.gradle example)
implementation 'com.intrinio:intrinio-java-sdk:X.Y.Z' // Use the latest version
C#
C# developers can install the Intrinio SDK via NuGet, the package manager for .NET. This can be done through the NuGet Package Manager UI in Visual Studio or via the Package Manager Console:
# In Package Manager Console
Install-Package IntrinioSDK
R
R users can install the Intrinio package directly from CRAN (The Comprehensive R Archive Network):
install.packages("intrinio")
Quickstart example
This quickstart example demonstrates how to fetch basic company information and real-time stock prices using the Intrinio Python SDK. You will need an API key, available after signing up for an Intrinio account (including the free Developer Plan).
First, ensure you have your API key ready. It's recommended to store your API key as an environment variable (INTRINIO_API_KEY) rather than hardcoding it directly in your script for security purposes. This practice aligns with general API security best practices, as noted by sources like Google's API client library documentation.
import intrinio_sdk
import os
# --- Configuration ---
# Get your API key from environment variable or replace with your actual key
intrinio_sdk.ApiClient().configuration.api_key['api_key'] = os.environ.get('INTRINIO_API_KEY', 'YOUR_API_KEY_HERE')
# --- Initialize APIs ---
security_api = intrinio_sdk.SecurityApi()
company_api = intrinio_sdk.CompanyApi()
# --- Example 1: Get real-time stock price for a symbol ---
try:
# Fetch real-time price for Apple (AAPL)
realtime_price = security_api.get_security_realtime_price(identifier='AAPL')
print(f"AAPL Real-time Price: {realtime_price.last_price}")
print(f"AAPL Bid Price: {realtime_price.bid_price}")
print(f"AAPL Ask Price: {realtime_price.ask_price}")
except intrinio_sdk.ApiException as e:
print(f"Error fetching real-time price: {e}")
print("\n---\n")
# --- Example 2: Get company fundamentals for a specific company ---
try:
# Fetch company profile for Microsoft (MSFT)
msft_company = company_api.get_company(identifier='MSFT')
print(f"Company Name: {msft_company.name}")
print(f"Industry: {msft_company.industry_category}")
print(f"Sector: {msft_company.industry_group}")
print(f"CEO: {msft_company.ceo}")
# Fetch a recent financial statement (e.g., income statement)
income_statements = company_api.get_company_financials(identifier='MSFT', statement_type='income_statement')
if income_statements.financials:
latest_income_statement = income_statements.financials[0]
print(f"\nLatest Income Statement (Period: {latest_income_statement.fiscal_period}, Year: {latest_income_statement.fiscal_year}):")
for metric in latest_income_statement.data:
if metric.value is not None and metric.tag.startswith('totalrevenue'): # Example: filter for revenue
print(f" {metric.tag}: {metric.value}")
else:
print("No income statements found.")
except intrinio_sdk.ApiException as e:
print(f"Error fetching company fundamentals: {e}")
print("\n---\n")
# --- Example 3: Search for securities ---
try:
search_results = security_api.search_securities(query='Tesla', page_size=5)
print("Search results for 'Tesla':")
for security in search_results.securities:
print(f" {security.ticker} - {security.name} ({security.exchange_mic})")
except intrinio_sdk.ApiException as e:
print(f"Error searching securities: {e}")
This script first configures the API key. Then, it uses the SecurityApi to retrieve the real-time price for Apple (AAPL) and the CompanyApi to fetch Microsoft's (MSFT) company profile and a recent income statement. Finally, it demonstrates a basic security search. Remember to replace 'YOUR_API_KEY_HERE' with your actual Intrinio API key or set the INTRINIO_API_KEY environment variable.
Community libraries
Beyond the officially supported SDKs, the broader developer community occasionally contributes client libraries or wrappers for the Intrinio API. These community-driven projects can offer alternative approaches, support for niche programming languages not officially covered, or specialized functionalities tailored to specific use cases.
While community libraries can be valuable resources, developers should exercise due diligence before integrating them into production systems. Key considerations include:
- Maintenance Status: Is the library actively maintained and updated to reflect API changes or new features?
- Documentation: Is the documentation clear, comprehensive, and easy to follow?
- Community Support: Is there an active community or forum where users can ask questions and find assistance?
- Security: Has the library been audited for security vulnerabilities, especially concerning API key handling and data transmission?
- API Version Compatibility: Does the library explicitly state which Intrinio API versions it supports?
Developers often find these libraries on public code repositories like GitHub or through language-specific package indexes (e.g., PyPI for Python, npm for Node.js). Searching these platforms using terms like "Intrinio client" or "Intrinio API wrapper" can reveal available community contributions. Always check the project's README, issue tracker, and commit history to gauge its reliability and suitability for your project.
For any critical application, it is generally recommended to prioritize the official Intrinio SDKs due to their direct support from Intrinio and guaranteed compatibility with the latest API features and changes.