Getting started overview
Getting started with the Intrinio API involves a sequence of steps designed to provide access to financial market data. This process typically includes account registration, API key retrieval, and the construction of an initial authenticated API request. Intrinio offers a free Developer Plan that allows users to explore the API's capabilities with limited data access for non-commercial purposes, which is suitable for initial setup and testing.
The Intrinio platform supports both RESTful API endpoints for historical and static data retrieval, and WebSocket connections for real-time data streaming. Developers can interact with the API directly using HTTP requests or leverage one of the officially supported SDKs across various programming languages, including Python, Node.js, Ruby, Java, C#, and R. The API's architecture is designed to deliver a range of financial data, from real-time stock prices to company fundamentals and options data.
The following table outlines the key steps to begin using the Intrinio API:
| Step | What to do | Where to find it |
|---|---|---|
| 1. Create Account | Register for an Intrinio account. | Intrinio Sign-up Page |
| 2. Get API Key | Locate your unique API key in your user dashboard. | Intrinio Dashboard |
| 3. Make First Request | Construct an authenticated API call using your key. | Intrinio API v2 Getting Started Guide |
| 4. Explore Data | Review available endpoints and data types. | Intrinio API Documentation |
Create an account and get keys
To access Intrinio's financial data API, the first step is to create a user account. This account serves as the central point for managing your subscriptions, monitoring usage, and obtaining the necessary credentials for API access. New users can register for an account on the Intrinio sign-up page. During registration, users typically provide an email address and create a password. Intrinio offers a Developer Plan, which provides a free tier for non-commercial use and initial development, allowing users to start without immediate payment.
Once an account is created and verified, you can log in to your Intrinio dashboard. Within the dashboard, your unique API key will be displayed. This API key is a critical credential that authenticates your requests to the Intrinio API. It acts as a token that identifies your account and authorizes access to the data plans you are subscribed to. It is important to treat your API key as sensitive information, similar to a password, to prevent unauthorized access to your account and data usage.
For security, it is recommended to store your API key securely and avoid embedding it directly into client-side code that could be publicly exposed. Best practices for API key management often involve using environment variables or secure configuration files, especially in production environments. The Google Cloud documentation on API key best practices provides general guidance on securing API keys across different platforms.
Your first request
After obtaining your API key, you can make your first request to the Intrinio API. All requests to Intrinio's REST API require your API key for authentication. The key is typically passed as a query parameter named api_key in the URL. Intrinio's API uses standard HTTP methods (GET) for data retrieval. A common starting point is to fetch basic company information or real-time stock prices.
For instance, to retrieve real-time stock prices for a specific symbol, you would use an endpoint like /securities/{identifier}/prices/realtime. Replace {identifier} with the stock symbol (e.g., AAPL).
Here's an example of a simple request using curl, a common command-line tool for making HTTP requests:
curl -X GET "https://api.intrinio.com/prices/realtime?symbol=AAPL&api_key=YOUR_API_KEY"
Replace YOUR_API_KEY with the actual API key from your Intrinio dashboard. Upon successful execution, the API will return a JSON response containing the real-time price data for Apple (AAPL).
If you prefer using a programming language, Intrinio provides SDKs for multiple languages. Below are examples for Python and Node.js to demonstrate how to make a similar request programmatically:
Python Example
First, install the Intrinio Python SDK:
pip install intrinio-sdk
Then, use the following Python code:
import intrinio_sdk
from intrinio_sdk.rest import ApiException
intrinio_sdk.ApiClient().set_api_key('YOUR_API_KEY')
intrinio_sdk.ApiClient().allow_retries(True)
security_api = intrinio_sdk.SecurityApi()
try:
# Request real-time stock price for AAPL
api_response = security_api.get_security_realtime_price(identifier='AAPL')
print(api_response.to_dict())
except ApiException as e:
print(f"Exception when calling SecurityApi->get_security_realtime_price: {e}")
Remember to replace 'YOUR_API_KEY' with your actual key.
Node.js Example
First, install the Intrinio Node.js SDK:
npm install intrinio-sdk
Then, use the following Node.js code:
const intrinioSDK = require('intrinio-sdk');
intrinioSDK.ApiClient.instance.authentications['ApiKeyAuth'].apiKey = 'YOUR_API_KEY';
const securityApi = new intrinioSDK.SecurityApi();
securityApi.getSecurityRealtimePrice('AAPL')
.then(data => {
console.log(data);
})
.catch(error => {
console.error(`Exception when calling SecurityApi->getSecurityRealtimePrice: ${error}`);
});
Again, replace 'YOUR_API_KEY' with your actual key.
These examples illustrate the basic process of making an authenticated request. The Intrinio API v2 Getting Started guide provides further details on available endpoints and request parameters.
Common next steps
After successfully making your first API call, several common next steps can help you further integrate Intrinio data into your applications and workflows:
- Explore Additional Endpoints: The Intrinio API offers a wide range of data, including historical stock prices, company financial statements, options data, and more. Review the Intrinio API documentation to identify other endpoints relevant to your project. Common areas include fundamental data for financial analysis, historical data for backtesting strategies, or forex and cryptocurrency data for broader market coverage.
- Implement Error Handling: Robust applications require proper error handling. Familiarize yourself with the API error codes and responses to gracefully manage issues such as rate limits, invalid parameters, or authentication failures.
- Manage Rate Limits: Intrinio imposes rate limits on API requests, especially for the free Developer Plan. Understand these limits and implement strategies like request queuing or exponential backoff to avoid exceeding them, which can lead to temporary blocks. Details on specific rate limits are available in the Intrinio documentation.
- Utilize WebSockets for Real-time Data: For applications requiring continuous updates, explore Intrinio's WebSocket API. This allows for persistent connections to receive real-time market data without polling, which is more efficient for high-frequency data streams. The WebSocket documentation provides setup instructions.
- Upgrade Your Plan (if needed): If your project requires higher request volumes, access to more extensive datasets, or commercial use, consider upgrading from the Developer Plan to a paid subscription like the Startup Plan. Paid plans offer increased rate limits and broader data access.
- Integrate with Cloud Platforms: For scalable applications, consider integrating Intrinio data into cloud-based architectures. This might involve using serverless functions (e.g., Google Cloud Functions, AWS Lambda) to fetch and process data, or storing data in cloud databases.
- Contribute to the Community: Engage with other developers using Intrinio. While Intrinio doesn't host a public forum, exploring general financial API communities or GitHub repositories can provide insights and solutions to common challenges.
Troubleshooting the first call
When making your first API call to Intrinio, you might encounter issues. Here are common problems and their solutions:
-
Invalid API Key:
- Symptom: An authentication error, often an HTTP 401 Unauthorized status code.
- Solution: Double-check that you have copied your API key correctly from your Intrinio dashboard. Ensure there are no leading or trailing spaces. Verify that the parameter name is precisely
api_keyin your request URL.
-
Rate Limit Exceeded:
- Symptom: An HTTP 429 Too Many Requests status code.
- Solution: The free Developer Plan has strict rate limits. If you make too many requests in a short period, you might hit this limit. Wait for a few minutes before trying again. For development, space out your requests. For production, consider upgrading your plan or implementing rate limiting strategies in your code. The Intrinio documentation details the specific rate limits for each plan.
-
Incorrect Endpoint or Parameters:
- Symptom: An HTTP 404 Not Found or HTTP 400 Bad Request status code, or an empty/unexpected JSON response.
- Solution: Refer to the Intrinio API reference to confirm the exact endpoint path and required parameters. Pay close attention to case sensitivity for endpoint paths and parameter names. Ensure the identifier (e.g., stock symbol) is valid and exists within Intrinio's dataset.
-
Network Connectivity Issues:
- Symptom: Connection timeouts or network errors.
- Solution: Verify your internet connection. If you are behind a corporate firewall or proxy, ensure that it allows outgoing connections to
api.intrinio.comon HTTPS port 443.
-
SDK-Specific Errors:
- Symptom: Exceptions or errors reported by the Intrinio SDKs (Python, Node.js, etc.).
- Solution: Ensure you have installed the correct SDK version and that your code adheres to the SDK's usage examples. Check the SDK's documentation for specific error messages and their meanings. Update your SDK to the latest version, as bugs are often patched.
-
Data Access Permissions:
- Symptom: An HTTP 403 Forbidden status code, indicating you don't have access to the requested data.
- Solution: Certain datasets or features may only be available on specific paid plans. Check your Intrinio subscription details to confirm your access level. The free Developer Plan has limited data access.