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

# All ratings

> Get all ratings along with target prices, firm names and dates of the research publication

<img src="https://mintcdn.com/ainvest-8e114140/DGzrPnVwd1HT0tfj/images/mcp-analyst-ratings-history.png?fit=max&auto=format&n=DGzrPnVwd1HT0tfj&q=85&s=df6e731affd71dd8f422482c80f3ec64" width="1199" height="780" data-path="images/mcp-analyst-ratings-history.png" />

<ResponseExample>
  ```json Response example for AAPL theme={null}
  "data": {
      "data": [
          {
              "date": "2025-06-26",
              "firm": "JP Morgan",
              "action": "Maintained",
              "rating_previous": null,
              "rating": "Overweight",
              "target_price_previous": 240.0,
              "price_target": 230.0
          },
          {
              "date": "2025-06-10",
              "firm": "Needham",
              "action": "Maintained",
              "rating_previous": null,
              "rating": "Hold",
              "target_price_previous": null,
              "price_target": null
          },
          {
              "date": "2025-06-10",
              "firm": "B of A Securities",
              "action": "Maintained",
              "rating_previous": null,
              "rating": "Buy",
              "target_price_previous": null,
              "price_target": 235.0
          }
      ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml reference/analysis-ratings/analysis-ratings.yaml GET /analysis-ratings/history
openapi: 3.1.0
info:
  title: Analyst ratings and target prices
  description: Get analyst ratings and target prices
  version: 1.0.0
servers:
  - url: https://openapi.ainvest.com/open
    description: Production environment
security:
  - bearerAuth: []
tags:
  - name: Analyst Ratings
    description: Analyst ratings and target prices
    externalDocs:
      url: https://docs.ainvest.com/analysis-ratings
paths:
  /analysis-ratings/history:
    get:
      tags:
        - Analyst Ratings
      summary: Get all ratings with firm names and dates
      description: >-
        Get all ratings along with target prices, firm names and dates of the
        research publication
      operationId: getAnalystRatingsHistory
      parameters:
        - name: ticker
          in: query
          required: true
          description: US stock market ticker symbol, e.g. AAPL, TSLA, etc.
          schema:
            type: string
      responses:
        '200':
          description: Successful response in standard envelope
          content:
            application/json:
              schema:
                $schema: http://json-schema.org/draft-04/schema#
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      data:
                        type: array
                        description: Array of rating items
                        items:
                          $ref: '#/components/schemas/RatingItem'
                  status_code:
                    type: number
                    description: Status code, `0` for success
                  status_msg:
                    type: string
                    description: Status message, `success` for success
        '400':
          description: >-
            Validation error, i.e. requested stock is not found or parameter is
            not specified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status_code: 4012
                status_msg: Invalid param
components:
  schemas:
    RatingItem:
      type: object
      properties:
        date:
          type: string
          format: YYYY-MM-DD
          description: Date of the research publication
        firm:
          type: string
          description: Name of the firm providing the rating
        action:
          type: string
          description: Action taken by the firm, e.g. "Maintained", "Downgraded", etc.
        rating_previous:
          type: string
          description: >-
            Rating previously set by the firm. Can be null if the previous
            rating was not mentioned on the report.
        rating:
          type: string
          description: >-
            Rating provided by the firm, as provided by the firm, e.g.
            "Outperform", "Equal-Weight", "Neutral", "Strong Buy". Can as well
            be null.
        target_price_previous:
          type: number
          description: >-
            The target price set by the firm in the previous report. Can be null
            if the the price was not changed.
        target_price:
          type: number
          description: >-
            Target price set by the firm. Can be null if the firm did not
            provide a target price.
    Error:
      type: object
      properties:
        status_code:
          type: integer
          description: Business status code
        status_msg:
          type: string
          description: Error message
      required:
        - status_code
        - status_msg
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your key. [Get the key
        here](https://www.ainvest.com/business/developer-manage/)

````