This repository contains a simple API built with Node.js and Express. The API provides endpoints for retrieving data about Ethereum addresses and NFT collections.
- Clone the repository.
- Run npm install to install the necessary dependencies.
- Create a .env file in the root directory of the project and add the following environment variables:
PORT=<port-number>
API_KEY=<api-key>
Replace with the port number you want to use for the server, and with your Ethereum API key.
- Run npm start to start the server.
The API provides the following endpoints:
- GET /age/:address - Returns the age in years of the provided Ethereum address.
- GET /age/collection/:contract - Returns the average age in years of all the addresses that own NFTs from the specified collection.
- GET /age/collection/:address/each - Returns the ages in years of all the addresses that own NFTs from the specified collection.
- GET /nft/:address - Returns all the NFTs owned by the specified Ethereum address.
- GET /nft/collection/:address - Returns all the NFTs owned by all the addresses that own NFTs from the specified collection.
- GET /nft/collection/:address/common - Returns top 3 nft contracts that are common among all owners of specific collection