Getting started overview

This guide outlines the process for new users to begin integrating with IEX Cloud, a financial data API providing access to market data. The steps cover account creation, API key retrieval, and executing a basic data request. IEX Cloud offers various data types, including real-time stock prices, historical market data, and company fundamentals, designed for applications in financial analysis, trading, and research.

Before making live requests that consume message allowances, users often begin in the Sandbox environment. This environment provides a testing ground with simulated data, allowing developers to validate their integration logic without impacting their production message limits. Once testing is complete, transitioning to the production environment involves updating the base URL and using production API keys.

The core interaction with IEX Cloud is via its RESTful API. Developers can use standard HTTP clients or leverage official and community-contributed SDKs for Python and JavaScript. A clear understanding of REST architectural principles can facilitate integration, as IEX Cloud's endpoints follow common patterns for resource identification and state transfer, as described by the W3C's Architectural Principles of the World Wide Web.

Create an account and get keys

To access IEX Cloud data, an account is required. This process typically involves registering on the IEX Cloud website.

  1. Navigate to the IEX Cloud Website: Go to the official IEX Cloud homepage.
  2. Sign Up: Locate and click the 'Sign Up' or 'Get Started' button. This will lead to a registration form.
  3. Complete Registration: Provide the necessary information, which typically includes an email address and password. Follow any instructions for email verification.
  4. Choose a Plan: During or after registration, you will be prompted to select a plan. The IEX Cloud pricing page details available options, including a free Sandbox tier for testing.
  5. Access Your Dashboard: Once registered and logged in, you will be directed to your IEX Cloud dashboard.
  6. Retrieve API Keys: Within the dashboard, navigate to the 'API Tokens' or 'Access Keys' section. IEX Cloud provides two types of keys: a Publishable (or Public) key and a Secret key. The Publishable key is generally used for client-side applications where the key might be exposed, while the Secret key is for server-side operations and should be kept confidential. For most direct API calls, particularly those made from a backend, the Secret key is used.

It is important to store your API keys securely. Never hardcode Secret keys directly into client-side code or public repositories. Environment variables or secure configuration management systems are recommended for handling API keys in production environments.

Quick Reference: Account and Keys

Step What to Do Where
1. Register Create an account IEX Cloud homepage
2. Log In Access your dashboard IEX Cloud login portal
3. Get Keys Retrieve Publishable and Secret API tokens Dashboard > API Tokens section

Your first request

After obtaining your API keys, you can make your first request. This example uses a common endpoint to retrieve stock quotes for a specific ticker symbol. For testing purposes, IEX Cloud recommends using the Sandbox environment, which has a distinct base URL.

Sandbox Environment

The base URL for the Sandbox environment is https://sandbox.iexapis.com/stable/. This environment mimics the production API but uses simulated data and does not consume production message allowances, as detailed in the IEX Cloud Sandbox environment documentation.

Example: Fetching a Quote for Apple (AAPL)

This example demonstrates fetching a quote for Apple (AAPL) using a Secret API key. Replace YOUR_SECRET_API_KEY with your actual Secret key.

Using cURL (Command Line)

curl "https://sandbox.iexapis.com/stable/stock/aapl/quote?token=YOUR_SECRET_API_KEY"

Expected (example) JSON response:

{
  "symbol": "AAPL",
  "companyName": "Apple Inc.",
  "primaryExchange": "NASDAQ",
  "latestPrice": 170.15,
  "latestSource": "Close",
  "latestTime": "May 29, 2026",
  "change": 1.25,
  "changePercent": 0.0074,
  "marketCap": 2800000000000,
  "peRatio": 28.5,
  "week52High": 180.00,
  "week52Low": 120.00
  // ... other fields
}

Using Python

You can use the requests library in Python to make HTTP requests. First, ensure you have it installed: pip install requests.

import requests
import os

# It's recommended to store API keys in environment variables
api_key = os.environ.get("IEX_SECRET_API_KEY") # Or replace with your key directly for testing
symbol = "AAPL"

if api_key:
    url = f"https://sandbox.iexapis.com/stable/stock/{symbol}/quote?token={api_key}"
    response = requests.get(url)

    if response.status_code == 200:
        data = response.json()
        print(data)
    else:
        print(f"Error: {response.status_code} - {response.text}")
else:
    print("IEX_SECRET_API_KEY environment variable not set.")

Using JavaScript (Node.js)

For Node.js, you can use the built-in https module or a library like axios. First, install axios: npm install axios.

const axios = require('axios');

// It's recommended to store API keys in environment variables
const apiKey = process.env.IEX_SECRET_API_KEY; // Or replace with your key directly for testing
const symbol = 'AAPL';

if (apiKey) {
  const url = `https://sandbox.iexapis.com/stable/stock/${symbol}/quote?token=${apiKey}`;

  axios.get(url)
    .then(response => {
      console.log(response.data);
    })
    .catch(error => {
      console.error(`Error: ${error.response ? error.response.status : error.message} - ${error.response ? error.response.data : ''}`);
    });
} else {
  console.log('IEX_SECRET_API_KEY environment variable not set.');
}

Upon successful execution, the console will display JSON data containing the quote for AAPL. This confirms that your API key is valid and your request is correctly formatted.

Common next steps

After successfully making your first request, several common next steps can enhance your integration with IEX Cloud:

  • Explore More Endpoints: The IEX Cloud API reference lists numerous endpoints for different data types, such as historical prices, company financials, news, and economic indicators. Experiment with fetching various data points relevant to your application.
  • Integrate with an SDK: For easier development, consider using one of the available SDKs (Python, JavaScript). These SDKs abstract away the HTTP request details and provide language-specific interfaces for interacting with the API.
  • Understand Rate Limits: Be aware of the rate limits associated with your IEX Cloud plan. Exceeding these limits can result in temporary blocks or increased costs. Implement caching and efficient data retrieval strategies to optimize usage. The IEX Cloud rate limits documentation provides specific details.
  • Transition to Production: Once your application is thoroughly tested in the Sandbox, update your base URL to https://cloud.iexapis.com/stable/ and use your production Secret API key. Ensure thorough testing in the production environment before deploying live.
  • Error Handling: Implement robust error handling in your code to gracefully manage API errors, network issues, and unexpected data formats. The API typically returns standard HTTP status codes (e.g., 401 for unauthorized, 403 for forbidden, 429 for rate limits) to indicate issues, as described in RFC 7231, Section 6 on HTTP status codes.
  • Monitor Usage: Regularly check your IEX Cloud dashboard to monitor your message usage and ensure it aligns with your plan and expectations.

Troubleshooting the first call

If your first API call fails, consider the following common issues and troubleshooting steps:

  • Incorrect API Key: Double-check that you are using the correct Secret API key. Ensure there are no typos or extra spaces. Verify you are using a Secret key, not a Publishable key, for server-side requests.
  • Incorrect Endpoint URL: Confirm that the base URL is correct for the environment you are targeting (e.g., https://sandbox.iexapis.com/stable/ for Sandbox, https://cloud.iexapis.com/stable/ for production). Also, ensure the endpoint path (e.g., /stock/aapl/quote) is accurate. Refer to the IEX Cloud API reference for correct endpoint structures.
  • Missing Token Parameter: The token=YOUR_SECRET_API_KEY query parameter is mandatory for authentication. Ensure it is appended correctly to your URL.
  • Network Issues: Verify your internet connection. If you are behind a firewall or proxy, ensure it allows outgoing HTTPS connections to IEX Cloud domains.
  • Rate Limits: Although less common for a first call, if you are rapidly testing, you might hit a temporary rate limit. Wait a few minutes and try again. The IEX Cloud documentation on rate limits provides details on typical restrictions.
  • HTTP Status Codes: Pay attention to the HTTP status code returned in the response. Common codes for errors include:
    • 401 Unauthorized: Incorrect or missing API key.
    • 403 Forbidden: Your API key does not have permission to access the requested data, or your account plan does not include it.
    • 404 Not Found: The requested resource (e.g., ticker symbol) does not exist or the endpoint path is incorrect.
    • 429 Too Many Requests: You have exceeded your rate limits.
    • 5xx Server Error: An issue on the IEX Cloud server side. This usually resolves itself.
  • CORS Issues (Client-Side): If making requests from a browser-based application, you might encounter Cross-Origin Resource Sharing (CORS) errors. For security reasons, IEX Cloud's Secret keys are not intended for direct client-side use. Instead, a backend proxy should be used to protect your Secret key and handle requests.