Moralis Get Market Data API

The Get Market Data API from Moralis — 11 operation(s) for get market data.

OpenAPI Specification

moralis-get-market-data-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: EVM Balance Get Market Data API
  version: '2.2'
servers:
- url: https://deep-index.moralis.io/api/v2.2
security:
- ApiKeyAuth: []
tags:
- name: Get Market Data
paths:
  /nft/{address}/nfts-by-traits:
    post:
      security:
      - ApiKeyAuth: []
      summary: Get NFTs by traits
      description: Find NFTs in a contract matching specific traits, perfect for attribute-based searches.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTByContractTraits
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: path
        name: address
        description: The address of the NFT contract
        required: true
        schema:
          type: string
          example: '0x524cab2ec69124574082676e6f654a18df49a048'
      - in: query
        name: limit
        description: The desired page size of the result.
        required: false
        schema:
          type: integer
          minimum: 1
          default: 100
      - in: query
        name: cursor
        description: The cursor returned in the previous response (used for getting the next page).
        schema:
          type: string
      - in: query
        name: format
        description: The format of the token ID
        required: false
        schema:
          type: string
          example: decimal
          default: decimal
          enum:
          - decimal
          - hex
      - in: query
        name: normalizeMetadata
        description: Should normalized metadata be returned?
        required: false
        schema:
          type: boolean
          default: false
      - in: query
        name: media_items
        description: Should preview media data be returned?
        required: false
        schema:
          type: boolean
          default: false
      requestBody:
        description: Body
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                traits:
                  type: object
                  minItems: 1
                  maxItems: 25
              example:
                traits:
                  Legendary: Astronaut
              required:
              - traits
      responses:
        '200':
          description: Returns a collection of NFTs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/nftCollection'
      x-mcp-prompt: Provide the contract address and trait filters to find matching NFTs. Use this when users ask for NFTs with specific attributes (e.g., rare traits) or are searching for unique items in a collection.
  /nft/{address}/traits:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT traits by collection
      description: Explore the distinct traits of NFTs in a contract, showcasing their unique attributes.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTTraitsByCollection
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: path
        name: address
        description: The address of the NFT contract
        required: true
        schema:
          type: string
          example: '0x524cab2ec69124574082676e6f654a18df49a048'
      responses:
        '200':
          description: Returns the traits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/groupedTraitCollection'
      x-mcp-prompt: Enter the contract address to retrieve its NFT traits. Use this when users want to understand the trait distribution of a collection or analyze NFT characteristics.
  /nft/{address}/traits/paginate:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT traits by collection paginate
      description: Fetch NFT traits for a contract with pagination for efficient navigation of large collections.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTTraitsByCollectionPaginate
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: path
        name: address
        description: The address of the NFT contract
        required: true
        schema:
          type: string
          example: '0x524cab2ec69124574082676e6f654a18df49a048'
      - in: query
        name: cursor
        description: The cursor returned in the previous response (used for getting the next page).
        required: false
        schema:
          type: string
      - in: query
        name: limit
        description: The desired page size of the result.
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: order
        description: The order of the result, in ascending (ASC) or descending (DESC)
        required: false
        schema:
          $ref: '#/components/schemas/orderList'
      responses:
        '200':
          description: Returns the traits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/traitCollection'
      x-mcp-prompt: Submit the contract address and pagination settings like `limit` or `cursor` for NFT traits. Use this when users need paginated trait data for large NFT collections or are building trait-based analytics.
  /nft/{address}/traits/resync:
    get:
      security:
      - ApiKeyAuth: []
      summary: Resync NFT Trait
      description: Refresh trait and rarity data for NFTs in a contract to ensure accuracy.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: resyncNFTRarity
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: path
        name: address
        description: The address of the NFT contract
        required: true
        schema:
          type: string
          example: '0x524cab2ec69124574082676e6f654a18df49a048'
      responses:
        '202':
          description: The resync request was received and will be executed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metadataResync'
      x-mcp-prompt: Provide the contract address to resync its NFT trait data. Use this when users report outdated rarity data or want to ensure the latest trait information for a collection.
  /nft/{address}/trades:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT trades by collection
      description: Get NFT trades for a given contract with the ability to filter by marketplace.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTTrades
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: query
        name: from_block
        description: 'The minimum block number from which to get the transfers

          * Provide the param ''from_block'' or ''from_date''

          * If ''from_date'' and ''from_block'' are provided, ''from_block'' will be used.

          '
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: to_block
        description: The block number to get the trades from
        required: false
        schema:
          type: string
      - in: query
        name: from_date
        description: 'The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)

          * Provide the param ''from_block'' or ''from_date''

          * If ''from_date'' and ''from_block'' are provided, ''from_block'' will be used.

          '
        required: false
        schema:
          type: string
      - in: query
        name: to_date
        description: 'The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)

          * Provide the param ''to_block'' or ''to_date''

          * If ''to_date'' and ''to_block'' are provided, ''to_block'' will be used.

          '
        required: false
        schema:
          type: string
      - in: query
        name: marketplace
        description: Marketplace from which to get the trades. See [supported Marketplaces](https://docs.moralis.io/web3-data-api/evm/nft-marketplaces).
        example: opensea
        required: false
        schema:
          type: string
          example: opensea
          default: opensea
          enum:
          - opensea
          - blur
          - looksrare
          - x2y2
          - 0xprotocol
      - in: query
        name: cursor
        description: The cursor returned in the previous response (used for getting the next page).
        required: false
        schema:
          type: string
      - in: query
        name: limit
        description: The desired page size of the result.
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: nft_metadata
        description: Include the NFT Metadata of the NFT Token
        required: false
        schema:
          type: boolean
          default: true
      - in: path
        name: address
        description: The address of the NFT contract
        required: true
        schema:
          type: string
          example: '0x524cab2ec69124574082676e6f654a18df49a048'
      responses:
        '200':
          description: Returns the trades
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tradeCollection'
      x-mcp-prompt: Enter the contract address to fetch NFT trade data. Optionally, include a marketplace filter. Use this when users ask for trading history of a collection or want to analyze marketplace activity.
  /nft/{address}/{token_id}/trades:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT trades by token
      description: Get NFT trades for a specific NFT by specifying a contract addres and token ID.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTTradesByToken
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: query
        name: from_block
        description: 'The minimum block number from which to get the transfers

          * Provide the param ''from_block'' or ''from_date''

          * If ''from_date'' and ''from_block'' are provided, ''from_block'' will be used.

          '
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: to_block
        description: The block number to get the trades from
        required: false
        schema:
          type: string
      - in: query
        name: from_date
        description: 'The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)

          * Provide the param ''from_block'' or ''from_date''

          * If ''from_date'' and ''from_block'' are provided, ''from_block'' will be used.

          '
        required: false
        schema:
          type: string
      - in: query
        name: to_date
        description: 'The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)

          * Provide the param ''to_block'' or ''to_date''

          * If ''to_date'' and ''to_block'' are provided, ''to_block'' will be used.

          '
        required: false
        schema:
          type: string
      - in: query
        name: cursor
        description: The cursor returned in the previous response (used for getting the next page).
        required: false
        schema:
          type: string
      - in: query
        name: limit
        description: The desired page size of the result.
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: nft_metadata
        description: Include the NFT Metadata of the NFT Token
        required: false
        schema:
          type: boolean
          default: true
      - in: path
        name: address
        description: The address of the NFT contract
        required: true
        schema:
          type: string
          example: '0x524cab2ec69124574082676e6f654a18df49a048'
      - in: path
        name: token_id
        description: The token ID of the NFT contract
        required: true
        schema:
          type: string
          example: '123'
      responses:
        '200':
          description: Returns the trades
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tradeCollection'
      x-mcp-prompt: Provide the contract address and token ID to view the NFT’s trade history. Use this when users want trade details for a specific NFT or are tracking its market activity.
  /wallets/{address}/nfts/trades:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT trades by wallet address
      description: Get NFT trades for a specific wallet address.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTTradesByWallet
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: query
        name: from_block
        description: 'The minimum block number from which to get the transfers

          * Provide the param ''from_block'' or ''from_date''

          * If ''from_date'' and ''from_block'' are provided, ''from_block'' will be used.

          '
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: to_block
        description: The block number to get the trades from
        required: false
        schema:
          type: string
      - in: query
        name: from_date
        description: 'The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)

          * Provide the param ''from_block'' or ''from_date''

          * If ''from_date'' and ''from_block'' are provided, ''from_block'' will be used.

          '
        required: false
        schema:
          type: string
      - in: query
        name: to_date
        description: 'The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)

          * Provide the param ''to_block'' or ''to_date''

          * If ''to_date'' and ''to_block'' are provided, ''to_block'' will be used.

          '
        required: false
        schema:
          type: string
      - in: query
        name: cursor
        description: The cursor returned in the previous response (used for getting the next page).
        required: false
        schema:
          type: string
      - in: query
        name: limit
        description: The desired page size of the result.
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: nft_metadata
        description: Include the NFT Metadata of the NFT Token
        required: false
        schema:
          type: boolean
          default: true
      - in: path
        name: address
        description: The owner wallet address
        required: true
        schema:
          type: string
          example: '0xcB1C1FdE09f811B294172696404e88E658659905'
      responses:
        '200':
          description: Returns the trades
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tradeCollection'
      x-mcp-prompt: Input the wallet address to retrieve its NFT trade history. Use this when users ask about a wallet’s NFT trading activity or want to review their buy/sell history.
  /nft/{address}/price:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT sale prices by collection
      description: Fetch sale prices for NFTs in a contract over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTContractSalePrices
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: query
        name: days
        description: 'The number of days to look back to find the lowest price

          If not provided 7 days will be the default and 365 is the maximum

          '
        required: false
        schema:
          type: integer
          minimum: 0
      - in: path
        name: address
        description: The address of the NFT collection
        required: true
        schema:
          type: string
          example: '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'
      responses:
        '200':
          description: Returns the sold price details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/soldPrice'
      x-mcp-prompt: Enter the contract address and time period to retrieve NFT sale prices. Use this when users ask for recent sale prices of a collection or are analyzing market trends.
  /nft/{address}/{token_id}/price:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get NFT sale prices by token
      description: Fetch sale prices for a specific NFT over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period.
      tags:
      - Get Market Data
      x-tag-sdk: nft
      operationId: getNFTSalePrices
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: query
        name: days
        description: 'The number of days to look back to find the lowest price

          If not provided 7 days will be the default and 365 is the maximum

          '
        required: false
        schema:
          type: integer
          minimum: 0
      - in: path
        name: address
        description: The address of the NFT collection
        required: true
        schema:
          type: string
          example: '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'
      - in: path
        name: token_id
        description: The token id of the NFT collection
        required: true
        schema:
          type: string
          example: '1'
      responses:
        '200':
          description: Returns the sold price details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/soldPrice'
      x-mcp-prompt: Provide the contract address, token ID, and time period for NFT sale prices. Use this when users want sale history for a specific NFT or are tracking its value.
  /erc20/{address}/price:
    get:
      security:
      - ApiKeyAuth: []
      summary: Get ERC20 token price
      description: Retrieve the current or historical price of an ERC20 token in the blockchain’s native currency and USD. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens.
      tags:
      - Get Market Data
      x-tag-sdk: token
      operationId: getTokenPrice
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: path
        name: address
        description: The address of the token contract
        required: true
        schema:
          type: string
          example: '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
      - in: query
        name: exchange
        description: The factory name or address of the token exchange
        required: false
        schema:
          type: string
      - in: query
        name: to_block
        description: The block number from which the token price should be checked
        required: false
        schema:
          type: integer
          minimum: 0
      - in: query
        name: include
        description: This parameter is now deprecated as percentage change are included by default
        required: false
        deprecated: true
        schema:
          type: string
          example: ''
          default: ''
          enum:
          - percent_change
      - in: query
        name: max_token_inactivity
        description: Exclude tokens inactive for more than the given amount of days
        required: false
        schema:
          type: number
      - in: query
        name: min_pair_side_liquidity_usd
        description: Exclude tokens with liquidity less than the specified amount in USD. This parameter refers to the liquidity on a single side of the pair.
        required: false
        schema:
          type: number
      responses:
        '200':
          description: Returns the price denominated in the blockchain's native token and USD for a given token contract address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/erc20Price'
      x-mcp-prompt: Enter the token contract address to fetch its price. Use this when users ask for the current price of an ERC20 token or the historical price of a token at a point in time, or simply need price data for trading.
  /erc20/prices:
    post:
      security:
      - ApiKeyAuth: []
      summary: Get Multiple ERC20 token prices
      description: Retrieve the current or historical prices for multiple ERC20 tokens in the blockchain’s native currency and USD. Accepts an array of up to 100 `tokens`, each requiring `token_address` and optional fields such as `to_block` or `exchange`. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens.
      tags:
      - Get Market Data
      x-tag-sdk: token
      operationId: getMultipleTokenPrices
      requestBody:
        description: Body
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetMultipleTokenPricesDto'
      parameters:
      - in: query
        name: chain
        description: The chain to query
        required: false
        schema:
          $ref: '#/components/schemas/chainList'
      - in: query
        name: include
        description: This parameter is now deprecated as percentage change are included by default
        required: false
        deprecated: true
        schema:
          type: string
          example: ''
          default: ''
          enum:
          - percent_change
      - in: query
        name: max_token_inactivity
        description: Exclude tokens inactive for more than the given amount of days
        required: false
        schema:
          type: number
      - in: query
        name: min_pair_side_liquidity_usd
        description: Exclude tokens with liquidity less than the specified amount in USD. This parameter refers to the liquidity on a single side of the pair.
        required: false
        schema:
          type: number
      responses:
        '200':
          description: Returns an array of token prices denominated in the blockchain's native token and USD for a given token contract address
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/erc20Price'
      x-mcp-prompt: Submit a list of token contract addresses to retrieve their prices. Use this when users need price data for one or many tokens or are comparing market values.
components:
  schemas:
    tokenPriceItem:
      required:
      - token_address
      properties:
        token_address:
          type: string
          description: The contract address
          example: '0x06012c8cf97bead5deae237070f9587f8e7a266d'
        exchange:
          type: string
          description: The exchange
          example: uniswapv3
        to_block:
          type: string
          description: The block number
          example: 12526958
    traitCollection:
      required:
      - result
      properties:
        page:
          type: integer
          description: The current page of the result
          example: '2'
        page_size:
          type: integer
          description: The number of results per page
          example: '100'
        cursor:
          type: string
          description: The cursor to get to the next page
        result:
          type: array
          items:
            $ref: '#/components/schemas/trait'
    nftCollection:
      required:
      - result
      properties:
        page:
          type: integer
          description: The current page of the result
          example: '2'
        page_size:
          type: integer
          description: The number of results per page
          example: '100'
        cursor:
          type: string
          description: The cursor to get to the next page
        result:
          type: array
          items:
            $ref: '#/components/schemas/nft'
    mediaCollection:
      properties:
        low:
          description: Preview media file, lowest quality (for images 100px x 100px)
          $ref: '#/components/schemas/mediaItem'
        medium:
          description: Preview media file, medium quality (for images 250px x 250px)
          $ref: '#/components/schemas/mediaItem'
        high:
          description: Preview media file, highest quality (for images 500px x 500px)
          $ref: '#/components/schemas/mediaItem'
      required:
      - original
      - low
      - medium
      - high
    orderList:
      type: string
      example: DESC
      default: DESC
      enum:
      - ASC
      - DESC
    groupedTraitCollection:
      required:
      - result
      properties:
        traits:
          type: array
          items:
            $ref: '#/components/schemas/groupedTrait'
    trait:
      required:
      - trait_type
      - trait_value
      - count
      - percentage
      - rarity_label
      properties:
        trait_type:
          type: string
          description: The trait type
          example: Background
        trait_value:
          type: string
          description: The trait value
          example: Lavendar
        count:
          type: number
          description: The total NFT in the collection with this trait
          example: 18593
        percentage:
          type: number
          description: The rarity percentage of the trait
          example: 85.8
        rarity_label:
          type: string
          description: The rarity label of the trait
          example: Top 4% trait
    erc20Price:
      required:
      - usdPrice
      - possibleSpam
      - verifiedContract
      properties:
        tokenName:
          type: string
          description: The name of the token
          example: Kylin Network
        tokenSymbol:
          type: string
          description: The symbol of the token
          example: KYL
        tokenLogo:
          type: string
          description: The logo of the token
          example: https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png
        tokenDecimals:
          type: string
          description: The number of decimals of the token
          example: '18'
        nativePrice:
          $ref: '#/components/schemas/nativeErc20Price'
        usdPrice:
          type: number
          format: double
          description: The price in USD for the token
          example: 19.722370676
        usdPriceFormatted:
          type: string
          description: The price in USD for the token in string format
          example: '19.722370676'
        24hrPercentChange:
          type: string
          description: The 24hr percent change of the token
          example: '-0.8842730258590583'
        exchangeAddress:
          type: string
          description: The address of the exchange used to calculate the price
          example: '0x1f98431c8ad98523631ae4a59f267346ea31f984'
        exchangeName:
          type: string
          description: The name of the exchange used to calculate the price
          example: Uniswap v3
        tokenAddress:
          type: string
          description: The address of the token
          example: '0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c'
        toBlock:
          type: string
          description: toBlock
          example: '16314545'
        possibleSpam:
          type: boolean
          description: Indicates if a contract is possibly a spam contract
          example: 'false'
        verifiedContract:
          type: boolean
          description: Indicates if the contract is verified
          example: true
        pairAddress:
          type: string
          description: The address of the pair
          example: '0x1f98431c8ad98523631ae4a59f267346ea31f984'
        pairTotalLiquidityUsd:
          type: string
          description: The total liquidity in USD of the pair
          example: '123.45'
        usdPrice24h:
          type: number
          description: The USD price 24 hours ago
          example: 1
        usdPrice24hrUsdChange:
          type: number
          description: The USD change in price over the last 24 hours
          example: -8.615972490000345e-05
        usdPrice24hrPercentChange:
          type: number
          description: The percent change in USD price over the last 24 hours
          example: -0.008615972490000345
        securityScore:
          type: number
          description: A number between 0 and 100 that defines the trust level of this specific token
          example: 1
    mediaItem:
      properties:
        width:
          type: integer
          description: The width of the preview image.
        height:
          type: integer
          description: The height of the preview image.
        url:
          type: string
          description: The url of the preview file.
      required:
      - width
      - height
      - url
    groupedTrait:
      required:
      - trait_type
      - values
      properties:
        trait_type:
          type: string
          description: The trait type
          example: Background
        values:
          type: array
          items:
            description: The trait values
            required:
            - trait_value
            - count
            - percentage
            - rarity_label
            properties:
              trait_value:
                type: string
                description: The trait value
                example: Lavendar
              count:
                type: number
                description: The total NFT in the collection with this trait
                example: 18593
              percentage:
                type: number
                description: The rarity percentage of the trait
                example: 85.8
              rarity_label:
                type: string
                description: The rarity label of the trait
                example: Top 4% trait
    tradeCollection:
      required:
      - result
      properties:
        page:
          type: integer
          description: The current page of the result
          example: '2'
        page_size:
          type: integer
          description: The number of results per page
          example: '100'
        cursor:
          type: string
          description: The cursor to get to the next page
        result:
          type: array
          items:
            $ref: '#/components/schemas/trade'
    normalizedMetadata:
      properties:
        name:
          

# --- truncated at 32 KB (56 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/moralis/refs/heads/main/openapi/moralis-get-market-data-api-openapi.yml