> ## Documentation Index
> Fetch the complete documentation index at: https://api.alphainsider.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getStockPriceHistory

> Get stock price history.



## OpenAPI

````yaml /openapi.yaml get /getStockPriceHistory
openapi: 3.1.0
info:
  title: AlphaInsider
  version: '1.0'
  description: >-
    The official API and websocket documentation for
    [AlphaInsider.com](https://alphainsider.com/)
servers:
  - url: https://alphainsider.com/api
security: []
tags:
  - name: Introduction
  - name: Authentication
  - name: Users
  - name: Strategies
  - name: Subscriptions
  - name: Payments
  - name: Withdrawals
  - name: Timelines
  - name: Stocks
  - name: Trades
  - name: Webhooks
  - name: Bots
  - name: Websockets
paths:
  /getStockPriceHistory:
    get:
      tags:
        - Stocks
      summary: getStockPriceHistory
      description: Get stock price history.
      operationId: getStockPriceHistory
      parameters:
        - name: stock_id
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/stock_id'
        - name: start_date
          in: query
          schema:
            $ref: '#/components/schemas/start_date'
        - name: end_date
          in: query
          schema:
            $ref: '#/components/schemas/end_date'
        - name: limit
          in: query
          schema:
            $ref: '#/components/schemas/limit'
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: >-
                      Endpoint-specific response payload, or an error message
                      when `success` is false.
                    items:
                      type: object
                      properties:
                        stock_price_id:
                          type: string
                          description: Stock price id.
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        bid:
                          type: string
                          description: Current bid price.
                        ask:
                          type: string
                          description: Current ask price.
                        last:
                          type: string
                          description: Last traded price.
                        created_at:
                          $ref: '#/components/schemas/created_at'
              examples:
                '200':
                  value:
                    success: true
                    response:
                      - stock_price_id: SnNPDVnCo_yrwLTtagsx4
                        stock_id: v3lhjrwEhNuAOxPT29oxO
                        bid: '406.010000000000000'
                        ask: '406.010000000000000'
                        last: '406.010000000000000'
                        created_at: '2020-08-24T14:00:00.000Z'
                      - stock_price_id: ztdNu8H_Eyjmn3eIb_Deo
                        stock_id: v3lhjrwEhNuAOxPT29oxO
                        bid: '402.660000000000000'
                        ask: '402.660000000000000'
                        last: '402.660000000000000'
                        created_at: '2020-08-24T15:00:00.000Z'
        '400':
          $ref: '#/components/responses/400'
components:
  schemas:
    stock_id:
      type: string
      description: AlphaInsider stock identifier, or `SYMBOL:EXCHANGE` in requests.
    start_date:
      type: string
      format: date-time
      description: Start date.
    end_date:
      type: string
      format: date-time
      description: End timestamp for the current period or range.
    limit:
      type: number
      description: Number of results to return.
    success:
      type: boolean
      description: True when the request succeeded.
    created_at:
      type: string
      format: date-time
      description: Creation timestamp.
  responses:
    '400':
      description: Request failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                description: False when the request failed.
              response:
                type: string
                description: Error message.
          examples:
            '400':
              value:
                success: false
                response: Request failed.

````