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

# Stream trades

> Server-sent events. Sends a `trade` event with a `Trade` as its JSON data the moment each trade is indexed, plus a keep-alive comment every 20 seconds.

```js
const source = new EventSource("https://api.veto.fun/api/tokens/<mint>/stream");
source.addEventListener("trade", (e) => console.log(JSON.parse(e.data)));
```




## OpenAPI

````yaml /api-reference/openapi.yaml get /api/tokens/{mint}/stream
openapi: 3.1.0
info:
  title: Veto API
  version: 1.0.0
  description: >-
    Public API behind veto.fun. Coins, payouts, wallets, launches, trades and
    vetoes.
servers:
  - url: https://api.veto.fun
    description: Production
  - url: http://localhost:4000
    description: Local development
security: []
tags:
  - name: Platform
  - name: Coins
  - name: Payouts
  - name: Veto
  - name: Launch and trade
paths:
  /api/tokens/{mint}/stream:
    get:
      tags:
        - Coins
      summary: Stream trades
      description: >
        Server-sent events. Sends a `trade` event with a `Trade` as its JSON
        data the moment each trade is indexed, plus a keep-alive comment every
        20 seconds.


        ```js

        const source = new
        EventSource("https://api.veto.fun/api/tokens/<mint>/stream");

        source.addEventListener("trade", (e) =>
        console.log(JSON.parse(e.data)));

        ```
      operationId: streamTokenTrades
      parameters:
        - $ref: '#/components/parameters/Mint'
      responses:
        '200':
          description: An open `text/event-stream`.
          content:
            text/event-stream:
              schema:
                type: string
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    Mint:
      name: mint
      in: path
      required: true
      description: The coin's mint address.
      schema:
        type: string
  responses:
    NotFound:
      description: Not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Token not found
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A message you can show to users as-is.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.