### Install Gas Station Packages (TypeScript) Source: https://geomi.dev/docs/gas-stations Installs the necessary packages for integrating Geomi Gas Station into a TypeScript-based dApp. Includes the Aptos SDK, gas station client, and wallet adapter. ```bash pnpm add \ @aptos-labs/ts-sdk@^5.0.0 \ @aptos-labs/gas-station-client@^2.0.3 \ @aptos-labs/wallet-adapter-react@^7.0.0 ``` -------------------------------- ### Get Top NFT Collections by Volume (curl) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api This example shows how to retrieve a list of top NFT collections by trading volume using a cURL command. It specifies parameters for limit, offset, and time period. ```shell 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" ``` -------------------------------- ### No-Code Indexing API Source: https://context7.com/context7/geomi_dev/llms.txt Enables custom blockchain event indexing with automatic GraphQL API generation. Define your event source, table schema, and primary key through a dashboard UI to get a generated GraphQL endpoint. ```APIDOC ## No-Code Indexing API ### Description Custom blockchain event indexing with automatic GraphQL API generation without infrastructure management. ### Method POST ### Endpoint `https://api.mainnet.aptoslabs.com/nocode/v1//v1/graphql` ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. - **Content-Type** (string) - Required - Application JSON. #### Request Body - **query** (string) - Required - The GraphQL query to execute. ### Request Example ```json { "query": "\n query GetActiveGifts {\n gifts(\n where: {remaining_amount: {_gt: \"0\"}}\n order_by: {amount: desc}\n limit: 10\n ) {\n gift_address\n creator\n amount\n remaining_amount\n claimed_count\n }\n }\n " } ``` ### Response #### Success Response (200) - **data** (object) - Contains the results of the GraphQL query. - **gifts** (array) - An array of gift objects. - **gift_address** (string) - The address of the gift. - **creator** (string) - The creator of the gift. - **amount** (string) - The total amount of the gift. - **remaining_amount** (string) - The remaining amount of the gift. - **claimed_count** (number) - The number of times the gift has been claimed. #### Response Example ```json { "data": { "gifts": [ { "gift_address": "0x123...", "creator": "0xabc...", "amount": "1000", "remaining_amount": "500", "claimed_count": 5 } ] } } ``` ### Notes - Public URL for read-only access: `https://api.mainnet.aptoslabs.com/nocode/v1/public//v1/graphql` - Processor types: Hard, In-place (no backfill), In-place (with backfill), Reset. ``` -------------------------------- ### Gas Station Integration for Sponsored Transactions (TypeScript) Source: https://context7.com/context7/geomi_dev/llms.txt Shows how to integrate the Gas Station client for transaction fee sponsorship on the Aptos blockchain. This enables gasless dApp experiences by allowing transactions to be sponsored. The example details initializing the Gas Station client, configuring the Aptos SDK, and submitting a transaction with a reCAPTCHA token for sponsorship. ```typescript import { GasStationClient, GasStationTransactionSubmitter } from "@aptos-labs/gas-station-client"; import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"; import { AptosWalletAdapterProvider, useWallet } from "@aptos-labs/wallet-adapter-react"; // Initialize gas station client const network = Network.MAINNET; const gasStationClient = new GasStationClient({ network, apiKey: "aptoslabs_34edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSda", }); // Configure Aptos SDK to use gas station const transactionSubmitter = new GasStationTransactionSubmitter(gasStationClient); const config = new AptosConfig({ network, pluginSettings: { TRANSACTION_SUBMITTER: transactionSubmitter, }, }); const aptos = new Aptos(config); // Configure wallet adapter function App() { return ( ); } // Submit transaction with reCAPTCHA token async function sponsoredTransaction() { const { signAndSubmitTransaction } = useWallet(); const recaptchaToken = await getRecaptchaToken(); // Your reCAPTCHA implementation const response = await signAndSubmitTransaction({ data: { function: "0x1::coin::transfer", typeArguments: ["0x1::aptos_coin::AptosCoin"], functionArguments: ["0x9", 100_000_000], }, withFeePayer: true, pluginParams: { recaptchaToken }, }); console.log("Transaction hash:", response.hash); return response; } ``` -------------------------------- ### NFT Analytics Client Integration (TypeScript) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api This TypeScript example provides a class for interacting with the NFT Analytics API. It includes methods to authenticate and retrieve data, such as top collections by volume. It utilizes the Fetch API for HTTP requests. ```typescript 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); ``` -------------------------------- ### TypeScript: Unified NFT Marketplace Data Aggregator API Source: https://context7.com/context7/geomi_dev/llms.txt Provides a unified GraphQL interface for normalized NFT marketplace data across the Aptos ecosystem. It allows querying active NFT listings with optional filtering by collection ID and minimum price, and includes examples for filtering by marketplace and sorting by price. Requires an API key for access. ```typescript interface NFTListing { token_name: string; token_data_id: string; seller: string; price: string; marketplace: string; listing_id: string; last_transaction_timestamp: string; collection_id: string; } async function getActiveListings( collectionId?: string, minPrice?: string ): Promise { const query = ` query GetMarketplaceListings($collectionId: String, $minPrice: String) { current_nft_marketplace_listings( limit: 50 where: { is_deleted: {_eq: false} ${collectionId ? 'collection_id: {_eq: $collectionId}' : ''} ${minPrice ? 'price: {_gte: $minPrice}' : ''} } order_by: {last_transaction_timestamp: desc} ) { token_name token_data_id seller price marketplace listing_id last_transaction_timestamp collection_id collection_data { collection_name uri creator_address } current_token_data { token_uri token_name description cdn_asset_uris { cdn_image_uri asset_uri } } } } `; const response = await fetch( "https://api.mainnet.aptoslabs.com/nft-aggregator/v1/graphql", { method: "POST", headers: { "Authorization": "Bearer aptoslabs_your_api_key", "Content-Type": "application/json", }, body: JSON.stringify({ query, variables: { collectionId, minPrice }, }), } ); const result = await response.json(); return result.data.current_nft_marketplace_listings; } // Filter by marketplace const wapalListings = await getActiveListings(); const filtered = wapalListings.filter(l => l.marketplace === "wapal"); // Sort by price const cheapest = [...wapalListings].sort((a, b) => parseInt(a.price) - parseInt(b.price) ); ``` -------------------------------- ### Fetch NFT Listings using TypeScript Source: https://geomi.dev/docs/nft-apis/nft-aggregator-api This TypeScript example demonstrates how to integrate with the NFT Aggregator API to fetch active marketplace listings. It uses the `fetch` API to send a POST request with a GraphQL query and includes authorization headers. The code logs the total number of listings found and the name of the first listing. ```typescript interface Args { nftAggregatorApiUrl: string; apiKey: string; } const main = async ({ nftAggregatorApiUrl, apiKey }: Args) => { const query = ` query GetMarketplaceListings { current_nft_marketplace_listings( limit: 10 where: {is_deleted: {_eq: false}} order_by: {last_transaction_timestamp: desc} ) { token_name token_data_id seller price marketplace listing_id collection_data { collection_name } } } `; const response = await fetch(nftAggregatorApiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ query }) }); const result = await response.json(); console.log("Total listings found:", result.data.current_nft_marketplace_listings.length); console.log("First listing token name:", result.data.current_nft_marketplace_listings[0]?.token_name); } ``` -------------------------------- ### GET /v1/analytics/nft/collection/list_by_volume Source: https://geomi.dev/docs/nft-apis/nft-analytics-api Retrieves a list of top NFT collections by trading volume, with options for time period, limit, and offset. ```APIDOC ## GET /v1/analytics/nft/collection/list_by_volume ### Description Retrieves a list of top NFT collections by trading volume. You can filter by time period and control the number of results with limit and offset. ### Method GET ### Endpoint `/v1/analytics/nft/collection/list_by_volume` ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of collections to return. - **offset** (integer) - Optional - The number of collections to skip before starting to collect the result set. - **time_period** (string) - Optional - The time period for which to calculate the volume (e.g., `24h`, `7d`, `30d`). Defaults to `24h`. ### Request Example ``` 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 #### Success Response (200) - **data** (array) - An array of collection objects. - **collection_id** (string) - The unique identifier for the NFT collection. - **collection_name** (string) - The name of the NFT collection. - **total_sales** (string) - The total number of sales within the specified time period. - **total_volume_apt** (string) - The total trading volume in APT tokens within the specified time period. #### Response Example ```json { "data": [ { "collection_id": "0x50627bc2b6f2e069dd4e19ca274abbab41fe426e5e59493db29b4fd9b837358", "collection_name": "Aptos Rock", "total_sales": "99", "total_volume_apt": "1025540282000" } ] } ``` ``` -------------------------------- ### GraphQL Filtering Examples for NFT Listings Source: https://geomi.dev/docs/nft-apis/nft-aggregator-api This snippet illustrates common filtering options for the `current_nft_marketplace_listings` query in GraphQL. It shows how to filter by active listings, specific marketplaces, collections, and price ranges using the `where` clause. These filters help in retrieving precise data sets. ```graphql where: { is_deleted: {_eq: false} # Active listings only marketplace: {_eq: "wapal"} # Specific marketplace collection_id: {_eq: "0x123..."} # Specific collection price: {_gte: "100000000"} # Minimum price (1 APT) } ``` -------------------------------- ### Get Total Sales Count for a Marketplace (cURL) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Returns the total number of sales for a specified NFT marketplace. Requires the marketplace name as a query parameter and an authorization token. ```curl curl --request GET \ --url 'https://api.mainnet.aptoslabs.com/v1/analytics/nft/marketplace/total_sales_count?marketplace=' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Get NFT Collections Ranked by Floor Price (cURL) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Retrieves a list of NFT collections sorted by their floor price in descending order. You can specify the number of results to return (limit) and the time period for the floor price calculation (e.g., 1h, 24h, 7d). ```curl curl --request GET \ --url 'https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/list_by_floor_price?limit=1' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Get NFT Collections Ranked by Volume (cURL) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Retrieves a list of NFT collections ranked by their total sales volume in APT. Supports filtering by time period (1h, 6h, 24h, 7d, 30d) and pagination via limit and offset parameters. Requires Bearer token authentication. ```curl curl --request GET \ --url 'https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/list_by_volume?limit=1' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### GraphQL Query for Active NFT Marketplace Listings Source: https://geomi.dev/docs/nft-apis/nft-aggregator-api An example GraphQL query to retrieve active NFT marketplace listings. This query fetches details such as token name, seller, price, and associated collection information, ordered by the last transaction timestamp. It utilizes the `current_nft_marketplace_listings` field with a filter for active listings. ```graphql query GetMarketplaceListings { current_nft_marketplace_listings( limit: 10 where: {is_deleted: {_eq: false}} order_by: {last_transaction_timestamp: desc} ) { token_name token_data_id seller price marketplace listing_id last_transaction_timestamp collection_id collection_data { collection_name uri creator_address } current_token_data { token_uri token_name description cdn_asset_uris { cdn_image_uri asset_uri } } } } ``` -------------------------------- ### Deploy Mint Page to Live Server (npm) Source: https://geomi.dev/docs/nft-studio/create-collection-tool Use the provided npm command to deploy the static mint page site to Vercel. Run `npm run deploy` at the root of the folder and follow the on-screen prompts. This command simplifies the deployment process for the NFT mint page. ```bash npm run deploy ``` -------------------------------- ### Aptos MCP Server Bash Commands Source: https://context7.com/context7/geomi_dev/llms.txt These bash commands illustrate the steps for setting up and configuring the Aptos MCP server. The first step involves generating a Bot API Key from the Aptos build portal. The subsequent steps detail how to add the MCP server configuration to the relevant configuration file, including setting environment variables. ```bash # 1. Generate Bot API Key # - Navigate to https://build.aptoslabs.com/ # - Click profile (bottom left) → "Bot Keys" # - Create new key: APTOS_BOT_KEY= ``` ```bash # 2. Configure MCP in development environment # Add to MCP configuration file: # ... (JSON configuration shown in another snippet) ``` -------------------------------- ### Create NFT Application (Bash) Source: https://context7.com/context7/geomi_dev/llms.txt Initiates a new application for NFT operations. This is the first step in using the NFT Minting APIs. Requires an API key for authentication. ```bash # 1. Create application curl -X POST "https://api.mainnet.aptoslabs.com/tmp/api/application" \ -H "Authorization: Bearer aptoslabs_your_api_key" ``` -------------------------------- ### Get Total Sales Count for a Marketplace Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Retrieves the total number of sales for a specified marketplace. ```APIDOC ## GET /marketplace/total_sales_count ### Description Returns the total number of sales for a specific marketplace. ### Method GET ### Endpoint `/v1/analytics/nft/marketplace/total_sales_count` ### Parameters #### Query Parameters - **marketplace** (string) - Required - Marketplace name (e.g., 'topaz', 'tradeport') ### Request Example ```json { "marketplace": "topaz" } ``` ### Response #### Success Response (200) - **sales** (integer) - The total sales count for the marketplace. #### Response Example ```json { "sales": 1 } ``` #### Error Responses - **401** Unauthorized - Invalid API key - **404** Marketplace not found ``` -------------------------------- ### GET /v1/analytics/nft/collection/total_sales_count Source: https://geomi.dev/docs/nft-apis/nft-analytics-api Retrieves the total sales count for a specific NFT collection within a given time period. ```APIDOC ## GET /v1/analytics/nft/collection/total_sales_count ### Description Retrieves the total number of sales for a specific NFT collection over a defined time period. ### Method GET ### Endpoint `/v1/analytics/nft/collection/total_sales_count` ### Parameters #### Query Parameters - **collection_id** (string) - Required - The unique identifier of the NFT collection. - **time_period** (string) - Required - The time period for which to calculate the sales count (e.g., `24h`, `7d`, `30d`). ### Request Example ``` 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 #### Success Response (200) - **data** (array) - An array containing sales data. - **sales** (string) - The total number of sales for the collection. #### Response Example ```json { "data": [ { "sales": "1234" } ] } ``` ``` -------------------------------- ### Configure Mint Page Environment Variables (.env) Source: https://geomi.dev/docs/nft-studio/create-collection-tool Populate the `.env` file at the root of the repository with `VITE_APP_NETWORK` and `VITE_COLLECTION_ADDRESS` to add a collection to the public mint page. The network must match the project's network, and the collection address should be copied from the Geomi UI. Ensure these variables are correctly set before deploying the mint page. ```dotenv VITE_APP_NETWORK="" # "testnet" or "mainnet" VITE_COLLECTION_ADDRESS="" # "0x..." ``` -------------------------------- ### POST /api/application Source: https://geomi.dev/docs/nft-studio/nft-apis/rest-api-reference Creates a new application to authorize access to the backend services. ```APIDOC ## POST /api/application ### Description Creates a new application to authorize the access to backend. ### Method POST ### Endpoint /api/application ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No Body" } ``` ### Response #### Success Response (200) Default Response #### Response Example ```json { "example": "No Body" } ``` ``` -------------------------------- ### Unsupported Generic Event Type Source: https://geomi.dev/docs/no-code-indexing Illustrates an unsupported scenario where an event itself is generic. The system does not support indexing events that have a generic type parameter `T` directly, as shown in this example. ```rust // This is not supported. #[event] struct MyEvent has drop, store { field1: T } ``` -------------------------------- ### GET /collection/list_by_sales Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Returns NFT collections sorted by their total number of sales (descending order). Supports different time periods: 1h, 6h, 24h/1d, 7d, 30d. ```APIDOC ## GET /collection/list_by_sales ### Description Returns NFT collections sorted by their total number of sales (descending order). Supports different time periods: 1h, 6h, 24h/1d, 7d, 30d. ### Method GET ### Endpoint /v1/analytics/nft/collection/list_by_sales ### Parameters #### Query Parameters - **limit** (integer) - Required - Number of results to return (min: 1, max: 100) - **offset** (integer) - Optional - Number of results to skip (min: 0) - **time_period** (string enum) - Optional - Time period for sales calculation. Supported values: 1h, 6h, 24h, 1d, 7d, 30d. Default: 24h ### Request Example ```curl curl --request GET \ --url 'https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/list_by_sales?limit=1' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **data** (array) - List of collections ranked by sales - **collection_id** (string) - The ID of the collection - **collection_name** (string) - The name of the collection - **total_sales** (integer) - The total number of sales #### Response Example ```json { "data": [ { "collection_id": "…", "collection_name": "…", "total_sales": 1 } ] } ``` ``` -------------------------------- ### Initialize Gas Station Client (TypeScript) Source: https://geomi.dev/docs/gas-stations Initializes a GasStationClient and configures an Aptos client to use it for transaction submission. This allows users to transact without holding APT tokens. ```typescript import { GasStationClient, GasStationTransactionSubmitter } from "@aptos-labs/gas-station-client"; import { AptosConfig, Aptos } from "@aptos-labs/ts-sdk"; const network = Network.MAINNET; const gasStationClient = new GasStationClient({ network, apiKey: "aptoslabs_34edbqbxyPrS_6fu9i83mYmjid4MVs3Z3XmCeATQ8tkSda", }); // Set up Aptos client with gas station const transactionSubmitter = new GasStationTransactionSubmitter(gasStationClient); const config = new AptosConfig({ network, pluginSettings: { TRANSACTION_SUBMITTER: transactionSubmitter, }, }); const aptos = new Aptos(config); ``` -------------------------------- ### Create NFT Collection (Bash) Source: https://context7.com/context7/geomi_dev/llms.txt Creates a new NFT collection with specified properties like name, description, royalty details, and metadata URI. Requires an API key. Returns the address of the newly created collection. ```bash # 4. Create collection curl -X POST "https://api.mainnet.aptoslabs.com/tmp/api/collection/create" \ -H "Authorization: Bearer aptoslabs_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "name": "My NFT Collection", "description": "A collection of unique digital assets", "uri": "https://arweave.net/collection-metadata", "royaltyNumerator": 5, "royaltyDenominator": 100, "properties": { "category": "art", "edition": "genesis" }, "shouldObfuscate": false }' # Response: { "collectionAddress": "0x123..." } ``` -------------------------------- ### Configure Aptos MCP Server Source: https://context7.com/context7/geomi_dev/llms.txt This configuration snippet shows how to set up the Aptos MCP server within a development environment. It requires generating a bot API key and adding specific configurations to the MCP server's configuration file. The environment variable APTOS_BOT_KEY needs to be set with the generated bot key. ```json { "mcpServers": { "aptos": { "command": "npx", "args": ["-y", "@aptos-labs/aptos-mcp-server"], "env": { "APTOS_BOT_KEY": "your_bot_api_key_here" } } } } ``` -------------------------------- ### GET /collection/list_by_volume Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Returns NFT collections sorted by their total sales volume in APT (descending order). Supports different time periods: 1h, 6h, 24h/1d, 7d, 30d. ```APIDOC ## GET /collection/list_by_volume ### Description Returns NFT collections sorted by their total sales volume in APT (descending order). Supports different time periods: 1h, 6h, 24h/1d, 7d, 30d. ### Method GET ### Endpoint /v1/analytics/nft/collection/list_by_volume ### Parameters #### Query Parameters - **limit** (integer) - Required - Number of results to return (min: 1, max: 100) - **offset** (integer) - Optional - Number of results to skip (min: 0) - **time_period** (string enum) - Optional - Time period for volume calculation. Supported values: 1h, 6h, 24h, 1d, 7d, 30d. Default: 24h ### Request Example ```curl curl --request GET \ --url 'https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/list_by_volume?limit=1' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **data** (array) - List of collections ranked by volume - **collection_id** (string) - The ID of the collection - **collection_name** (string) - The name of the collection - **total_volume_apt** (integer) - The total sales volume in APT - **total_sales** (integer) - The total number of sales #### Response Example ```json { "data": [ { "collection_id": "…", "collection_name": "…", "total_volume_apt": 1, "total_sales": 1 } ] } ``` ``` -------------------------------- ### Get NFT Collection Sales Statistics (curl) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api This snippet illustrates how to fetch sales statistics for a specific NFT collection using cURL. It requires the collection ID and a time period as parameters. ```shell 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" ``` -------------------------------- ### Get Collections Ranked by Floor Price Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Retrieves a list of NFT collections sorted by their floor price in APT (descending order). Supports filtering by different time periods (1h, 6h, 24h/1d, 7d, 30d). ```APIDOC ## GET /collection/list_by_floor_price ### Description Returns NFT collections sorted by their floor price in APT (descending order). Supports different time periods. ### Method GET ### Endpoint `/v1/analytics/nft/collection/list_by_floor_price` ### Parameters #### Query Parameters - **limit** (integer) - Required - Number of results to return. Min: 1, Max: 100 - **offset** (integer) - Optional - Number of results to skip. Min: 0 - **time_period** (string enum) - Optional - Time period for floor price calculation. Default: '24h'. Options: 1h, 6h, 24h, 1d, 7d, 30d ### Request Example ```json { "limit": 1 } ``` ### Response #### Success Response (200) - **data** (array) - List of collections ranked by floor price. - **collection_id** (string) - The unique identifier of the collection. - **collection_name** (string) - The name of the collection. - **floor_price_apt** (number) - The floor price of the collection in APT. #### Response Example ```json { "data": [ { "collection_id": "…", "collection_name": "…", "floor_price_apt": 1 } ] } ``` #### Error Responses - **400** Bad Request - limit not provided or invalid parameters - **401** Unauthorized - Invalid API key - **429** Rate limit exceeded ``` -------------------------------- ### Upload NFT Assets with Metadata (Bash) Source: https://context7.com/context7/geomi_dev/llms.txt Uploads NFT asset files along with their corresponding metadata. This endpoint is used to prepare assets before creating collections or minting tokens. ```bash # 3. Upload assets with metadata curl -X POST "https://api.mainnet.aptoslabs.com/tmp/api/asset/upload" \ -H "Authorization: Bearer aptoslabs_your_api_key" \ -F "metadata=@metadata1.json;type=application/json" \ -F "metadata=@metadata2.json;type=application/json" \ -F "file=@media1.png" \ -F "file=@media2.png" ``` -------------------------------- ### NFT Minting APIs Source: https://context7.com/context7/geomi_dev/llms.txt Comprehensive REST APIs for creating collections and minting NFT tokens with metadata and asset management. ```APIDOC ## POST /tmp/api/application ### Description Creates a new application for managing NFT-related operations. ### Method POST ### Endpoint `/tmp/api/application` ### Request Example (No request body specified in the provided text) ### Response #### Success Response (200) (Response body not specified in the provided text, but likely indicates successful application creation.) ``` ```APIDOC ## POST /tmp/api/media/upload ### Description Uploads media files (e.g., images) to be used for NFTs. ### Method POST ### Endpoint `/tmp/api/media/upload` ### Parameters #### Request Body - **file** (file) - Required - The media file to upload. ### Response #### Success Response (200) - **uris** (array) - An array of URIs pointing to the uploaded media files. #### Response Example ```json { "uris": [ "https://arweave.net/...", "https://cdn.example.com/..." ] } ``` ``` ```APIDOC ## POST /tmp/api/asset/upload ### Description Uploads NFT assets along with their associated metadata. ### Method POST ### Endpoint `/tmp/api/asset/upload` ### Parameters #### Request Body - **metadata** (file) - Required - The JSON file containing the metadata for the asset. - **file** (file) - Required - The media file for the asset. ### Request Example (This endpoint involves file uploads, typically handled via multipart/form-data.) ### Response #### Success Response (200) (Response body not specified in the provided text.) ``` ```APIDOC ## POST /tmp/api/collection/create ### Description Creates a new NFT collection. ### Method POST ### Endpoint `/tmp/api/collection/create` ### Parameters #### Request Body - **name** (string) - Required - The name of the NFT collection. - **description** (string) - Required - A description of the NFT collection. - **uri** (string) - Required - A URI pointing to the collection's metadata. - **royaltyNumerator** (integer) - Required - The numerator for royalty calculation. - **royaltyDenominator** (integer) - Required - The denominator for royalty calculation. - **properties** (object) - Optional - Key-value pairs representing collection properties. - **shouldObfuscate** (boolean) - Optional - Whether to obfuscate the collection details. ### Request Example ```json { "name": "My NFT Collection", "description": "A collection of unique digital assets", "uri": "https://arweave.net/collection-metadata", "royaltyNumerator": 5, "royaltyDenominator": 100, "properties": { "category": "art", "edition": "genesis" }, "shouldObfuscate": false } ``` ### Response #### Success Response (200) - **collectionAddress** (string) - The address of the newly created NFT collection. #### Response Example ```json { "collectionAddress": "0x123..." } ``` ``` ```APIDOC ## POST /tmp/api/token/mint/{collectionAddress} ### Description Mints a single NFT token within a specified collection. ### Method POST ### Endpoint `/tmp/api/token/mint/{collectionAddress}` ### Parameters #### Path Parameters - **collectionAddress** (string) - Required - The address of the collection to mint the token into. #### Request Body - **name** (string) - Required - The name of the token. - **uri** (string) - Required - A URI pointing to the token's metadata. - **description** (string) - Optional - A description of the token. - **properties** (object) - Optional - Key-value pairs representing token properties. - **to** (string) - Required - The address to which the token will be minted. - **ungatedTransfer** (boolean) - Optional - Whether the transfer of the token is ungated. - **shouldObfuscate** (boolean) - Optional - Whether to obfuscate the token details. ### Request Example ```json { "name": "Token #1", "uri": "https://arweave.net/token1-metadata", "description": "First token in the collection", "properties": { "rarity": "legendary", "power": "100" }, "to": "0xrecipient_address", "ungatedTransfer": true, "shouldObfuscate": false } ``` ### Response #### Success Response (200) (Response body not specified in the provided text.) ``` ```APIDOC ## POST /tmp/api/token/batch_mint/{collectionAddress} ### Description Batch mints multiple NFT tokens within a specified collection. ### Method POST ### Endpoint `/tmp/api/token/batch_mint/{collectionAddress}` ### Parameters #### Path Parameters - **collectionAddress** (string) - Required - The address of the collection to mint the tokens into. #### Request Body - **names** (array) - Required - An array of token names. - **uris** (array) - Required - An array of URIs pointing to the token metadata. - **descriptions** (array) - Optional - An array of token descriptions. - **properties** (array) - Optional - An array of token properties objects. - **to** (string) - Required - The address to which the tokens will be minted. - **ungatedTransfer** (boolean) - Optional - Whether the transfer of the tokens is ungated. - **shouldObfuscate** (boolean) - Optional - Whether to obfuscate the token details. ### Request Example ```json { "names": ["Token #1", "Token #2", "Token #3"], "uris": [ "https://arweave.net/token1", "https://arweave.net/token2", "https://arweave.net/token3" ], "descriptions": ["First token", "Second token", "Third token"], "properties": [ {"rarity": "common", "power": "50"}, {"rarity": "rare", "power": "75"}, {"rarity": "legendary", "power": "100"} ], "to": "0xrecipient_address", "ungatedTransfer": true, "shouldObfuscate": false } ``` ### Response #### Success Response (200) (Response body not specified in the provided text.) ``` -------------------------------- ### POST /api/collection/create Source: https://geomi.dev/docs/nft-studio/nft-apis/rest-api-reference Creates a new NFT collection with specified properties. ```APIDOC ## POST /api/collection/create ### Description Create a new collection ### Method POST ### Endpoint /api/collection/create ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - Name of the collection. - **description** (string) - Required - Description of the collection. - **uri** (string) - Required - URI for the collection. - **royaltyNumerator** (number) - Optional - Numerator for calculating the royalty percentage. For example, if the royalty is 5%, the numerator would be 5. - **royaltyDenominator** (number) - Optional - Denominator for calculating the royalty percentage. For example, if the royalty is 5%, the denominator would be 100. - **properties** (object) - Required - An object of key value pairs representing each property for the token. - **shouldObfuscate** (boolean) - Optional - Whether to obfuscate properties. ### Request Example ```json { "name": "", "description": "", "uri": "", "properties": {}, "shouldObfuscate": false } ``` ### Response #### Success Response (200) Default Response #### Response Example ```json { "example": "No Body" } ``` ``` -------------------------------- ### API Authentication with Curl Source: https://context7.com/context7/geomi_dev/llms.txt Demonstrates how to authenticate API requests to the Aptos blockchain using API keys. It shows how to create and manage both server-side (secret) and client-side (public) keys, and how to attach them to curl requests for authenticated access. Anonymous requests with limited quotas are also illustrated. ```bash # Create API key via dashboard # 1. Navigate to https://build.aptoslabs.com/ # 2. Create API Resource # 3. Select usage context (Server or Client) # Server-side key (keep secret) # Format: aptoslabs_aXjFX8fDdZv_AXMynDZvp711WTBpSBmqLyj12RV9RFA6B # Client-side key (public frontend with origin restrictions) # Format: AG-FL4PYMZ1YX1LGAJCWP2R1ACYTYRCBY1GB # Attach to requests curl "https://api.mainnet.aptos.dev/v1/accounts/0x1" \ -H "Authorization: Bearer aptoslabs_aXjFX8fDdZv_AXMynDZvp711WTBpSBmqLyj12RV9RFA6B" # Anonymous requests (limited to 50,000 CUs per 5 minutes per IP) curl "https://api.mainnet.aptos.dev/v1/accounts/0x1" ``` -------------------------------- ### Upload Media Files for NFTs (Bash) Source: https://context7.com/context7/geomi_dev/llms.txt Uploads image files that will be associated with NFTs. Supports uploading multiple files in a single request. The response contains the URIs of the uploaded media. ```bash # 2. Upload media files curl -X POST "https://api.mainnet.aptoslabs.com/tmp/api/media/upload" \ -H "Authorization: Bearer aptoslabs_your_api_key" \ -H "Content-Type: multipart/form-data" \ -F "file=@image1.png" \ -F "file=@image2.png" # Response: { "uris": ["https://arweave.net/...", "https://cdn.example.com/..."] } ``` -------------------------------- ### Get NFT Collections Ranked by Number of Sales (cURL) Source: https://geomi.dev/docs/nft-apis/nft-analytics-api/nft-analytics-api-reference Retrieves a list of NFT collections ranked by their total number of sales. Supports filtering by time period (1h, 6h, 24h, 7d, 30d) and pagination via limit and offset parameters. Requires Bearer token authentication. ```curl curl --request GET \ --url 'https://api.mainnet.aptoslabs.com/v1/analytics/nft/collection/list_by_sales?limit=1' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Create Application using cURL Source: https://geomi.dev/docs/nft-studio/nft-apis/rest-api-reference This endpoint creates a new application to authorize access to the backend. It requires a POST request to the /api/application endpoint. No request body is specified, and a successful response is indicated by a 200 status code. ```curl curl --request POST \ --url https://api.mainnet.aptoslabs.com/tmp/api/application ``` -------------------------------- ### Batch Mint NFT Tokens (Bash) Source: https://context7.com/context7/geomi_dev/llms.txt Mints multiple NFT tokens in a single transaction for a specified collection. Requires arrays for token names, URIs, descriptions, properties, and a recipient address. Supports optional obfuscation and ungated transfers. ```bash # 6. Batch mint tokens curl -X POST "https://api.mainnet.aptoslabs.com/tmp/api/token/batch_mint/0x123..." \ -H "Authorization: Bearer aptoslabs_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "names": ["Token #1", "Token #2", "Token #3"], "uris": [ "https://arweave.net/token1", "https://arweave.net/token2", "https://arweave.net/token3" ], "descriptions": ["First token", "Second token", "Third token"], "properties": [ {"rarity": "common", "power": "50"}, {"rarity": "rare", "power": "75"}, {"rarity": "legendary", "power": "100"} ], "to": "0xrecipient_address", "ungatedTransfer": true, "shouldObfuscate": false }' ```