A REST API service that indexes and serves Sui blockchain NFT collection data.
Retrieve a specific NFT by its ID.
Response:
{
"id": "string",
"name": "string",
"type": "string",
"rank": number,
"imageUrl": "string",
"attributes": [
{
"key": "string",
"value": "string"
}
]
}Returns 404 if NFT not found. Includes aggressive cache headers (1 year immutable) since NFT metadata rarely changes after minting.
Delete an entire NFT collection by type (requires API key).
Headers:
Authorization: Bearer YOUR_API_KEY
Response:
{
"message": "Collection deleted"
}Returns 401 if unauthorized.
- Bun runtime
- SQLite database
# Install dependencies
bun install
# Generate database schema
bun run db:gen
# Run database migrations
bun run db:migrate
# Start the service
bun run startPORT- Server port (default: 3232)NODE_ENV- Environment (development/production)API_KEY- Required for DELETE operations
Edit data/index-data.json to specify which NFT collections to index:
{
"to_index": [
"0x7c02d0be6b6dfaeaf8aeebdf0967cb6f0f5c187c86e3b054e27c195bea30c9b5::puggies::Puggies",
"0x8f74a7d632191e29956df3843404f22d27bd84d92cca1b1abde621d033098769::rootlet::Rootlet"
]
}The service automatically indexes collections on startup and calculates rarity scores.