A web-based SaaS for Tracking Cryptocurrencies, NFTs, and Stocks
Link for Live Demo
- Real-time Tracking: View up-to-date prices and details for cryptocurrencies, NFTs, and stocks all in one place.
- Powerful Search & Filtering: Quickly find assets with advanced search and filtering options tailored for crypto, NFTs, and stocks.
- Historical Data: Access historical price data to analyze long-term trends.
- Theme Customization: Choose between different visual themes to personalize your experience.
- Customizable Charts: Switch between multiple chart types to analyze asset performance visually.
- Interactive Charts: Visualize asset trends using dynamic charts powered by Recharts.
- Framework: React
- Language: TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Data Fetching & Caching: React Query
- Charting Library: Recharts
- API Integration: External APIs for Crypto Currencies, NFTs, and Stocks data
- Clone the repository:
git clone https://github.com/rveljko/coincastle.git
- Navigate into the project directory:
cd coincastle - Install dependencies:
npm install
- Configure environment variables:
-
Create a
.envfile in the root directory with the following variables:VITE_PUBLIC_POSTHOG_KEY= VITE_PUBLIC_POSTHOG_HOST= VITE_COINGECKO_API_KEY= VITE_MORALIS_API_KEY= VITE_FMP_API_KEY= -
You can get your API keys from these sites:
- PostHog: https://us.posthog.com/signup
- CoinGecko API key: https://www.coingecko.com/account/sign_up
- Moralis API key: https://admin.moralis.com/register
- Financial Modeling Prep API key: https://site.financialmodelingprep.com/register
- Start the development server:
npm run dev
- Open your browser and navigate to:
http://localhost:5173
https://api.coingecko.com/api/v3
All cryptocurrency API requests require the X-Cg-Demo-API-Key header with your CoinGecko API key.
GET /coins/markets
List supported cryptocurrencies with market data such as current price, market cap, and volume.
Query Parameters:
vs_currency(string, required) — Currency to compare against (e.g.,usd)order(string, required) — Order results by a field and direction. Format:{sortField}_{sortDirection}, e.g.,market_cap_descper_page(integer, optional) — Number of coins to return per page (default varies)
Example Request:
GET /coins/markets?vs_currency=usd&order=market_cap_desc&per_page=50
X-Cg-Demo-API-Key: YOUR_API_KEYResponse:
Array of cryptocurrency market data objects including price, market cap, and 24h volume.
GET /coins/{id}
Retrieve detailed information about a specific coin by its ID.
Example Request:
GET /coins/bitcoin
X-Cg-Demo-API-Key: YOUR_API_KEYResponse:
Includes coin metadata, market data, description, links, developer and community stats.
GET /coins/{id}/market_chart
Get historical market chart data for a coin.
Query Parameters:
vs_currency(string, required) — Comparison currency (e.g.,usd)days(string or number, required) — Number of days to fetch data for (e.g.,1,30,max)
Example Request:
GET /coins/bitcoin/market_chart?vs_currency=usd&days=30
X-Cg-Demo-API-Key: YOUR_API_KEYResponse:
Time-series data including prices, market caps, and total volumes over the period.
GET /search
Search cryptocurrencies by query string.
Query Parameters:
query(string, required) — Search term to match coin name or symbol
Example Request:
GET /search?query=bitcoin
X-Cg-Demo-API-Key: YOUR_API_KEYResponse:
List of matching cryptocurrencies with IDs and symbols for further queries.
If a request fails, the API returns an error status and a message such as:
'Failed to fetch all cryptocurrencies. Please check your connection and try again.''Failed to fetch coin information. Ensure the coin symbol or ID is correct and try again.''Failed to fetch coin chart information. Check the coin symbol or ID and time period, then try again.''Failed to fetch cryptocurrencies by search. Please check your connection and try again.'
https://deep-index.moralis.io/api/v2.2
All NFT API requests require the X-API-Key header containing your Moralis API key.
GET /market-data/nfts/hottest-collections
Fetches a list of the hottest NFT collections.
Example Request:
GET /market-data/nfts/hottest-collections
X-API-Key: YOUR_API_KEYResponse: Returns an overview list of NFT collections.
GET /nft/{contractAddress}/metadata
Fetch detailed info about a specific NFT collection by contract address.
Example Request:
GET /nft/0xabc123...def/metadata
X-API-Key: YOUR_API_KEYResponse: Detailed metadata and attributes of the NFT collection.
GET /nft/{contractAddress}/price
Get statistical data for an NFT collection.
Example Request:
GET /nft/0xabc123...def/price
X-API-Key: YOUR_API_KEYResponse: Includes metrics like price trends, volume, and other statistics.
GET /nft/{contractAddress}?cursor={cursor}&limit={limit}&normalizeMetadata=true&include_prices=true
Fetch NFTs belonging to a specific collection with pagination and metadata normalization.
Query Parameters:
cursor(string) — Pagination cursor for next pagelimit(number) — Number of NFTs to return
Example Request:
GET /nft/0xabc123...def?cursor=xyz123&limit=20&normalizeMetadata=true&include_prices=true
X-API-Key: YOUR_API_KEYResponse: List of NFTs with pagination support and price info.
GET /nft/{contractAddress}/{tokenId}
Fetch detailed information for a single NFT by contract address and token ID.
Example Request:
GET /nft/0xabc123...def/1
X-API-Key: YOUR_API_KEYResponse: Metadata and detail of the specific NFT.
GET /{walletAddress}/nft?chain=eth&format=decimal&cursor={cursor}&limit={limit}&normalizeMetadata=true&include_prices=true
Retrieve NFTs owned by a wallet address with pagination and metadata normalization.
Query Parameters:
cursor(string) — Pagination cursorlimit(number) — Number of NFTs to return
Example Request:
GET /0xwallet123/nft?chain=eth&format=decimal&cursor=abc123&limit=20&normalizeMetadata=true&include_prices=true
X-API-Key: YOUR_API_KEYResponse: Paginated list of NFTs owned by the wallet.
GET /wallets/{walletAddress}/stats?chain=eth
Get overall NFT statistics for a wallet address.
Example Request:
GET /wallets/0xwallet123/stats?chain=eth
X-API-Key: YOUR_API_KEYResponse: General statistics about the wallet's NFT portfolio.
If a request fails, the API will return an appropriate HTTP status code and an error message such as:
'Failed to fetch NFT collections. Please check your connection and try again.''Failed to fetch NFT collection information. Ensure the collection ID is correct and try again.''Failed to fetch NFT collection statistics. Ensure the collection ID is correct and try again.''Failed to fetch NFTs in the collection. Ensure the collection ID is correct and try again.'
https://financialmodelingprep.com/stable
All stock API requests require an API key provided as a query parameter: apikey=YOUR_API_KEY.
GET /api/v3/stock-screener
Retrieve a list of stocks filtered by price, market cap, and volume.
Query Parameters:
country(string) — Country code for stock market (e.g.,us)priceMoreThan(number or empty) — Minimum stock price filterpriceLowerThan(number or empty) — Maximum stock price filtermarketCapMoreThan(number or empty) — Minimum market capitalization filtermarketCapLowerThan(number or empty) — Maximum market capitalization filtervolumeMoreThan(number or empty) — Minimum volume filtervolumeLowerThan(number or empty) — Maximum volume filterlimit(number) — Number of stocks to returnapikey(string) — Your API key
Example Request:
GET /api/v3/stock-screener?country=us&priceMoreThan=10&priceLowerThan=500&marketCapMoreThan=1000000000&limit=50&apikey=YOUR_API_KEY
Response:
Returns an array of stocks matching the specified criteria with key stock overview data.
GET /quote
Retrieve real-time quote information for a specified stock symbol.
Query Parameters:
symbol(string) — Stock symbol (e.g.,AAPL)apikey(string) — Your API key
Example Request:
GET /quote?symbol=AAPL&apikey=YOUR_API_KEY
Response:
Returns current price, change percentage, volume, and other key metrics for the stock.
GET /historical-price-eod/light
Fetch historical end-of-day stock price data for a given time period.
Query Parameters:
symbol(string) — Stock symbol (e.g.,AAPL)from(date string, ISO 8601) — Start date for historical datato(date string, ISO 8601) — End date for historical dataapikey(string) — Your API key
Example Request:
GET /historical-price-eod/light?symbol=AAPL&from=2024-01-01&to=2024-08-29&apikey=YOUR_API_KEY
Response:
Array of daily stock prices including open, close, high, low, and volume.
GET /search-symbol
Search stocks by symbol or company name (limit 3 results).
Query Parameters:
query(string) — Search keywordlimit(number, optional, default 3) — Number of search resultsapikey(string) — Your API key
Example Request:
GET /search-symbol?query=apple&limit=3&apikey=YOUR_API_KEY
Response:
List of matching stocks including symbol, company name, and exchange.
If a request fails, the API returns an appropriate HTTP error status and a message such as:
'Failed to fetch all stocks. Please check your connection and try again.''Failed to fetch stock information. Ensure the stock symbol is correct and try again.''Failed to fetch stock chart information. Check the stock symbol and time period, then try again.''Failed to fetch stocks by search. Please check your query and connection, then try again.'
This project is licensed under the Apache License 2.0. See the LICENSE file for more details.
