NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Stock Price API

The Stock Price API provides access to stock market prices for companies in every major exchange around the world.

Market index prices are also available. For example, ^DJI returns the price of the Dow Jones Industrial Average.

For price and fund information for ETFs and Mutual Funds, use the ETF API and Mutual Fund API respectively, and for company earnings information, use the Earnings API.

Available endpoints:

Premium members have access to live prices, while free users only have access to 15-minute delayed data.

(4.3)

From 3,661 users

3,000+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
343ms356ms390ms594ms1103ms

Didn't find what you were looking for? Suggest an improvement


/v1/stockprice GET

https://api.api-ninjas.com/v1/stockprice

Returns price information for any given ticker symbol. Premium members have access to live prices, while free users only have access to 15-minute delayed data.

Parameters

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response Fields

A JSON object with the following fields or an error if the request is unsuccessful.

  • ticker

    Stock or index ticker symbol (e.g., AAPL or ^DJI).

  • name premium only

    The full company name associated with the ticker symbol.

  • price

    The current stock price.

  • exchange premium only

    The stock exchange where the stock is traded (e.g., NASDAQ, NYSE).

  • updated

    Unix timestamp indicating when the price was last updated.

  • currency premium only

    The currency code for the price (e.g., USD, EUR).

  • volume

    The trading volume (number of shares traded).

Sample Request Live Demo!

ticker

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/stockprice?ticker=AAPL

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    ticker:"AAPL",
    name:"Apple Inc.",
    price:192.42,
    exchange:"NASDAQ",
    updated:1706302801,
    currency:"USD",
    volume:44594000
}

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/stockprice?ticker=AAPL" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.


/v1/stockpricehistorical GET Premium Only

https://api.api-ninjas.com/v1/stockpricehistorical

Returns historical price data in OHLCV (Open, High, Low, Close, Volume) format for any given ticker symbol.

To get the 'price' for a particular period, use the close value from the response.

Parameters

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • open

    The opening price for this time period.

  • low

    The lowest price during this time period.

  • high

    The highest price during this time period.

  • close

    The closing price for this time period.

  • volume

    The trading volume (number of shares traded) during this time period.

  • time

    The Unix timestamp for this data point.

Historical Price Sample Request Live Demo!

ticker
period
start
end

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/stockpricehistorical?ticker=AAPL&period=1h&start=1706000000&end=1706302801

Headers

X-Api-KeyLog in or sign up to get your API Key

Historical Price Sample Response

JSON
[
    {
      open:192.425,
      low:191.94,
      high:192.59,
      close:192.3,
      volume:8363236,
      time:1706283000
    },
    {
      open:192.48,
      low:192.34,
      high:192.975,
      close:192.425,
      volume:3467330,
      time:1706279400
    },
    "..."
]

/v1/stockpricelist GET Premium Only

https://api.api-ninjas.com/v1/stockpricelist

Returns a list of all available companies and their ticker symbols. Supports pagination to retrieve results in batches.

Parameters

  • offset  optional

    Number of results to offset for pagination. Default is 0.

  • limit  optional

    Number of results to return. Must be between 1 and 1000. Default is 100.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • ticker

    The stock ticker symbol.

  • name

    The full company name.

Stock List Sample Request Live Demo!

offset
limit

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/stockpricelist?offset=0&limit=10

Headers

X-Api-KeyLog in or sign up to get your API Key

Stock List Sample Response

JSON
[
    {
      ticker:"AAPL",
      name:"Apple Inc."
    },
    {
      ticker:"MSFT",
      name:"Microsoft Corporation"
    },
    {
      ticker:"GOOGL",
      name:"Alphabet Inc."
    },
    "..."
]

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Stock Price API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • Send a GET request to the /v1/stockprice endpoint with the ticker parameter set to a stock symbol such as AAPL or an index symbol such as ^DJI for the Dow Jones Industrial Average. The response returns the current price, updated timestamp and volume, while name, exchange and currency are premium only fields; for company metadata see the Ticker API.
  • Premium members receive live, real-time prices while free users get 15-minute delayed data; the updated field gives the Unix timestamp of the last price update. You can upgrade for live pricing on the pricing page.
  • Yes. The premium /v1/stockpricehistorical endpoint returns OHLCV data as a JSON array of objects with open, high, low, close, volume and time fields, and you can control the interval with the period parameter (values from 1m up to 1d) along with optional start and end Unix timestamps. Historical access is unlocked via pricing.
  • Use the premium /v1/stockpricelist endpoint, which returns a paginated JSON array of objects with ticker and name fields; control paging with the offset and limit parameters (limit must be between 1 and 1000). For fund pricing instead, see the related ETF API and Mutual Fund API.