Markets

A market represents a place where stocks are traded, such as a stock exchange. Each market belongs to a country and has its own code.

The market model

The market model contains identifying information for a market, including its name, code, type, and the country it belongs to.

Properties

    Name
    id
    Type
    string
    Description

    The stock exchange's auto-generated unique identifier.

    Name
    name
    Type
    string
    Description

    The name of the stock exchange.

    Name
    code
    Type
    string
    Description

    The code of the stock exchange.

    Name
    tvCode
    Type
    string
    Description

    The TradingView code of the stock exchange. The value is null if the market is not supported by TradingView embeddable widgets.

    Name
    isTvEmbeddable
    Type
    boolean
    Description

    Whether the market is supported by TradingView embeddable widgets.

    Name
    type
    Type
    enum
    Description

    The type of market.

    Possible values: STOCK

    Name
    countryId
    Type
    string
    Description

    The ID of the country this stock exchange belongs to.

    Name
    createdAt
    Type
    string
    Description

    The date and time the stock exchange was created in Moon Banking.

    Name
    updatedAt
    Type
    string
    Description

    The date and time the stock exchange was last updated in Moon Banking.


GET/markets

GET /markets

This endpoint allows you to retrieve a paginated list of markets (e.g. stock exchanges). You can search by name or code, filter by exact code, country, or market type, and sort the results.

Optional parameters

    Name
    limit
    Type
    integer
    Constraints
    min1max100
    Default
    default10
    Description

    Number of items to return.

    Name
    starting_after
    Type
    string
    Description

    Cursor for forward pagination. Use the id of the last item from the previous page to get the next page.

    Name
    ending_before
    Type
    string
    Description

    Cursor for backward pagination. Use the id of the first item from the current page to get the previous page.

    Name
    search
    Type
    string
    Description

    Search markets by name or code.

    Name
    code
    Type
    string
    Description

    Filter by exact market code (case sensitive).

    Name
    countryCode
    Type
    string
    Description

    Filter by 2-letter ISO country code.

    Name
    type
    Type
    enum
    Description

    Filter by market type.

    Possible values: STOCK

    Name
    sortBy
    Type
    enum
    Default
    default"name"
    Description

    Field to sort by.

    Possible values: name, code, createdAt

    Name
    sortOrder
    Type
    enum
    Default
    default"asc"
    Description

    Sort order. Either ascending or descending.

    Possible values: asc, desc

Request

GET
/markets
curl -G https://api.moonbanking.com/v1/markets \
  -H "Authorization: Bearer {your_api_key}" \
  -H "Moon-Banking-Version: 2025-07-11" \
  --data-urlencode "limit=20" \
  --data-urlencode "starting_after=8HsY5nBc7jAqM4u" \
  --data-urlencode "ending_before=6jkxE4N8gHXgDPK" \
  --data-urlencode "search=New%20York" \
  --data-urlencode "code=NYSE" \
  --data-urlencode "countryCode=US" \
  --data-urlencode "type=STOCK" \
  --data-urlencode "sortBy=name" \
  --data-urlencode "sortOrder=asc"

Response

{
  "success": true,
  "data": [
    {
      "id": "5bKqNzTx8mLrW3v",
      "name": "New York Stock Exchange",
      "code": "NYSE",
      "tvCode": "NYSE",
      "isTvEmbeddable": true,
      "type": "STOCK",
      "countryId": "5bKqNzTx8mLrW3v",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    },
    ...
  ],
  "pagination": {
    "hasMore": true,
    "limit": 20,
    "nextCursor": "8HsY5nBc7jAqM4u",
    "previousCursor": "6jkxE4N8gHXgDPK",
    "meta": {
      "total": 42
    }
  },
  "message": "Sample message",
  "timestamp": "2026-04-09T00:39:30.636Z",
  "version": "2025-07-11"
}

GET/markets/:id

GET /markets/:id

This endpoint allows you to retrieve a specific market (e.g. stock exchange) by providing the market id.

Required parameters

    Name
    id
    Type
    string
    Description

    The stock exchange's auto-generated unique identifier.

Request

GET
/markets/:id
curl -G https://api.moonbanking.com/v1/markets/5bKqNzTx8mLrW3v \
  -H "Authorization: Bearer {your_api_key}" \
  -H "Moon-Banking-Version: 2025-07-11"

Response

{
  "success": true,
  "data": {
    "id": "5bKqNzTx8mLrW3v",
    "name": "New York Stock Exchange",
    "code": "NYSE",
    "tvCode": "NYSE",
    "isTvEmbeddable": true,
    "type": "STOCK",
    "countryId": "5bKqNzTx8mLrW3v",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  },
  "message": "Sample message",
  "timestamp": "2026-04-09T00:39:30.636Z",
  "version": "2025-07-11"
}

Was this page helpful?