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

# Flujo de calificaciones de analistas

> Calificaciones de analistas y cambios en el precio objetivo en tiempo real.

<div id="overview">
  ## Descripción general
</div>

Suscríbase a los cambios de calificación de analistas en tiempo real y a las actualizaciones de precios objetivo. Supervise mejoras, rebajas, inicios de cobertura y ajustes de precios objetivo en el momento en que se produzcan.

<div id="key-features">
  ### Características clave
</div>

* **Calificaciones en tiempo real**: Recibe notificaciones instantáneas sobre cambios en las calificaciones de los analistas
* **Precios objetivo**: Haz seguimiento de los precios objetivo actuales y anteriores, incluidos sus ajustes
* **Detalles del analista**: Incluye el nombre del analista, la firma y métricas de precisión histórica
* **Clasificación de la acción de rating**: Mejoras, rebajas, mantiene, inicia, reitera
* **Filtrar por valor**: Suscríbete a símbolos bursátiles o ISIN específicos

<div id="use-cases">
  ### Casos de uso
</div>

* Crear alertas y notificaciones en tiempo real sobre cambios de calificación
* Hacer seguimiento al desempeño y la precisión de las firmas de analistas
* Supervisar cambios en el consenso de precio objetivo
* Crear paneles de mejoras y rebajas de calificación
* Automatizar estrategias de trading basadas en las acciones de los analistas

<div id="quick-start">
  ## Inicio rápido
</div>

Usa la herramienta interactiva de prueba de WebSocket que aparece arriba para conectarte y probar el stream en tiempo real.

<div id="connection-url">
  ### URL de conexión
</div>

```
wss://api.benzinga.com/api/v2.1/calendar/ratings/stream?token=YOUR_TOKEN
```

<div id="query-parameters">
  ### Parámetros de consulta
</div>

| Parámetro | Obligatorio | Descripción                                                            |
| --------- | ----------- | ---------------------------------------------------------------------- |
| `token`   | Sí          | Tu token de la API WebSocket de Benzinga (bz.production\*\*\*)         |
| `tickers` | No          | Lista de símbolos bursátiles separados por comas (p. ej., `AAPL,TSLA`) |
| `isins`   | No          | Lista de códigos ISIN separados por comas para filtrar                 |

<div id="message-example">
  ## Ejemplo de mensaje
</div>

```json theme={null}
{
  "id": "e9e75b31-604e-422c-a532-362725b2d59d",
  "api_version": "websocket/v1",
  "kind": "data/v2.1/calendar/ratings",
  "data": {
    "action": "created",
    "id": "66fffdc08f3f630001a2ea51",
    "timestamp": "2024-10-04T19:21:06Z",
    "content": {
      "ticker": "AAPL",
      "name": "Apple",
      "exchange": "NASDAQ",
      "date": "2024-10-04",
      "time": "10:37:52",
      "action_company": "Upgrades",
      "rating_current": "Buy",
      "rating_prior": "Neutral",
      "pt_current": "200.00",
      "pt_prior": "180.00",
      "analyst": "Goldman Sachs",
      "firm_id": "57f832ab6b87f600016fa383",
      "importance": 4
    }
  }
}
```

<div id="rating-actions">
  ### Acciones de recomendación
</div>

| Acción       | Descripción                                    |
| ------------ | ---------------------------------------------- |
| `Upgrades`   | Recomendación mejorada (p. ej., Neutral → Buy) |
| `Downgrades` | Recomendación rebajada (p. ej., Buy → Hold)    |
| `Maintains`  | Recomendación sin cambios                      |
| `Initiates`  | Primera recomendación (inicio de cobertura)    |
| `Reiterates` | Reitera la recomendación existente             |

<div id="message-actions">
  ### Acciones de mensajes
</div>

| Acción                | Descripción                  |
| --------------------- | ---------------------------- |
| `created` / `Created` | Nueva calificación publicada |
| `updated` / `Updated` | Calificación modificada      |
| `deleted` / `Deleted` | Calificación eliminada       |

<div id="interactive-commands">
  ## Comandos interactivos
</div>

| Comando  | Descripción                                       |
| -------- | ------------------------------------------------- |
| `ping`   | Mantiene la conexión activa (responde con `pong`) |
| `replay` | Reenvía hasta los últimos 100 mensajes en caché   |

<div id="best-practices">
  ## Mejores prácticas
</div>

* **Seguimiento de cambios**: compare `rating_current` vs `rating_prior` para detectar subidas o bajadas de calificación
* **Movimiento del precio objetivo**: supervise `pt_current` vs `pt_prior` para detectar cambios en el precio objetivo
* **Reputación del analista**: tenga en cuenta el peso de la firma y su historial de precisión
* **Filtro de importancia**: concéntrese en calificaciones de alta importancia (4-5) por su mayor impacto


## AsyncAPI

````yaml asyncapi/calendar-ratings-stream.yml calendarRatings
id: calendarRatings
title: Calendar ratings
description: Send action commands; receive real-time ratings updates
servers:
  - id: production
    protocol: wss
    host: api.benzinga.com/api/v2.1/calendar/ratings
    bindings: []
    variables: []
address: stream
parameters: []
bindings: []
operations:
  - &ref_2
    id: calendarRatings.publish
    title: Calendar ratings.publish
    description: Send commands to the server
    type: receive
    messages:
      - &ref_4
        id: publish
        contentType: text/plain
        payload:
          - type: string
            enum: &ref_0
              - ping
              - replay
            description: Send action commands (ping, replay)
            x-parser-schema-id: <anonymous-schema-1>
            name: publish
        headers: []
        jsonPayloadSchema:
          type: string
          enum: *ref_0
          description: Action to perform (ping for heartbeat, replay for message history)
          x-parser-schema-id: <anonymous-schema-1>
        title: Publish
        description: Send action commands (ping, replay)
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: publish
          - id: x-parser-message-name
            value: ActionRequest
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: calendarRatings
  - &ref_3
    id: calendarRatings.subscribe
    title: Calendar ratings.subscribe
    description: Receive real-time ratings data
    type: send
    messages:
      - &ref_5
        id: subscribe
        contentType: application/json
        payload:
          - name: subscribe
            description: Analyst ratings event
            type: object
            properties:
              - name: id
                type: string
                description: Unique UUID for the websocket response
                required: true
              - name: api_version
                type: string
                description: Websocket API version
                enumValues:
                  - websocket/v1
                required: true
              - name: kind
                type: string
                description: Websocket connection stream type
                enumValues:
                  - data/v2.1/calendar/ratings
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: action
                    type: string
                    description: Websocket data action
                    enumValues:
                      - created
                      - updated
                      - deleted
                      - Created
                      - Updated
                      - Deleted
                    required: true
                  - name: id
                    type: string
                    description: Data ID for the rating
                    required: true
                  - name: timestamp
                    type: string
                    description: Timestamp of the data
                    required: true
                  - name: content
                    type: object
                    required: true
                    properties:
                      - name: id
                        type: string
                        description: Unique ID of this entry
                        required: true
                      - name: date
                        type: string
                        description: Date for rating
                        required: true
                      - name: time
                        type: string
                        description: Time for rating
                        required: false
                      - name: ticker
                        type: string
                        description: >-
                          Ticker symbol of the company that is the subject of
                          the rating
                        required: true
                      - name: exchange
                        type: string
                        description: Exchange (NYSE, NASDAQ, etc...)
                        required: true
                      - name: isin
                        type: string
                        description: International Securities Identification Number
                        required: false
                      - name: cusip
                        type: string
                        description: CUSIP identifier
                        required: false
                      - name: name
                        type: string
                        description: Name of the company that is the subject of the rating
                        required: true
                      - name: currency
                        type: string
                        description: Currency the data is denominated in
                        required: false
                      - name: action_pt
                        type: string
                        description: >-
                          Description of the change in price target from the
                          firm's last price target
                        required: false
                      - name: action_company
                        type: string
                        description: >-
                          Description of the change in rating from the firm's
                          last rating
                        required: false
                      - name: rating_current
                        type: string
                        description: The analyst's current rating for the company
                        required: false
                      - name: pt_current
                        type: string
                        description: Analyst's current price target
                        required: false
                      - name: adjusted_pt_current
                        type: string
                        description: >-
                          Analyst's current price target, adjusted for stock
                          splits and dividends
                        required: false
                      - name: rating_prior
                        type: string
                        description: Prior analyst rating for the company
                        required: false
                      - name: pt_prior
                        type: string
                        description: Analyst's prior price target
                        required: false
                      - name: adjusted_pt_prior
                        type: string
                        description: >-
                          Analyst's prior price target, adjusted for stock
                          splits and dividends
                        required: false
                      - name: url
                        type: string
                        description: >-
                          URL for the analyst ratings page for this ticker on
                          Benzinga.com
                        required: false
                      - name: url_calendar
                        type: string
                        description: >-
                          URL for the analyst ratings page for this ticker on
                          Benzinga.com
                        required: false
                      - name: url_news
                        type: string
                        description: >-
                          URL for the analyst ratings news articles for this
                          ticker on Benzinga.com
                        required: false
                      - name: analyst
                        type: string
                        description: Name of the analyst firm that published the rating
                        required: false
                      - name: analyst_id
                        type: string
                        description: ID of the analyst
                        required: false
                      - name: analyst_name
                        type: string
                        description: Name of the analyst (person) that published the rating
                        required: false
                      - name: firm_id
                        type: string
                        description: Unique identifier for the firm
                        required: false
                      - name: importance
                        type: integer
                        description: >-
                          Subjective basis of how important the event is to the
                          market (5 = High)
                        required: false
                      - name: notes
                        type: string
                        description: >-
                          Additional notes provided by the Benzinga Newsdesk
                          where applicable
                        required: false
                      - name: updated
                        type: integer
                        description: Last updated timestamp in UTC
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - api_version
            - kind
            - data
          properties:
            id:
              type: string
              format: uuid
              description: Unique UUID for the websocket response
              x-parser-schema-id: <anonymous-schema-3>
            api_version:
              type: string
              enum:
                - websocket/v1
              description: Websocket API version
              x-parser-schema-id: <anonymous-schema-4>
            kind:
              type: string
              enum:
                - data/v2.1/calendar/ratings
              description: Websocket connection stream type
              x-parser-schema-id: <anonymous-schema-5>
            data:
              type: object
              required:
                - action
                - id
                - content
                - timestamp
              properties:
                action:
                  type: string
                  enum:
                    - created
                    - updated
                    - deleted
                    - Created
                    - Updated
                    - Deleted
                  description: Websocket data action
                  x-parser-schema-id: <anonymous-schema-7>
                id:
                  type: string
                  description: Data ID for the rating
                  x-parser-schema-id: <anonymous-schema-8>
                timestamp:
                  type: string
                  format: date-time
                  description: Timestamp of the data
                  x-parser-schema-id: <anonymous-schema-9>
                content:
                  type: object
                  required:
                    - id
                    - date
                    - ticker
                    - exchange
                    - name
                  properties:
                    id:
                      type: string
                      description: Unique ID of this entry
                      x-parser-schema-id: <anonymous-schema-11>
                    date:
                      type: string
                      format: date
                      description: Date for rating
                      x-parser-schema-id: <anonymous-schema-12>
                    time:
                      type: string
                      description: Time for rating
                      x-parser-schema-id: <anonymous-schema-13>
                    ticker:
                      type: string
                      description: >-
                        Ticker symbol of the company that is the subject of the
                        rating
                      x-parser-schema-id: <anonymous-schema-14>
                    exchange:
                      type: string
                      description: Exchange (NYSE, NASDAQ, etc...)
                      x-parser-schema-id: <anonymous-schema-15>
                    isin:
                      type: string
                      description: International Securities Identification Number
                      x-parser-schema-id: <anonymous-schema-16>
                    cusip:
                      type: string
                      description: CUSIP identifier
                      x-parser-schema-id: <anonymous-schema-17>
                    name:
                      type: string
                      description: Name of the company that is the subject of the rating
                      x-parser-schema-id: <anonymous-schema-18>
                    currency:
                      type: string
                      description: Currency the data is denominated in
                      x-parser-schema-id: <anonymous-schema-19>
                    action_pt:
                      type: string
                      description: >-
                        Description of the change in price target from the
                        firm's last price target
                      x-parser-schema-id: <anonymous-schema-20>
                    action_company:
                      type: string
                      description: >-
                        Description of the change in rating from the firm's last
                        rating
                      x-parser-schema-id: <anonymous-schema-21>
                    rating_current:
                      type: string
                      description: The analyst's current rating for the company
                      x-parser-schema-id: <anonymous-schema-22>
                    pt_current:
                      type: string
                      description: Analyst's current price target
                      x-parser-schema-id: <anonymous-schema-23>
                    adjusted_pt_current:
                      type: string
                      description: >-
                        Analyst's current price target, adjusted for stock
                        splits and dividends
                      x-parser-schema-id: <anonymous-schema-24>
                    rating_prior:
                      type: string
                      description: Prior analyst rating for the company
                      x-parser-schema-id: <anonymous-schema-25>
                    pt_prior:
                      type: string
                      description: Analyst's prior price target
                      x-parser-schema-id: <anonymous-schema-26>
                    adjusted_pt_prior:
                      type: string
                      description: >-
                        Analyst's prior price target, adjusted for stock splits
                        and dividends
                      x-parser-schema-id: <anonymous-schema-27>
                    url:
                      type: string
                      format: uri
                      description: >-
                        URL for the analyst ratings page for this ticker on
                        Benzinga.com
                      x-parser-schema-id: <anonymous-schema-28>
                    url_calendar:
                      type: string
                      format: uri
                      description: >-
                        URL for the analyst ratings page for this ticker on
                        Benzinga.com
                      x-parser-schema-id: <anonymous-schema-29>
                    url_news:
                      type: string
                      format: uri
                      description: >-
                        URL for the analyst ratings news articles for this
                        ticker on Benzinga.com
                      x-parser-schema-id: <anonymous-schema-30>
                    analyst:
                      type: string
                      description: Name of the analyst firm that published the rating
                      x-parser-schema-id: <anonymous-schema-31>
                    analyst_id:
                      type: string
                      description: ID of the analyst
                      x-parser-schema-id: <anonymous-schema-32>
                    analyst_name:
                      type: string
                      description: Name of the analyst (person) that published the rating
                      x-parser-schema-id: <anonymous-schema-33>
                    firm_id:
                      type: string
                      description: Unique identifier for the firm
                      x-parser-schema-id: <anonymous-schema-34>
                    importance:
                      type: integer
                      minimum: 0
                      maximum: 5
                      description: >-
                        Subjective basis of how important the event is to the
                        market (5 = High)
                      x-parser-schema-id: <anonymous-schema-35>
                    notes:
                      type: string
                      description: >-
                        Additional notes provided by the Benzinga Newsdesk where
                        applicable
                      x-parser-schema-id: <anonymous-schema-36>
                    updated:
                      type: integer
                      format: int64
                      description: Last updated timestamp in UTC
                      x-parser-schema-id: <anonymous-schema-37>
                  x-parser-schema-id: <anonymous-schema-10>
              x-parser-schema-id: <anonymous-schema-6>
          x-parser-schema-id: <anonymous-schema-2>
        title: Subscribe
        description: Analyst ratings event
        example: No examples found
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
          - id: x-parser-message-name
            value: RatingsMessage
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
extensions:
  - id: x-parser-unique-object-id
    value: calendarRatings
securitySchemes:
  - id: tokenAuth
    name: token
    type: httpApiKey
    description: Benzinga WebSocket API token (bz.production***)
    in: query
    extensions: []

````