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

# How to Get NFT Floor Prices

> Learn how to fetch NFT collection floor prices using the Moralis API.

## Introduction

In this tutorial, you'll learn how to retrieve floor prices for any NFT collection using the Moralis API. Floor prices represent the lowest listed price for an NFT in a collection, which is a key metric for understanding collection value and market trends. We'll use the following Moralis API endpoint:

* [Get NFT Floor Price](/data-api/evm/nft/prices/collection-floor-price) - Fetch the current floor price for an NFT collection

## Prerequisites

* Node.js v18+ installed
* A Moralis API key ([get one free](https://admin.moralis.io))

## Step 1: Set Up Your Project

Create a new directory for your project and initialize it:

```bash theme={null}
mkdir get-nft-floor-price && cd get-nft-floor-price
npm init -y
```

## Step 2: Create the Script

Create a file called `index.js` and add the following code:

```javascript theme={null}
// index.js
const API_KEY = 'YOUR_API_KEY';
const NFT_ADDRESS = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'; // BAYC

async function getFloorPrice() {
  const response = await fetch(
    `https://deep-index.moralis.io/api/v2.2/nft/${NFT_ADDRESS}/floor-price?chain=eth`,
    {
      headers: {
        'X-API-Key': API_KEY,
      },
    }
  );

  const data = await response.json();
  console.log(JSON.stringify(data, null, 2));
}

getFloorPrice();
```

Replace `YOUR_API_KEY` with your actual Moralis API key.

## Step 3: Run the Script

Execute the script to fetch the floor price:

```bash theme={null}
node index.js
```

## Example Response

```json theme={null}
{
  "floor_price": 25.5,
  "floor_price_usd": 89250.75,
  "floor_price_currency": "ETH",
  "marketplace": "opensea",
  "marketplace_logo": "https://cdn.moralis.io/marketplaces/opensea.png",
  "last_updated": "2024-01-15T10:30:00.000Z"
}
```

## Understanding the Response

| Field                  | Description                           |
| ---------------------- | ------------------------------------- |
| `floor_price`          | Floor price in native token (ETH)     |
| `floor_price_usd`      | Floor price converted to USD          |
| `floor_price_currency` | Currency of the floor price           |
| `marketplace`          | Marketplace where floor was found     |
| `marketplace_logo`     | Logo URL of the marketplace           |
| `last_updated`         | When the floor price was last updated |

## Next Steps

* [Get All Wallet NFTs](/get-started/tutorials/data-api/nfts/get-all-nfts-owned-by-a-wallet-address) - Fetch NFTs for a wallet
* [Get NFT Metadata](/get-started/tutorials/data-api/nfts/get-nft-metadata-by-contract-and-token-id) - Get detailed NFT info
* [Get NFT Owners](/get-started/tutorials/data-api/nfts/get-nft-owners-and-ownership-details) - Get ownership data
* [API Reference](/data-api/evm/nft/prices/collection-floor-price) - Full API documentation
