NFT Analytics API
The NFT Analytics API provides comprehensive market intelligence and historical data analysis enabling high-level insights, trends, and performance metrics to help developers build data-driven NFT applications.
What You Can Build
- Analytics Dashboards: Track marketplace activity and trends across all platforms
- Market Intelligence Tools: Analyze trading volumes, price movements, and market sentiment
- Performance Trackers: Monitor collection and individual NFT performance over time
- Trading Insights: Identify top traders, popular collections, and market patterns
Getting Started
The NFT Analytics API is currently available on Mainnet only.
Prerequisites
- Create an API key with NFT Analytics API access
- Understand REST API structure and JSON responses
- Review the available analytics endpoints and data fields
Authentication
All NFT Analytics API requests require Build Platform API key.
curl "https://api.mainnet.aptoslabs.com/v1/analytics/nft/" \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json"
API Overview
Base URL
Mainnet: https://api.mainnet.aptoslabs.com/v1/analytics/nft/
Core Features
- Market Analytics - Trading volumes, price trends, and market activity
- Collection Insights - Performance metrics for NFT collections
- Trader Analytics - Top buyers and sellers
Example Endpoints
Top Collections by Volume
curl -XGET "https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/list_by_volume?limit=10&offset=0&time_period=24h" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY_HERE"
Response:
{
"data": [
{
"collection_id": "0x50627bc2b6f2e069dd4e19ca274abbab41fe426e5e59493db29b4fd9b837358",
"collection_name": "Aptos Rock",
"total_sales": "99",
"total_volume_apt": "1025540282000"
},
]
}
Collection Sales Statistics
curl -XGET "https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/total_sales_count?collection_id=0x123...&time_period=7d" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY_HERE"
Response:
{
"data": [
{
"sales": "1234",
}
]
}
TypeScript Integration Example
interface AnalyticsClient {
apiKey: string;
baseUrl: string;
}
class NFTAnalyticsClient {
private apiKey: string;
private baseUrl: string;
constructor(config: AnalyticsClient) {
this.apiKey = config.apiKey;
this.baseUrl = config.baseUrl;
}
async getTopCollectionsByVolume(period: string = '7d', limit: number = 10, offset: number = 0) {
const response = await fetch(
`${this.baseUrl}/collection/list_by_volume?limit=${limit}&offset=${offset}&time_period=${period}`,
{
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
}
}
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
}
}
// Usage
const client = new NFTAnalyticsClient({
apiKey: 'YOUR_API_KEY_HERE',
baseUrl: 'https://api.mainnet.aptoslabs.com/v1/analytics/nft'
});
const topCollectionsByVolume = await client.getTopCollectionsByVolume('7d', 20);
console.log('Top collections by volume:', topCollectionsByVolume.data[0].sales);
Rate Limits
The NFT Analytics API has rate limits to ensure fair usage. Monitor your usage through the dashboard and implement appropriate caching strategies.