A server that provides APIs for the Decentraland Marketplace, handling NFTs, sales, orders, and other marketplace-related functionalities.
GET /v1/nfts
- Parameters:
first
(number): Number of items to returnskip
(number): Number of items to skipsortBy
: Sorting criteria (newest
,recently_listed
)isOnSale
(boolean): Filter by items on saleisLand
(boolean): Filter by land parcelscategory
: Filter by category (wearable
,ens
, etc.)owner
: Filter by owner addressrentalStatus
: Filter by rental status (open
,cancelled
,executed
)minDistanceToPlaza
(number): Minimum distance to plaza (for LAND)maxDistanceToPlaza
(number): Maximum distance to plaza (for LAND)adjacentToRoad
(boolean): Filter by parcels adjacent to roadsminEstateSize
(number): Minimum estate sizemaxEstateSize
(number): Maximum estate sizeminPrice
(number): Minimum pricemaxPrice
(number): Maximum priceids
(string[]): Filter by specific NFT IDssearch
(string): Search by textnetwork
(string): Filter by network
- Parameters:
GET /v1/sales
- Parameters:
category
: Filter by category (wearable
, etc.)first
(number): Number of items to returnskip
(number): Number of items to skipsortBy
: Sort by criteria (recently_sold
)contractAddress
: Filter by contract addressitemId
: Filter by item IDnetwork
: Filter by network
- Parameters:
GET /v2/catalog
- Parameters:
first
(number): Number of items to returncategory
: Filter by category (wearable
,emote
)isOnSale
(boolean): Filter items on salesortBy
: Sort by criteria (newest
,recently_sold
,cheapest
,most_expensive
)rarities
(string[]): Filter by raritycreator
(string): Filter by creator addressisSoldOut
(boolean): Filter sold out itemsisWearableHead
(boolean): Filter head wearablesisWearableAccessory
(boolean): Filter accessory wearableswearableCategory
: Filter by wearable categorywearableGenders
(string[]): Filter by wearable genderemoteCategory
: Filter by emote categoryemotePlayMode
: Filter by emote play modecontractAddresses
(string[]): Filter by contract addressesminPrice
(number): Minimum pricemaxPrice
(number): Maximum pricesearch
(string): Search by text
- Parameters:
GET /v1/items
- Parameters:
contractAddress
: Contract address of the collectionitemId
: ID of the itemcategory
: Filter by categorycreator
: Filter by creator addressisSoldOut
(boolean): Filter sold out itemsisOnSale
(boolean): Filter items on salesearch
(string): Search by textisWearableSmart
(boolean): Filter smart wearableswearableCategory
: Filter by wearable categorywearableGenders
(string[]): Filter by wearable genderemoteCategory
: Filter by emote categoryemotePlayMode
: Filter by emote play modenetwork
: Filter by network
- Parameters:
GET /v1/orders
- Parameters:
first
(number): Number of items to returncontractAddress
: Filter by contract addressstatus
: Filter by status (open
)itemId
: Filter by item IDsortBy
: Sort by criteria (cheapest
)owner
: Filter by owner addressbuyer
: Filter by buyer addressnetwork
: Filter by network
- Parameters:
GET /v1/bids
- Parameters:
contractAddress
: Contract address of the itemitemId
: ID of the itemstatus
: Filter by status (open
)bidder
: Filter by bidder addressseller
: Filter by seller address
- Parameters:
GET /v1/rentals-listings
- Parameters:
nftIds
: Array of NFT IDs to get rental informationstatus
: Filter by rental statustenant
: Filter by tenant addresslessor
: Filter by lessor addressrentalDays
(number): Filter by rental period in days
- Parameters:
The repository includes a test script (scripts/test-endpoints.js
) that helps validate the performance and functionality of the endpoints. The script:
- Tests endpoints across different pages (Homepage, Browse, Item Detail)
- Compares response times between local and production environments
- Identifies slow queries (>1s response time)
- Provides detailed performance metrics and status codes
You can run the tests using npm:
npm run test:endpoints
Or directly with node:
node scripts/test-endpoints.js
The script will:
- Test all configured endpoints
- Compare local vs production response times
- Show performance summaries
- Identify slow queries
- Display detailed results with status codes
The script provides:
- Status of each endpoint (✅ success or ❌ failure)
- Response times for both local and production environments
- Performance comparison between environments
- List of slow queries (>1s response time)
- Overall winner summary (local vs production)
- Detailed results for each endpoint
The script tests the following page scenarios:
- Sales endpoints
- NFTs endpoints
- Catalog endpoints
- Items endpoints
- Prices endpoints
- Catalog endpoints with various sorting options
- Items endpoints
- Orders endpoints
- Sales endpoints
- Bids endpoints
To run the server locally:
- Clone the repository:
git clone https://github.com/decentraland/marketplace-server.git
cd marketplace-server
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Run the server in development mode with hot reload:
npm run start:watch
For detailed development instructions, please refer to the development documentation.