InsightSentry

    Latest Quote

    Overview

    '/latest' endpoint provides the latest series or quote data for a symbol.

    Key Features:

    • Supports both GET and POST requests
    • Has same format with /realtime and /history endpoint's 'series' data
    • Provides real-time data

    GET request

    https://insightsentry.p.rapidapi.com/v1/latest?&code=NASDAQ:AAPL&interval_type=minute&type=quote

    POST request

    {
      "code": "NASDAQ:AAPL",
      "type": "series",
      "interval_type": "minute", 
      "interval_length": 1           
      }

    Request Parameter for 'subscriptions' field

    code
    Symbol code (e.g., 'NASDAQ:AAPL')
    type
    Optional. Default value is 'series'. Allowed values: 'quote', 'series'
    interval_type
    Optional. Default value is 'minute' Required only when type is 'series'. Allowed values: 'second', 'minute', 'hour', 'day', 'week', 'month'
    interval_length
    Optional. Default value is 1. Required only when type is 'series'. Allowed values are as follows: when interval_type is 'second', only 1 is allowed else ignored. For other types, only less than 1 year is allowed

    Series

    When you request data with 'type': 'series', the data format will be as follows:

    {
      "code": "NASDAQ:AAPL",
      "bar_end": 1733432399,
      "bar_type": "1m",
      "series": [
        {
          "time": 1733432340,
          "open": 242.89,
          "high": 243.09,
          "low": 242.82,
          "close": 243.08,
          "volume": 533779
        }
      ]
    }

    Response Fields

    code
    Symbol code (String)
    bar_end
    End time of the current bar (Unix time in seconds, Integer)
    bar_type
    Type of the bar - 's' is seconds. m is minutes. h is hours. D is days. W is weeks. M is months. (String)
    series
    Array of bars (Array)
    time
    Time of the current bar (Unix time in seconds, Integer)
    open
    Opening price of the bar (Float)
    high
    Highest price of the bar (Float)
    low
    Lowest price of the bar (Float)
    close
    Current price (if the bar is not finished) or the close price of the bar (Float)
    volume
    Trading volume (Integer)

    Quote

    When you request data with 'type': 'quote', the data format will be as follows:

    {
      "code": "NASDAQ:AAPL",
      "lp_time": 1733432340,
      "status": "active",
      "volume": 533779,
      "last_price": 243.08,
      "change_percent": 0.41,
      "change": 979.96,
      "bid": 243.08,
      "ask": 243.09,
    }

    Response Fields

    code
    Symbol code (String)
    status
    Status of the market (String or null)
    lp_time
    Time of the last price update (Unix time in seconds, Integer)
    volume
    Volume of the last trade (Integer or null)
    last_price
    Last traded price (Float)
    change_percent
    Change percentage from the last price (Float or null)
    change
    Change from the last price (Float or null)
    bid
    Current bid price (Float or null)
    ask
    Current ask price (Float or null)

    Code Examples

    import requests
    
    url = "https://insightsentry.p.rapidapi.com/v1/latest"
    headers = {
    		"x-rapidapi-key": <your key>,
    		"x-rapidapi-host": "insightsentry.p.rapidapi.com"
    }
        // requesting 1 minute bar chart data for NASDAQ:AAPL 
    data = {
        "code": "NASDAQ:AAPL",
        "type": "series", // suported types: quote, series
        "interval_type": "minute",
        "interval_length": 1 
    }
    
    response = requests.post(url, headers=headers, json=data)
    print(response.text)
    
    
    ## or you can also use GET request
    
    response = requests.get("https://insightsentry.p.rapidapi.com/v1/latest?code=NASDAQ:AAPL&type=series&interval_type=minute&interval_length=1", headers=headers)
    print(response.text)