Skill: novnski/moralis-data-api (version 1.3.2)

--- name: moralis-data-api description: Query Web3 blockchain data from Moralis API. Use when user asks about wallet data (balances, tokens, NFTs, transaction history, profitability, net worth), token data (prices, metadata, DEX pairs, analytics, security scores), NFT data (metadata, transfers, traits, rarity, floor prices), DeFi positions, entity/label data for exchanges and funds, or block and transaction data. Supports EVM chains (Ethereum, Polygon, BSC, Arbitrum, Base, Optimism, Avalanche, etc.) and Solana. NOT for real-time streaming - use moralis-streams-api instead. version: 1.3.1 license: MIT compatibility: Requires curl for API calls. Requires MORALIS_API_KEY env var for authentication. metadata: author: MoralisWeb3 homepage: https://docs.moralis.com repository: https://github.com/MoralisWeb3/onchain-skills openclaw: requires: env: - MORALIS_API_KEY bins: - curl primaryEnv: MORALIS_API_KEY allowed-tools: Bash Read Grep Glob --- ## CRITICAL: Read Rule Files Before Implementing **The #1 cause of bugs is not reading the endpoint rule file before writing code.** For EVERY endpoint: 1. Read `rules/{EndpointName}.md` 2. Find "Example Response" section 3. Copy the EXACT JSON structure 4. Note field names (snake_case), data types, HTTP method, path, wrapper structure **Reading Order:** 1. This SKILL.md (core patterns) 2. Endpoint rule file in `rules/` 3. Pattern references in `references/` (for edge cases only) --- ## Setup ### API Key (optional) **Never ask the user to paste their API key into the chat.** Instead: 1. Check if `MORALIS_API_KEY` is set in the environment (try running `[ -n "$MORALIS_API_KEY" ] && echo "API key is set" || echo "API key is NOT set"`). 2. If not set, offer to create the `.env` file with an empty placeholder: `MORALIS_API_KEY=` 3. Tell the user to open the `.env` file and paste their key there themselves. 4. Let them know: without the key, you won't be able to test or call the Moralis API on their behalf. If they don't have a key yet, point them to [admin.moralis.com/register](https://admin.moralis.com/register) (free, no credit card). ### Environment Variable Discovery The `.env` file location depends on how skills are installed: Create the `.env` file in the project root (same directory the user runs Claude Code from). Make sure `.env` is in `.gitignore`. ### Verify Your Key ```bash curl "https://deep-index.moralis.io/api/v2.2/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/balance?chain=0x1" \ -H "X-[REDACTED_SECRET]" ``` --- ## Base URLs | API | Base URL | | ------ | ---------------------------------------- | | EVM | `https://deep-index.moralis.io/api/v2.2` | | Solana | `https://solana-gateway.moralis.io` | ## Authentication All requests require: `X-[REDACTED_SECRET]` --- ## Quick Reference: Most Common Patterns ### Data Type Rules | Field | Reality | NOT | | -------------- | -------------------------------- | ----------------- | | `block_number` | Decimal `12386788` | Hex `0xf2b5a4` | | `timestamp` | ISO `"2021-05-07T11:08:35.000Z"` | Unix `1620394115` | | `balance` | String `"1000000000000000000"` | Number | | `decimals` | String or number | Always number | ### Block Numbers (always decimal) ```typescript block_number: 12386788; // number - use directly block_number: "12386788"; // string - parseInt(block_number, 10) ``` ### Timestamps (usually ISO strings) ```typescript "2021-05-07T11:08:35.000Z"; // → new Date(timestamp).getTime() ``` ### Balances (always strings unless its a property named "formatted" eg. balanceFormatted, BigInt) ```typescript balance: "1000000000000000000"; // → (Number(BigInt(balance)) / 1e18).toFixed(6) ``` ### Response Patterns | Pattern | Example Endpoints | | ------------------------------------ | --------------------------------------------- | | Direct array `[...]` | getWalletTokenBalancesPrice, getTokenMetadata | | Wrapped `{ result: [] }` | getWalletNFTs, getWalletTransactions | | Paginated `{ page, cursor, result }` | getWalletHistory, getNFTTransfers | ```typescript // Safe extraction const data = Array.isArray(response) ? response : response.result || []; ``` ### Common Field Mappings ```typescript token_address → tokenAddress from_address_label → fromAddressLabel block_number → blockNumber receipt_status: "1" → success, "0" → failed possible_spam: "true"/"false" → boolean check ``` --- ## Common Pitfalls (Top 5) 1. **Block numbers are decimal, not hex** - Use `parseInt(x, 10)`, not `parseInt(x, 16)` 2. **Timestamps are ISO strings** - Use `new Date(timestamp).getTime()` 3. **Balances are strings** - Use `BigInt(balance)` for math 4. **Response may be wrapped** - Check for `.result` before `.map()` 5. **Path inconsistencies** - Some use `/wallets/{address}/...`, others `/{address}/...` See [references/CommonPitfalls.md](references/CommonPitfalls.md) for complete reference. --- ## Pagination Many endpoints use cursor-based pagination: ```bash # First request curl "...?limit=100" -H "X-API-Key: $KEY" # Next page curl "...?limit=100&cursor=<cursor_from_response>" -H "X-API-Key: $KEY" ``` See [references/Pagination.md](references/Pagination.md) for details. --- ## Testing Endpoints ```bash ADDRESS=[REDACTED_SECRET] CHAIN="0x1" # Wallet Balance curl "https://deep-index.moralis.io/api/v2.2/${ADDRESS}/balance?chain=${CHAIN}" \ -H "X-[REDACTED_SECRET]" # Token Price curl "https://deep-index.moralis.io/api/v2.2/erc20/0x6B175474E89094C44Da98b954EedeAC495271d0F/price?chain=${CHAIN}" \ -H "X-[REDACTED_SECRET]" # Wallet Transactions (note result wrapper) curl "https://deep-index.moralis.io/api/v2.2/${ADDRESS}?chain=${CHAIN}&limit=5" \ -H "X-[REDACTED_SECRET]" | jq '.result' ``` --- ## Quick Troubleshooting | Issue | Cause | Solution | | ------------------------- | ---------------------- | ----------------------------------- | | "Property does not exist" | Field name mismatch | Check snake_case in rule file | | "Cannot read undefined" | Missing optional field | Use `?.` optional chaining | | "blockNumber is NaN" | Parsing decimal as hex | Use radix 10: `parseInt(x, 10)` | | "Wrong timestamp" | Parsing ISO as number | Use `new Date(timestamp).getTime()` | | "404 Not Found" | Wrong endpoint path | Verify path in rule file | --- ## Performance & Timeouts Most endpoints respond quickly under normal conditions. Response times can vary based on wallet activity volume, chain, and query complexity. **Recommended client timeouts:** - Simple queries (balance, price, metadata): 10s - Complex queries (wallet history, DeFi positions): 30s Large wallets with extensive transaction histories may take longer — use pagination with reasonable `limit` values. See [references/PerformanceAndLatency.md](references/PerformanceAndLatency.md) for optimization tips. --- ## Default Chain Behavior **EVM addresses (`0x...`):** Default to Ethereum (`chain=0x1`) unless specified. **Solana addresses (base58):** Auto-detected and routed to Solana API. --- ## Supported Chains **EVM (40+ chains):** Ethereum (0x1), Polygon (0x89), BSC (0x38), Arbitrum (0xa4b1), Optimism (0xa), Base (0x2105), Avalanche (0xa86a), and more. **Solana:** Mainnet, Devnet See [references/SupportedApisAndChains.md](references/SupportedApisAndChains.md) for full list. --- ## Endpoint Catalog Complete list of all 136 endpoints (102 EVM + 34 Solana) organized by category. ### Wallet Balances, tokens, NFTs, transaction history, profitability, and net worth data. | Endpoint | Description | |----------|-------------| | [getNativeBalance](rules/getNativeBalance.md) | Get native balance by wallet | | [getNativeBalancesForAddresses](rules/getNativeBalancesForAddresses.md) | Get native balance for a set of wallets | | [getWalletActiveChains](rules/getWalletActiveChains.md) | Get active chains by wallet address | | [getWalletApprovals](rules/getWalletApprovals.md) | Get ERC20 approvals by wallet | | [getWalletHistory](rules/getWalletHistory.md) | Get the complete decoded transaction history of a wallet | | [getWalletInsight](rules/getWalletInsight.md) | Get wallet insight metrics | | [getWalletNetWorth](rules/getWalletNetWorth.md) | Get wallet net worth | | [getWalletNFTCollections](rules/getWalletNFTCollections.md) | Get NFT collections by wallet address | | [getWalletNFTs](rules/getWalletNFTs.md) | Get NFTs by wallet address | | [getWalletNFTTransfers](rules/getWalletNFTTransfers.md) | Get NFT Transfers by wallet address | | [getWalletProfitability](rules/getWalletProfitability.md) | Get detailed profit and loss by wallet address | | [getWalletProfitabilitySummary](rules/getWalletProfitabilitySummary.md) | Get profit and loss summary by wallet address | | [getWalletStats](rules/getWalletStats.md) | Get summary stats by wallet address | | [getWalletTokenBalancesPrice](rules/getWalletTokenBalancesPrice.md) | Get token balances with prices by wallet address | | [getWalletTokenTransfers](rules/getWalletTokenTransfers.md) | Get ERC20 token transfers by wallet address | | [getWalletTransactions](rules/getWalletTransactions.md) | Get native transactions by wallet | | [getWalletTransactionsVerbose](rules/getWalletTransactionsVerbose.md) | Get decoded transactions by wallet | ### Token Token prices, metadata, pairs, DEX swaps, analytics, security scores, and sniper detection. | Endpoint | Description | |----------|-------------| | [getAggregatedTokenPairStats](rules/getAggregatedTokenPairStats__evm.md) | Get aggregated token pair statistics by address | | [getHistoricalTokenScore](rules/getHistoricalTokenScore.md) | Get historical token score by token address | | [getMultipleTokenAnalytics](rules/getMultipleTokenAnalytics.md) | Get token analytics for a list of token addresses | | [getPairAddress](rules/getPairAddress.md) | Get DEX token pair address | | [getPairReserves](rules/getPairReserves.md) | Get DEX token pair reserves | | [getPairStats](rules/getPairStats__evm.md) | Get stats by pair address | | [getSnipersByPairAddress](rules/getSnipersByPairAddress__evm.md) | Get snipers by pair address | | [getSwapsByPairAddress](rules/getSwapsByPairAddress__evm.md) | Get swap transactions by pair address | | [getSwapsByTokenAddress](rules/getSwapsByTokenAddress__evm.md) | Get swap transactions by token address | | [getSwapsByWalletAddress](rules/getSwapsByWalletAddress__evm.md) | Get swap transactions by wallet address | | [getTimeSeriesTokenAnalytics](rules/getTimeSeriesTokenAnalytics.md) | Retrieve timeseries trading stats by token addresses | | [getTokenAnalytics](rules/getTokenAnalytics.md) | Get token analytics by token address | | [getTokenBondingStatus](rules/getTokenBondingStatus__evm.md) | Get the token bonding status | | [getTokenCategories](rules/getTokenCategories.md) | Get ERC20 token categories | | [getTokenHolders](rules/getTokenHolders__evm.md) | Get a holders summary by token address | | [getTokenMetadata](rules/getTokenMetadata__evm.md) | Get ERC20 token metadata by contract | | [getTokenMetadataBySymbol](rules/getTokenMetadataBySymbol.md) | Get ERC20 token metadata by symbols | | [getTokenOwners](rules/getTokenOwners.md) | Get ERC20 token owners by contract | | [getTokenPairs](rules/getTokenPairs__evm.md) | Get token pairs by address | | [getTokenScore](rules/getTokenScore.md) | Get token score by token address | | [getTokenStats](rules/getTokenStats.md) | Get ERC20 token stats | | [getTokenTransfers](rules/getTokenTransfers.md) | Get ERC20 token transfers by contract address | ### NFT NFT metadata, transfers, traits, rarity, floor prices, and trades. | Endpoint | Description | |----------|-------------| | [getContractNFTs](rules/getContractNFTs.md) | Get NFTs by contract address | | [getMultipleNFTs](rules/getMultipleNFTs.md) | Get Metadata for NFTs | | [getNFTBulkContractMetadata](rules/getNFTBulkContractMetadata.md) | Get metadata for multiple NFT contracts | | [getNFTByContractTraits](rules/getNFTByContractTraits.md) | Get NFTs by traits | | [getNFTCollectionStats](rules/getNFTCollectionStats.md) | Get summary stats by NFT collection | | [getNFTContractMetadata](rules/getNFTContractMetadata.md) | Get NFT collection metadata | | [getNFTContractSalePrices](rules/getNFTContractSalePrices.md) | Get NFT sale prices by collection | | [getNFTContractTransfers](rules/getNFTContractTransfers.md) | Get NFT transfers by contract address | | [getNFTFloorPriceByContract](rules/getNFTFloorPriceByContract.md) | Get NFT floor price by contract | | [getNFTFloorPriceByToken](rules/getNFTFloorPriceByToken.md) | Get NFT floor price by token | | [getNFTHistoricalFloorPriceByContract](rules/getNFTHistoricalFloorPriceByContract.md) | Get historical NFT floor price by contract | | [getNFTMetadata](rules/getNFTMetadata__evm.md) | Get NFT metadata | | [getNFTOwners](rules/getNFTOwners.md) | Get NFT owners by contract address | | [getNFTSalePrices](rules/getNFTSalePrices.md) | Get NFT sale prices by token | | [getNFTTokenIdOwners](rules/getNFTTokenIdOwners.md) | Get NFT owners by token ID | | [getNFTTrades](rules/getNFTTrades.md) | Get NFT trades by collection | | [getNFTTradesByToken](rules/getNFTTradesByToken.md) | Get NFT trades by token | | [getNFTTradesByWallet](rules/getNFTTradesByWallet.md) | Get NFT trades by wallet address | | [getNFTTraitsByCollection](rules/getNFTTraitsByCollection.md) | Get NFT traits by collection | | [getNFTTraitsByCollectionPaginate](rules/getNFTTraitsByCollectionPaginate.md) | Get NFT traits by collection paginate | | [getNFTTransfers](rules/getNFTTransfers.md) | Get NFT transfers by token ID | | [getTopNFTCollectionsByMarketCap](rules/getTopNFTCollectionsByMarketCap.md) | Get top NFT collections by market cap | ### DeFi DeFi protocol positions, liquidity, and exposure data. | Endpoint | Description | |----------|-------------| | [getDefiPositionsByProtocol](rules/getDefiPositionsByProtocol.md) | Get detailed DeFi positions by protocol for a wallet | | [getDefiPositionsSummary](rules/getDefiPositionsSummary.md) | Get DeFi positions of a wallet | | [getDefiSummary](rules/getDefiSummary.md) | Get the DeFi summary of a wallet | ### Entity Labeled addresses including exchanges, funds, protocols, and whales. | Endpoint | Description | |----------|-------------| | [getEntity](rules/getEntity.md) | Get Entity Details By Id | | [getEntityCategories](rules/getEntityCategories.md) | Get Entity Categories | ### Price Token and NFT prices, OHLCV candlestick data. | Endpoint | Description | |----------|-------------| | [getMultipleTokenPrices](rules/getMultipleTokenPrices__evm.md) | Get Multiple ERC20 token prices | | [getPairCandlesticks](rules/getPairCandlesticks.md) | Get OHLCV by pair address | | [getPairPrice](rules/getPairPrice.md) | Get DEX token pair price | | [getTokenPrice](rules/getTokenPrice__evm.md) | Get ERC20 token price | ### Blockchain Blocks, transactions, date-to-block conversion, and contract functions. | Endpoint | Description | |----------|-------------| | [getBlock](rules/getBlock.md) | Get block by hash | | [getDateToBlock](rules/getDateToBlock.md) | Get block by date | | [getLatestBlockNumber](rules/getLatestBlockNumber.md) | Get latest block number | | [getTransaction](rules/getTransaction.md) | Get transaction by hash | | [getTransactionVerbose](rules/getTransactionVerbose.md) | Get decoded transaction by hash | ### Discovery Trending tokens, blue chips, market movers, and token discovery. | Endpoint | Description | |----------|-------------| | [getDiscoveryToken](rules/getDiscoveryToken.md) | Get token details | | [getTimeSeriesVolume](rules/getTimeSeriesVolume.md) | Retrieve timeseries trading stats by chain | | [getTimeSeriesVolumeByCategory](rules/getTimeSeriesVolumeByCategory.md) | Retrieve timeseries trading stats by category | | [getTopCryptoCurrenciesByMarketCap](rules/getTopCryptoCurrenciesByMarketCap.md) | Get top crypto currencies by market cap | | [getTopCryptoCurrenciesByTradingVolume](rules/getTopCryptoCurrenciesByTradingVolume.md) | Get top crypto currencies by trading volume | | [getTopERC20TokensByMarketCap](rules/getTopERC20TokensByMarketCap.md) | Get top ERC20 tokens by market cap | | [getTopERC20TokensByPriceMovers](rules/getTopERC20TokensByPriceMovers.md) | Get top ERC20 tokens by price movements (winners and losers) | | [getTopGainersTokens](rules/getTopGainersTokens.md) | Get tokens with top gainers | | [getTopLosersTokens](rules/getTopLosersTokens.md) | Get tokens with top losers | | [getTopProfitableWalletPerToken](rules/getTopProfitableWalletPerToken.md) | Get top traders for a given ERC20 token | | [getTrendingTokens](rules/getTrendingTokens.md) | Get trending tokens | | [getVolumeStatsByCategory](rules/getVolumeStatsByCategory.md) | Get trading stats by categories | | [getVolumeStatsByChain](rules/getVolumeStatsByChain.md) | Get trading stats by chain | ### Other Utility endpoints including API version, endpoint weights, and address resolution. | Endpoint | Description | |----------|-------------| | [getBondingTokensByExchange](rules/getBondingTokensByExchange__evm.md) | Get bonding tokens by exchange | | [getEntitiesByCategory](rules/getEntitiesByCategory.md) | Get Entities By Category | | [getFilteredTokens](rules/getFilteredTokens.md) | Returns a list of tokens that match the specified filters and criteria | | [getGraduatedTokensByExchange](rules/getGraduatedTokensByExchange__evm.md) | Get graduated tokens by exchange | | [getHistoricalTokenHolders](rules/getHistoricalTokenHolders__evm.md) | Get timeseries holders data | | [getNewTokensByExchange](rules/getNewTokensByExchange__evm.md) | Get new tokens by exchange | | [getUniqueOwnersByCollection](rules/getUniqueOwnersByCollection.md) | Get unique wallet addresses owning NFTs from a contract. | | [resolveAddress](rules/resolveAddress.md) | ENS lookup by address | | [resolveAddressToDomain](rules/resolveAddressToDomain.md) | Resolve Address to Unstoppable domain | | [resolveDomain](rules/resolveDomain.md) | Resolve Unstoppable domain | | [resolveENSDomain](rules/resolveENSDomain.md) | ENS lookup by domain | | [reSyncMetadata](rules/reSyncMetadata.md) | Resync NFT metadata | | [searchEntities](rules/searchEntities.md) | Search Entities, Organizations or Wallets | | [searchTokens](rules/searchTokens.md) | Search for tokens based on contract address, pair address, token name or token symbol. | ### Solana Endpoints Solana-specific endpoints (24 native + 10 EVM variants that support Solana chain = 34 total). | Endpoint | Description | |----------|-------------| | [balance](rules/balance__solana.md) | Gets native balance owned by the given address | | [getAggregatedTokenPairStats](rules/getAggregatedTokenPairStats__solana.md) | Get aggregated token pair statistics by address | | [getBondingTokensByExchange](rules/getBondingTokensByExchange__solana.md) | Get bonding tokens by exchange | | [getCandleSticks](rules/getCandleSticks__solana.md) | Get candlesticks for a pair address | | [getGraduatedTokensByExchange](rules/getGraduatedTokensByExchange__solana.md) | Get graduated tokens by exchange | | [getHistoricalTokenHolders](rules/getHistoricalTokenHolders__solana.md) | Get token holders overtime for a given tokens | | [getMultipleTokenMetadata](rules/getMultipleTokenMetadata__solana.md) | Get multiple token metadata | | [getMultipleTokenPrices](rules/getMultipleTokenPrices__solana.md) | Get token price | | [getNFTMetadata](rules/getNFTMetadata__solana.md) | Get the global metadata for a given contract | | [getNFTs](rules/getNFTs__solana.md) | Gets NFTs owned by the given address | | [getNewTokensByExchange](rules/getNewTokensByExchange__solana.md) | Get new tokens by exchange | | [getPairStats](rules/getPairStats__solana.md) | Get stats for a pair address | | [getPortfolio](rules/getPortfolio__solana.md) | Gets the portfolio of the given address | | [getSPL](rules/getSPL__solana.md) | Gets token balances owned by the given address | | [getSnipersByPairAddress](rules/getSnipersByPairAddress__solana.md) | Get snipers by pair address. | | [getSwapsByPairAddress](rules/getSwapsByPairAddress__solana.md) | Get all swap related transactions (buy, sell, add liquidity & remove liquidity) | | [getSwapsByTokenAddress](rules/getSwapsByTokenAddress__solana.md) | Get all swap related transactions (buy, sell) | | [getSwapsByWalletAddress](rules/getSwapsByWalletAddress__solana.md) | Get all swap related transactions (buy, sell) for a specific wallet address. | | [getTokenBondingStatus](rules/getTokenBondingStatus__solana.md) | Get Token Bonding Status | | [getTokenHolders](rules/getTokenHolders__solana.md) | Get the summary of holders for a given token token. | | [getTokenMetadata](rules/getTokenMetadata__solana.md) | Get Token metadata | | [getTokenPairs](rules/getTokenPairs__solana.md) | Get token pairs by address | | [getTokenPrice](rules/getTokenPrice__solana.md) | Get token price | | [getTopHolders](rules/getTopHolders__solana.md) | Get paginated top holders for a given token. | | [getDiscoveryToken](rules/getDiscoveryToken__solana.md) | **Solana variant:** Get token details | | [getHistoricalTokenScore](rules/getHistoricalTokenScore__solana.md) | **Solana variant:** Get historical token score by token address | | [getTimeSeriesVolume](rules/getTimeSeriesVolume__solana.md) | **Solana variant:** Retrieve timeseries trading stats by chain | | [getTimeSeriesVolumeByCategory](rules/getTimeSeriesVolumeByCategory__solana.md) | **Solana variant:** Retrieve timeseries trading stats by category | | [getTokenAnalytics](rules/getTokenAnalytics__solana.md) | **Solana variant:** Get token analytics by token address | | [getTokenScore](rules/getTokenScore__solana.md) | **Solana variant:** Get token score by token address | | [getTopGainersTokens](rules/getTopGainersTokens__solana.md) | **Solana variant:** Get tokens with top gainers | | [getTopLosersTokens](rules/getTopLosersTokens__solana.md) | **Solana variant:** Get tokens with top losers | | [getTrendingTokens](rules/getTrendingTokens__solana.md) | **Solana variant:** Get trending tokens | | [getVolumeStatsByCategory](rules/getVolumeStatsByCategory__solana.md) | **Solana variant:** Get trading stats by categories | ## Reference Documentation - [references/CommonPitfalls.md](references/CommonPitfalls.md) - Complete pitfalls reference - [references/DataTransformations.md](references/DataTransformations.md) - Type conversion reference - [references/FilteredTokens.md](references/FilteredTokens.md) - Token discovery metrics, timeframes, filters, and examples - [references/PerformanceAndLatency.md](references/PerformanceAndLatency.md) - Response time guidance, timeout recommendations, caching - [references/ResponsePatterns.md](references/ResponsePatterns.md) - Pagination patterns - [references/SupportedApisAndChains.md](references/SupportedApisAndChains.md) - Chains and APIs --- ## See Also - Endpoint rules: `rules/*.md` files - Streams API: @moralis-streams-api for real-time events

path: references/CommonPitfalls.md
content: # Common Pitfalls Reference

Complete reference for common mistakes, bugs, and gotchas when working with Moralis Data API.

## Table of Contents

- [Data Type Assumptions](#data-type-assumptions-most-common-bug-source)
- [Endpoint Path Inconsistencies](#endpoint-path-inconsistencies)
- [HTTP Method Surprises](#http-method-surprises)
- [Response Wrapper Structures](#response-wrapper-structures)
- [TypeScript Property Names](#typescript-property-names)
- [Other Common Issues](#other-common-issues)
- [Debugging Tips](#debugging-tips)
- [Prevention Checklist](#prevention-checklist)

---

## Data Type Assumptions (MOST COMMON BUG SOURCE)

**NEVER assume these without checking the rule file:**

| Field          | Wrong Assumption            | Reality                                 |
| -------------- | --------------------------- | --------------------------------------- |
| `block_number` | Hex string `"0xf2b5a4"`     | Decimal number `12386788`               |
| `timestamp`    | Unix timestamp `1620394115` | ISO string `"2021-05-07T11:08:35.000Z"` |
| `decimals`     | Always number               | Can be string `"18"` or number `18`     |
| `balance`      | Number                      | Always string (BigInt required)         |

### Impact of Wrong Assumptions

**Parsing block_number as hex:**
```typescript
// ❌ WRONG
const blockNumber = parseInt(data.block_number, 16); // Returns huge wrong number

// ✅ CORRECT
const blockNumber = typeof data.block_number === 'number'
  ? data.block_number
  : parseInt(data.block_number, 10);
```

**Parsing timestamp as number:**
```typescript
// ❌ WRONG
const timestamp = data.timestamp; // 2021-05-07... is invalid number

// ✅ CORRECT
const timestamp = typeof data.timestamp === 'string'
  ? new Date(data.timestamp).getTime()
  : data.timestamp;
```

**Treating balance as number:**
```typescript
// ❌ WRONG
const value = data.balance / 1e18; // "1000000000000000000" → NaN

// ✅ CORRECT
const value = Number(BigInt(data.balance)) / 1e18;
```

## Endpoint Path Inconsistencies

Not all endpoints follow the same pattern. Always verify exact path in rule file.

### Common Path Patterns

| Endpoint Type              | Path Pattern                            | Example                         | Notes                                    |
| ------------------------- | -------------------------------------- | -------------------------------- | ----------------------------------------- |
| Direct address           | `/{address}`                             | `getWalletTransactions`          | Simple replacement                          |
| Token balance            | `/{address}/erc20`                        | `getWalletTokenBalancesPrice`        | ERC20 suffix (with prices)                            |
| NFT balance             | `/{address}/nft`                          | `getWalletNFTs`                | NFT suffix                              |
| Wallet stats            | `/wallets/{address}/stats`               | `getWalletStats`                | ⚠️ Note `/wallets/` prefix           |
| DeFi positions          | `/wallets/{address}/defi/positions`       | `getDefiPositionsSummary`     | ⚠️ Multi-segment path                 |
| Block by number         | `/block/{number}`                         | `getBlock`                      | Path param name is `{number}`       |
| Latest block number      | `/latestBlockNumber/{chain}`              | `getLatestBlockNumber`          | ⚠️ Chain is PATH param           |
| Token price             | `/erc20/{token_address}/price`            | `getTokenPrice`                 | Token address in path                |
| Resolve ENS             | `/resolve/ens/{domain}`                   | `resolveENSDomain`              | ⚠️ Includes `/ens/` in path       |
| Resolve Unstoppable    | `/resolve/{domain}/address`                | `resolveDomain`                 | Different domain field              |

### Common Path Param Mistakes

```typescript
// ❌ WRONG - Using endpoint name instead of param name
const url = `/latestBlockNumber/${chain}`;

// ✅ CORRECT - Using exact param name from rule file
const url = `/latestBlockNumber/${chain}`;

// Check rule file for exact param name:
// Path: `/latestBlockNumber/{chain}` → param is `chain`
// Path: `/:address/erc20` → param is `address`
```

## HTTP Method Surprises

Most endpoints are GET, but some use different methods. Always verify in rule file.

### Common Method Table

| Action          | HTTP Method | Endpoint                              |
| --------------- | ------------- | ------------------------------------- |
| Query data       | GET          | Most endpoints                      |
| Create stream    | PUT          | Streams API (NOT Data API)          |
| Update stream    | POST         | Streams API (NOT Data API)          |
| Delete stream    | DELETE       | Streams API (NOT Data API)          |
| Query metadata   | GET          | `/erc20/metadata` (used to be POST) |

### Rare POST Endpoints in Data API

As of API v2.2, most Data API endpoints use GET. Historical POST endpoints have been updated to GET with query parameters.

**Example: Token metadata**
```typescript
// ❌ OLD (deprecated) - POST with request body
fetch('/erc20/metadata', {
  method: 'POST',
  body: { token_addresses: [address] }
});

// ✅ CURRENT - GET with query params
fetch(`/erc20/metadata?token_addresses=${address}`, {
  method: 'GET'
});
```

## Response Wrapper Structures

Before writing code that accesses `.map()`, `.length`, or `.forEach`, verify the response structure.

### Wrapper Type Detection

```typescript
interface WrappedResponse<T = any> {
  result?: T[];
  cursor?: string;
  page?: string;
  page_size?: string;
}

function isWrapped(data: any): data is WrappedResponse<any> {
  return data.result !== undefined || data.cursor !== undefined || data.page !== undefined;
}

function isDirectArray(data: any): data is any[] {
  return Array.isArray(data);
}
```

### Common Wrapper Mistakes

**Assuming array when it's wrapped:**
```typescript
// ❌ WRONG - Assumes array
data.map(tx => tx.hash) // Error: data.map is not a function

// ✅ CORRECT - Check if wrapped first
const results = isWrapped(data) ? data.result : data;
results.map(tx => tx.hash);
```

**Assuming wrapped when it's an array:**
```typescript
// ❌ WRONG - Assumes wrapper
data.result.map(token => token.address) // Error: data.result is undefined

// ✅ CORRECT - Check if array first
const results = isDirectArray(data) ? data : data.result || [];
results.map(token => token.address);
```

**Accessing undefined nested properties:**
```typescript
// ❌ WRONG - No optional chaining
const txHash = data.result[0].transaction_hash; // Error if result[0] is undefined

// ✅ CORRECT - Use optional chaining
const txHash = data.result?.[0]?.transaction_hash;
```

## TypeScript Property Names

### Property Name Restrictions

TypeScript doesn't allow property names starting with numbers.

**Problem:**
```typescript
// ❌ WON'T COMPILE
interface TokenPrice {
  24hrPercentChange: string;
}
```

**Solutions:**

Option 1: Use quoted property names
```typescript
// ✅ CORRECT
interface TokenPrice {
  "24hrPercentChange": string;
}
```

Option 2: Rename the property
```typescript
// ✅ CORRECT
interface TokenPrice {
  hr24PercentChange: string;
}
```

### Common Renaming Patterns

```typescript
// API response → TypeScript interface
{
  "24hrPercentChange": string  → hr24PercentChange
  "1dVolume": string           → oneDayVolume
  "7dVolume": string           → sevenDayVolume
  "30dVolume": string          → thirtyDayVolume
}
```

## Other Common Issues

### Chain ID Format

**Always use hex format for chain IDs:**
```typescript
// ❌ WRONG - String names
const chain = 'eth';

// ✅ CORRECT - Hex format
const chain = '0x1';

// Common hex chain IDs
"0x1"     // Ethereum
"0x89"    // Polygon
"0x38"    // BSC
"0xa4b1"  // Arbitrum
"0xa"     // Optimism
"0x2105"  // Base
"0xa86a"  // Avalanche
"0xfa"     // Fantom
```

### Address Format Verification

```typescript
function isValidEVMAddress(address: string): boolean {
  return /^0x[a-fA-F0-9]{40}$/.test(address);
}

function isValidSolanaAddress(address: string): boolean {
  // Base58 format check
  return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(address);
}

// Usage
const address = [REDACTED_SECRET];
if (!isValidEVMAddress(address)) {
  throw new Error('Invalid EVM address');
}
```

### Path Parameter Replacement

```typescript
// ❌ WRONG - Not replacing all path params
const url = '/:address/erc20'; // Still has :address

// ✅ CORRECT - Replace path params with actual values
const url = `/${address}/erc20`;

// For multiple params
const url = `/${address}/nft?chain=${chain}&limit=${limit}`;
```

### Base URL Confusion

```typescript
// Data API
const DATA_API_URL = 'https://deep-index.moralis.io/api/v2.2';

// Streams API (different!)
const STREAMS_API_URL = 'https://api.moralis-streams.com';

// ❌ WRONG - Mixing base URLs
fetch(`${DATA_API_URL}/streams/evm`); // Wrong endpoint

// ✅ CORRECT - Use correct base URL
fetch(`${STREAMS_API_URL}/streams/evm`);
```

### Decimal vs Hex Numbers

```typescript
function parseBlockNumber(value: any): number {
  // Most endpoints return decimal
  if (typeof value === 'number') return value;
  if (typeof value === 'string') {
    // Check if it's hex (starts with 0x)
    if (value.startsWith('0x')) {
      console.warn('Hex block number detected - verify in endpoint rule file');
      return parseInt(value, 16);
    }
    return parseInt(value, 10);
  }
  throw new Error('Invalid block number format');
}

// Usage
const blockNumber = parseBlockNumber(data.block_number);
```

## Debugging Tips

### Logging Response Structure

```typescript
async function safeFetch(url: string): Promise<any> {
  const response = await fetch(url);

  // Log raw response for debugging
  console.log('Raw response:', response);

  // Check structure before processing
  if (Array.isArray(response)) {
    console.log('Detected: Direct array');
  } else if (response.result !== undefined) {
    console.log('Detected: Wrapped response');
    if (response.cursor !== undefined) {
      console.log('Detected: Cursor pagination');
    }
  } else {
    console.log('Detected: Single object');
  }

  return response;
}
```

### Common Error Messages and Causes

| Error Message                      | Likely Cause                          | Solution                           |
| --------------------------------- | ------------------------------------- | ---------------------------------- |
| "Cannot read property 'result'"     | Response is direct array               | Use `data` instead of `data.result` |
| "Cannot read property 'cursor'"   | No pagination on this endpoint       | Don't use cursor parameter           |
| "map is not a function"          | Assumed array, got object            | Check for `.result` wrapper         |
| "Property does not exist on type" | Wrong field name (case sensitive) | Verify exact name in rule file      |
| NaN when parsing numbers            | Wrong number format/radix         | Check hex vs decimal                |
| Invalid Date when parsing timestamp | Wrong timestamp format             | Check ISO vs Unix                  |

## Prevention Checklist

Before implementing ANY endpoint:

- [ ] Read the endpoint rule file
- [ ] Check the HTTP method (GET vs POST vs PUT vs DELETE)
- [ ] Check the exact endpoint path (path params vs query params)
- [ ] Verify the "Example Response" structure
- [ ] Note EVERY field name (snake_case vs camelCase)
- [ ] Note EVERY data type (string vs number vs boolean)
- [ ] Check for wrapper structure (`result`, `cursor`, `page`)
- [ ] Test with real API response (not just examples)

Skipping any of these steps will result in bugs.


path: references/DataTransformations.md
content: # Data Transformations Reference

Complete reference for type conversions, field mappings, and data transformations when working with Moralis Data API.

## Table of Contents

- [Block Number Handling](#block-number-handling)
- [Timestamp Conversions](#timestamp-conversions)
- [Balance/Amount Handling](#balanceamount-handling)
- [snake_case to camelCase Patterns](#snake_case--camelcase-patterns)
- [Boolean String Handling](#boolean-string-handling)
- [Common Field Mappings](#common-field-mappings)
- [Type Conversion Utility Functions](#type-conversion-utility-functions)
- [Best Practices](#best-practices)

---

## Block Number Handling

**NEVER hex, always decimal:**

```typescript
// Most endpoints return decimal (NOT hex)
block_number: 12386788           → number (use directly)
block_number: "12386788"         → parseInt(block_number, 10)
```

**Rare exceptions:**
Some specialized endpoints may return hex strings, but **always verify in the endpoint rule file first**.

## Timestamp Conversions

### ISO 8601 to Unix Timestamp

```typescript
// ISO 8601 string → Unix timestamp (milliseconds)
"2021-05-07T11:08:35.000Z" → new Date(timestamp).getTime()
```

### Unix Timestamp (Seconds) to Milliseconds

```typescript
// Unix timestamp (seconds) → milliseconds
1620394115 → timestamp * 1000
```

### Detecting Timestamp Format

```typescript
function parseTimestamp(timestamp: any): number {
  if (typeof timestamp === 'number') {
    // Unix timestamp (check if seconds or milliseconds)
    return timestamp < 10000000000 ? timestamp * 1000 : timestamp;
  } else if (typeof timestamp === 'string') {
    // ISO 8601 string
    return new Date(timestamp).getTime();
  }
  return timestamp;
}
```

## Balance/Amount Handling

### Native Token Balances (Wei/Smallest Unit)

```typescript
// Native token balances: Wei/Smallest unit → Formatted
balance: "1000000000000000000"

// Option 1: Manual conversion
const formatted = (Number(BigInt(balance)) / 1e18).toFixed(6);

// Option 2: Using ethers.js
import { formatUnits } from 'ethers';
const formatted = formatUnits(balance, 18);

// Option 3: Use getWalletTokenBalancesPrice which returns formatted field
```

### Token Balances with Decimals

```typescript
// ERC20 token balances with decimals field
{
  "balance": "1000000000000000000",
  "decimals": 18
}

// Convert to human-readable
const formatted = (parseInt(balance) / Math.pow(10, decimals)).toFixed(6);
```

## snake_case → camelCase Patterns

### General Pattern

```typescript
// API response → TypeScript interface
{
  token_address: string;
  from_address_label: string;
  block_number: string;
  total_token_balances: number;
}
→ {
  tokenAddress: string;
  fromAddressLabel: string;
  blockNumber: string;
  totalTokenBalances: number;
}
```

### Automatic Transformation Function

```typescript
function toCamelCase(str: string): string {
  return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
}

// Example: toCamelCase('token_address') → 'tokenAddress'
```

## Boolean String Handling

API often returns boolean values as strings "true"/"false" or "1"/"0":

```typescript
// API returns "1" or "0", not boolean
receipt_status: "1"   → status: receipt_status === "1" ? "success" : "failed"

// API returns "true" or "false" strings
possible_spam: "false" → possibleSpam === "true"
possible_spam: "true"  → possibleSpam === "true"

// Normalize to boolean
function toBool(value: string | boolean): boolean {
  if (typeof value === 'boolean') return value;
  return value === 'true' || value === '1';
}
```

## Common Field Mappings

### Entity/Label Fields

```typescript
from_address_entity       → fromAddressEntity
from_address_entity_logo  → fromAddressEntityLogo
from_address_label        → fromAddressLabel
to_address_entity         → toAddressEntity
to_address_entity_logo    → toAddressEntityLogo
to_address_label          → toAddressLabel
owner_of_entity           → ownerOfEntity
owner_of_entity_logo      → ownerOfEntityLogo
owner_of_label            → ownerOfLabel
```

### Transaction Fields

```typescript
block_number        → blockNumber
block_timestamp     → blockTimestamp (ISO string!)
transaction_hash    → hash (or txHash)
receipt_gas_used    → receiptGasUsed
receipt_status      → status ("1" = success)
transaction_index   → transactionIndex
```

### Token/NFT Fields

```typescript
token_address       → tokenAddress
token_id            → tokenId (keep as string!)
token_decimal       → tokenIdDecimal (when in decimal format)
contract_type       → contractType
possible_spam       → possibleSpam (string "true"/"false")
verified_collection → verifiedCollection (string "true"/"false")
```

### DeFi Fields

```typescript
protocol_address   → protocolAddress
protocol_name      → protocolName
protocol_logo      → protocolLogo
defi_summary      → defiSummary
```

### Blockchain Fields

```typescript
block_hash        → blockHash
block_number      → blockNumber
block_timestamp   → blockTimestamp
transaction_hash  → hash (or txHash)
gas_used          → gasUsed
gas_price         → gasPrice
```

## Type Conversion Utility Functions

### Safe Number Parsing

```typescript
function safeParseInt(value: any, radix: number = 10): number {
  if (typeof value === 'number') return value;
  if (typeof value === 'string') return parseInt(value, radix);
  return 0;
}

function safeParseFloat(value: any): number {
  if (typeof value === 'number') return value;
  if (typeof value === 'string') return parseFloat(value);
  return 0;
}
```

### Safe BigInt Handling

```typescript
function toBigInt(value: any): bigint | null {
  if (typeof value === 'bigint') return value;
  if (typeof value === 'string' && value) {
    try {
      return BigInt(value);
    } catch {
      return null;
    }
  }
  return null;
}
```

## Best Practices

1. **Always check the endpoint rule file** for exact field names and types
2. **Never assume data types** - Verify with actual API response examples
3. **Handle optional fields** with optional chaining (`?.`) or default values
4. **Test with real data** - Use actual API responses, not just examples
5. **Log unexpected values** - If you see unexpected formats, verify in rule file


path: references/DefiProtocols.md
content: # DeFi Protocols and Chains

List of supported DeFi protocols and chains for DeFi position and protocol-related endpoints.

## Supported DeFi Protocols by Chain

### Ethereum (0x1)
- Aave V2, V3
- Compound V2, V3
- Uniswap V2, V3
- SushiSwap
- Curve Finance
- Balancer
- Yearn Finance
- Lido
- MakerDAO
- Convex Finance

### Polygon (0x89)
- Aave V3
- QuickSwap
- SushiSwap
- Curve Finance
- Balancer
- Lido

### BSC (0x38)
- PancakeSwap V2, V3
- Alpaca Finance
- Venus
- Biswap
- BakerySwap

### Arbitrum (0xa4b1)
- Aave V3
- Uniswap V3
- SushiSwap
- Curve Finance
- Balancer
- GMX

### Base (0x2105)
- Aave V3
- Uniswap V3
- SushiSwap
- Curve Finance

### Optimism (0xa)
- Aave V3
- Uniswap V3
- SushiSwap
- Curve Finance
- Balancer
- Velodrome

### Avalanche (0xa86a)
- Aave V3
- Trader Joe
- Pangolin
- Benqi
- Curve Finance

## Related Endpoints

- [getDefiSummary](rules/getDefiSummary.md) - Get DeFi summary of a wallet
- [getDefiPositionsSummary](rules/getDefiPositionsSummary.md) - Get DeFi positions of a wallet
- [getDefiPositionsByProtocol](rules/getDefiPositionsByProtocol.md) - Get detailed DeFi positions by protocol

## Documentation

For complete list of supported DeFi protocols per chain, see:
[https://docs.moralis.com/web3-data-api/evm/defi-protocols-and-chains](https://docs.moralis.com/web3-data-api/evm/defi-protocols-and-chains)


path: references/FilteredTokens.md
content: # Filtered Tokens Reference

Complete reference for the `getFilteredTokens` endpoint (`POST /discovery/tokens`). Use this to build token screeners, discovery tools, and market analysis dashboards.

## Metrics

All 21 `tokenExplorerMetrics` values:

| Metric | Description |
|--------|-------------|
| `experiencedBuyers` | Number of experienced (non-new) wallet addresses buying the token |
| `experiencedSellers` | Number of experienced wallet addresses selling the token |
| `netExperiencedBuyers` | Experienced buyers minus experienced sellers |
| `buyers` | Total number of unique buyer addresses |
| `sellers` | Total number of unique seller addresses |
| `netBuyers` | Buyers minus sellers (positive = more buying pressure) |
| `holders` | Change in holder count over the timeframe |
| `totalHolders` | Total number of token holders (use with timeframe `oneDay`) |
| `tokenAge` | Age of the token in days since first seen on-chain |
| `usdPrice` | Current token price in USD |
| `usdPricePercentChange` | Price change as a percentage over the timeframe |
| `marketCap` | Market capitalization in USD |
| `fullyDilutedValuation` | Fully diluted valuation (price x total supply) |
| `volumeUsd` | Total trading volume in USD |
| `buyVolumeUsd` | Buy-side trading volume in USD |
| `sellVolumeUsd` | Sell-side trading volume in USD |
| `netVolumeUsd` | Buy volume minus sell volume in USD |
| `liquidityChange` | Percentage change in liquidity |
| `liquidityChangeUSD` | Absolute change in liquidity in USD |
| `totalLiquidityUsd` | Total liquidity in USD (use with timeframe `oneDay`) |
| `securityScore` | Token security/quality score (0-100, use with timeframe `oneDay`) |

## TimeFrames

All 8 `tokenExplorerTimeFrames` values:

| Value | Period |
|-------|--------|
| `tenMinutes` | 10 minutes |
| `thirtyMinutes` | 30 minutes |
| `oneHour` | 1 hour |
| `fourHours` | 4 hours |
| `twelveHours` | 12 hours |
| `oneDay` | 24 hours |
| `oneWeek` | 7 days |
| `oneMonth` | 30 days |

**Note:** Some metrics like `securityScore`, `totalHolders`, and `totalLiquidityUsd` are point-in-time values — use `oneDay` as the timeframe.

## Filter Object

Each filter requires `metric` + `timeFrame` + at least one comparison operator:

```json
{
  "metric": "volumeUsd",
  "timeFrame": "oneDay",
  "gt": 100000,
  "lt": 50000000
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `metric` | string | Yes | One of the 21 metrics above |
| `timeFrame` | string | Yes | One of the 8 timeframes above |
| `gt` | number | No | Greater than this value |
| `lt` | number | No | Less than this value |
| `eq` | number | No | Equal to this value |

Multiple filters in the `filters` array are combined with **AND logic** — all must match.

## Sort Configuration

```json
{
  "metric": "volumeUsd",
  "timeFrame": "oneDay",
  "type": "DESC"
}
```

| Field | Type | Required | Values |
|-------|------|----------|--------|
| `metric` | string | Yes | Any metric from the table above |
| `timeFrame` | string | Yes | Any timeframe from the table above |
| `type` | string | Yes | `ASC` or `DESC` |

## Categories

Use `categories` to include or exclude token categories:

```json
{
  "categories": {
    "include": ["meme"],
    "exclude": ["stablecoin"]
  }
}
```

Known category values: `stablecoin`, `meme`. Both `include` and `exclude` accept arrays of strings. You can use one or both.

## Practical Examples

### 1. Top tokens by 24h volume on Ethereum

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/discovery/tokens" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "chain": "0x1",
  "filters": [
    {"metric": "volumeUsd", "timeFrame": "oneDay", "gt": 500000}
  ],
  "sortBy": {"metric": "volumeUsd", "timeFrame": "oneDay", "type": "DESC"},
  "limit": 10,
  "metricsToReturn": ["volumeUsd", "usdPrice", "usdPricePercentChange"],
  "timeFramesToReturn": ["oneDay"]
}'
```

### 2. Tokens gaining holders with high security score

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/discovery/tokens" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "chain": "0x1",
  "filters": [
    {"metric": "holders", "timeFrame": "oneDay", "gt": 100},
    {"metric": "securityScore", "timeFrame": "oneDay", "gt": 70}
  ],
  "sortBy": {"metric": "holders", "timeFrame": "oneDay", "type": "DESC"},
  "limit": 20,
  "categories": {"exclude": ["stablecoin"]}
}'
```

### 3. Multi-chain meme token screener

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/discovery/tokens" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "chains": ["0x1", "0x89", "0x38", "0x2105"],
  "filters": [
    {"metric": "volumeUsd", "timeFrame": "oneDay", "gt": 50000},
    {"metric": "usdPricePercentChange", "timeFrame": "oneDay", "gt": 5}
  ],
  "sortBy": {"metric": "usdPricePercentChange", "timeFrame": "oneDay", "type": "DESC"},
  "limit": 20,
  "categories": {"include": ["meme"]}
}'
```

### 4. Whale accumulation detector

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/discovery/tokens" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "chain": "0x1",
  "filters": [
    {"metric": "netExperiencedBuyers", "timeFrame": "oneWeek", "gt": 50},
    {"metric": "netVolumeUsd", "timeFrame": "oneDay", "gt": 100000},
    {"metric": "totalLiquidityUsd", "timeFrame": "oneDay", "gt": 500000}
  ],
  "sortBy": {"metric": "netExperiencedBuyers", "timeFrame": "oneWeek", "type": "DESC"},
  "limit": 15,
  "excludeMetadata": true
}'
```

## Important Notes

- **`chain` vs `chains`**: Use `chain` (string) for a single chain, or `chains` (array) for multi-chain queries. One is required.
- **AND logic**: All filters must match — there is no OR combinator. To get OR-like behavior, make separate requests.
- **`metricsToReturn` vs `filters`**: Filters control which tokens match; `metricsToReturn` controls which metric data appears in the response. You can filter on a metric without returning it.
- **`excludeMetadata`**: Set to `true` to skip token metadata (name, symbol, logo, etc.) and reduce payload size. Useful for analytics pipelines.
- **`timeFramesToReturn`**: Limits which timeframe buckets appear in response metrics. If omitted, all timeframes are returned.
- **Numeric filter values**: Pass `gt`, `lt`, `eq` as numbers (not strings) in the JSON body.


path: references/NftMarketplaces.md
content: # NFT Marketplaces

List of supported NFT marketplaces for NFT trade, floor price, and collection-related endpoints.

## Supported NFT Marketplaces by Chain

### Ethereum (0x1)
- OpenSea
- Blur
- X2Y2
- LookRare
- Rarible
- Foundation
- SuperRare
- NFTX
- Sudoswap
- Element Market

### Polygon (0x89)
- OpenSea
- Blur
- Tixel (Element)
- Rarible

### BSC (0x38)
- OpenSea
- Tixel (Element)
- NFTTrade

### Arbitrum (0xa4b1)
- OpenSea
- Blur
- Rarible

### Base (0x2105)
- OpenSea
- Blur
- Rarible

### Optimism (0xa)
- OpenSea
- Blur
- Rarible
- NFTX

### Avalanche (0xa86a)
- OpenSea
- Tixel (Element)
- Chillswitch

## Related Endpoints

- [getNFTTrades](rules/getNFTTrades.md) - Get NFT trades by collection
- [getNFTTradesByToken](rules/getNFTTradesByToken.md) - Get NFT trades by token
- [getNFTTradesByWallet](rules/getNFTTradesByWallet.md) - Get NFT trades by wallet address
- [getNFTFloorPriceByContract](rules/getNFTFloorPriceByContract.md) - Get NFT floor price by contract
- [getNFTFloorPriceByToken](rules/getNFTFloorPriceByToken.md) - Get NFT floor price by token
- [getNFTContractSalePrices](rules/getNFTContractSalePrices.md) - Get NFT sale prices by collection
- [getNFTHistoricalFloorPriceByContract](rules/getNFTHistoricalFloorPriceByContract.md) - Get historical NFT floor price by contract

## Documentation

For complete list of supported NFT marketplaces per chain, see:
[https://docs.moralis.com/web3-data-api/evm/nft-marketplaces](https://docs.moralis.com/web3-data-api/evm/nft-marketplaces)


path: references/Pagination.md
content: # Pagination

Cursor-based pagination for endpoints that return multiple results.

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `limit` | number | Number of results per page (typically 1-100) |
| `cursor` | string | Cursor from previous response to get next page |

## Pattern

Each response returns a `cursor` value. Use that cursor in the next request to get the next page of results. When the cursor is empty or null, there are no more results.

```bash
# First request
curl "https://deep-index.moralis.io/api/v2.2/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/nft?chain=0x1&limit=100" \
  -H "X-[REDACTED_SECRET]"

# Response includes: {"cursor": "<cursor_value>", ...}

# Next page (use cursor from response)
curl "https://deep-index.moralis.io/api/v2.2/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/nft?chain=0x1&limit=100&cursor=<cursor_from_previous_response>" \
  -H "X-[REDACTED_SECRET]"
```

## Implementation Example (bash)

```bash
#!/usr/bin/env bash

[REDACTED_SECRET]"
ADDRESS=[REDACTED_SECRET]
CHAIN="0x1"
LIMIT=100
cursor=""

while true; do
  if [ -z "$cursor" ]; then
    url="https://deep-index.moralis.io/api/v2.2/${ADDRESS}/nft?chain=${CHAIN}&limit=${LIMIT}"
  else
    url="https://deep-index.moralis.io/api/v2.2/${ADDRESS}/nft?chain=${CHAIN}&limit=${LIMIT}&cursor=${cursor}"
  fi

  response=$(curl -s "$url" -H "X-[REDACTED_SECRET]")
  cursor=$(echo "$response" | jq -r '.cursor // empty')

  # Process results here
  echo "$response" | jq '.result'

  # Check if we've reached the end
  if [ -z "$cursor" ] || [ "$cursor" = "null" ]; then
    break
  fi
done
```

## Notes

- The `limit` parameter can only be set in the initial call
- Cursor value is returned in the response body
- Pagination continues until `cursor` is empty string or null


path: references/PerformanceAndLatency.md
content: # Performance & Latency

Best practices for optimizing Data API response times and configuring client timeouts.

## General Response Times

Most endpoints return responses quickly under normal conditions. Simple lookups (balance, price, metadata) are the fastest. Complex decoded endpoints (wallet history, DeFi positions) may take longer, especially for wallets with extensive on-chain activity.

## What Affects Response Time

### Wallet Size

Wallets with large transaction histories (whale/power-user wallets) require more processing. Use pagination with reasonable `limit` values (25–50) for these.

### Chain

Some chains have inherently higher latency than others. Response times can vary across chains.

### Query Complexity

Decoded endpoints (`getWalletHistory`) do more work than raw endpoints (`getWalletTransactions`). Endpoints that aggregate data across multiple sources (net worth, DeFi positions) also take longer.

### Concurrent Load

Peak traffic times may increase response times across all endpoints.

## Recommended Client Timeouts

| Use Case | Recommended Timeout |
|----------|---------------------|
| Simple queries (balance, price, metadata) | 10s |
| Complex queries (wallet history, DeFi positions) | 30s |
| Paginated bulk fetches | 30s per page |

The 30s timeout ensures you handle edge cases where a large wallet or a slower chain takes longer than usual. Most requests will return much faster.

## Pagination for Performance

Use smaller `limit` values (25–50) for faster per-request response times on heavy wallets. Larger limits (100) are fine for simple endpoints like token metadata or price lookups.

```bash
# Faster for large wallets — smaller pages
curl "...?limit=25&cursor=..." -H "X-[REDACTED_SECRET]"

# Fine for simple endpoints
curl "...?limit=100" -H "X-[REDACTED_SECRET]"
```

## Rate Limiting & Throughput

429 responses mean you've exceeded your plan's CU/s throughput. Implement exponential backoff:

```
Retry 1: wait 1s
Retry 2: wait 2s
Retry 3: wait 4s
Retry 4: wait 8s (max)
```

See [../../learn-moralis/references/FAQ.md](../../learn-moralis/references/FAQ.md) for plan-specific rate limits.

## Caching Recommendations

| Data Type | Recommended TTL | Reason |
|-----------|----------------|--------|
| Token metadata | 30–60s | Changes rarely |
| Token prices | 10–30s | Changes frequently |
| Wallet balances | 10–30s | Updates on each transaction |
| Historical data (completed transactions) | Cache aggressively | Immutable once confirmed |

## Multi-Chain Parallel Queries

When querying multiple chains for the same wallet, run requests in parallel (not sequential) to reduce total wait time.

**Best practice:** Use `getWalletActiveChains` first to discover which chains have activity, then query only those chains in parallel. This avoids wasting time on chains with no data.

```javascript
// 1. Find active chains
const activeChains = await getWalletActiveChains(address);

// 2. Query only active chains in parallel
const results = await Promise.all(
  activeChains.map(chain => getWalletTokenBalancesPrice(address, chain))
);
```


path: references/ResponsePatterns.md
content: # Response Patterns Reference

Complete reference for pagination patterns and response wrapper structures in Moralis Data API.

## Table of Contents

- [Pattern 1: No Pagination (Single Result)](#pattern-1-no-pagination-single-result)
- [Pattern 2: Simple Cursor/Page](#pattern-2-simple-cursorpage)
- [Pattern 3: Full Pagination with Metadata](#pattern-3-full-pagination-with-metadata)
- [Pattern 4: Direct Array (No Wrapper)](#pattern-4-direct-array-no-wrapper)
- [How to Detect Which Pattern](#how-to-detect-which-pattern)
- [Common Access Patterns](#common-access-patterns)
- [Error Handling by Pattern](#error-handling-by-pattern)
- [Best Practices](#best-practices)

---

## Pattern 1: No Pagination (Single Result)

### Description
Returns a single object with no pagination.

### Common Endpoints
- `getBlock`
- `getTransaction`
- `getTransactionVerbose`
- `getNativeBalance`
- `getTokenPrice`
- `getPairPrice`
- `getDateToBlock`
- `getLatestBlockNumber`

### Example Response

```typescript
{
  "hash": "0x...",
  "block_number": 12386788,
  "timestamp": "2021-05-07T11:08:35.000Z"
}
```

### Usage Pattern

```typescript
// No array handling needed
const block = await getBlock(blockNumber);
console.log(block.hash);
console.log(block.block_number);
```

## Pattern 2: Simple Cursor/Page

### Description
Returns wrapped object with `result`, `cursor`, `page`, and `page_size`. Data is in `result` array.

### Common Endpoints
- `getWalletTransactions`
- `getWalletTransactionsVerbose`

### Example Response

```typescript
{
  "cursor": "<cursor_value>",
  "page": "2",
  "page_size": "100",
  "result": [
    { "hash": "0x...", ... },
    { "hash": "0x...", ... }
  ]
}
```

### Usage Pattern

```typescript
// First page
const { result, cursor, page } = await getWalletTransactions(address, chain, limit);

// Next page
const { result: nextResults, cursor: nextCursor, page: nextPage } =
  await getWalletTransactions(address, chain, limit, cursor);

// Process results
result.forEach(tx => {
  console.log(tx.hash);
});
```

## Pattern 3: Full Pagination with Metadata

### Description
Returns wrapped object with `page`, `page_size`, `cursor`, and `result`. Similar to Pattern 2 but with explicit `page` field.

### Common Endpoints
- `getWalletHistory`
- `getNFTTransfers`
- `getErc20Transfers` (getWalletTokenTransfers)
- `getWalletNFTTransfers`
- `getTokenTransfers`

### Example Response

```typescript
{
  "page": "1",
  "page_size": "100",
  "cursor": "<cursor_value>",
  "result": [
    { "token_address": "0x...", ... },
    { "token_address": "0x...", ... }
  ]
}
```

### Usage Pattern

```typescript
// First page
const { result, cursor, page, pageSize } = await getWalletHistory(address, chain, limit);

// Next page
const { result: nextResults, cursor: nextCursor, page: nextPage } =
  await getWalletHistory(address, chain, limit, cursor);

// Process results
result.forEach(item => {
  console.log(item.token_address);
});
```

## Pattern 4: Direct Array (No Wrapper)

### Description
Returns an array directly at top level. No wrapper object.

### Common Endpoints
- `getWalletTokenBalancesPrice`
- `getTokenMetadata` (sometimes, depends on endpoint)
- `getTokenOwners`
- `getWalletNFTs`
- `getContractNFTs`
- `getMultipleTokenMetadata`

### Example Response

```typescript
[
  {
    "token_address": "0x...",
    "name": "USDC",
    "symbol": "USDC",
    "decimals": 6,
    "balance": "100000000"
  },
  {
    "token_address": "0x...",
    "name": "USDT",
    "symbol": "USDT",
    "decimals": 18,
    "balance": "500000000000000000000"
  }
]
```

### Usage Pattern

```typescript
// Direct array access - no .result needed
const tokens = await getWalletTokenBalancesPrice(address, chain);

tokens.forEach(token => {
  console.log(token.token_address);
  console.log(token.balance);
});
```

## How to Detect Which Pattern

### Step-by-Step Detection

1. **Read the endpoint rule file** - Look for "Example Response" section
2. **Check if `result` key exists** - If yes, data is wrapped
3. **Check if `cursor` key exists** - If yes, pagination is supported
4. **Check if top-level is array** - If yes, direct array response
5. **Verify with example** - Match the example response structure in rule file

### Detection Helper Function

```typescript
interface ApiResponse<T = any> {
  result?: T[];
  cursor?: string;
  page?: string;
  page_size?: string;
}

function getResponseStructure(data: any): 'single' | 'cursor' | 'direct-array' {
  // Direct array
  if (Array.isArray(data)) return 'direct-array';

  // Wrapped with result
  if (data.result !== undefined) {
    if (data.cursor !== undefined) return 'cursor';
    if (data.page !== undefined) return 'cursor';
    return 'wrapped'; // result exists but no cursor
  }

  // Single object
  return 'single';
}
```

## Common Access Patterns

### Safe Data Extraction

```typescript
// Pattern 1: Single result
const block: any = await getBlock(blockNumber);

// Pattern 2/3: Wrapped with result
const { result: transactions } = await getWalletTransactions(address, chain);

// Pattern 4: Direct array
const tokens = await getWalletTokenBalancesPrice(address, chain);

// Universal safe access
function extractData<T = any>(response: any): T | T[] {
  if (Array.isArray(response)) return response;
  if (response.result) return response.result;
  return response;
}
```

### Pagination Wrapper

```typescript
async function fetchAllPages<T = any>(
  fetchFn: (cursor?: string) => Promise<{ result: T[]; cursor?: string }>,
  maxPages: number = 10
): Promise<T[]> {
  const allResults: T[] = [];
  let cursor: string | undefined;

  for (let i = 0; i < maxPages; i++) {
    const { result, cursor: newCursor } = await fetchFn(cursor);
    allResults.push(...result);

    if (!newCursor) break; // No more pages
    cursor = newCursor;
  }

  return allResults;
}

// Usage
const allTransactions = await fetchAllPages(
  (cursor) => getWalletTransactions(address, chain, 100, cursor)
);
```

## Error Handling by Pattern

### Pattern 1: Single Result

```typescript
try {
  const block = await getBlock(blockNumber);
  if (!block) {
    throw new Error('Block not found');
  }
} catch (error) {
  console.error('Failed to fetch block:', error);
}
```

### Pattern 2/3: Cursor/Page

```typescript
try {
  const { result, cursor } = await getWalletTransactions(address, chain, limit);
  if (!result || result.length === 0) {
    console.log('No transactions found');
    return [];
  }
} catch (error) {
  console.error('Failed to fetch transactions:', error);
}
```

### Pattern 4: Direct Array

```typescript
try {
  const tokens = await getWalletTokenBalancesPrice(address, chain);
  if (!tokens || tokens.length === 0) {
    console.log('No tokens found');
    return [];
  }
} catch (error) {
  console.error('Failed to fetch tokens:', error);
}
```

## Best Practices

1. **Always read the endpoint rule file first** - Example response shows exact structure
2. **Never assume array vs object** - Check if `result` wrapper exists
3. **Use optional chaining** - Access wrapped data safely: `data.result?.[0]?.field`
4. **Test pagination** - Verify cursor works by fetching 2 pages in development
5. **Handle empty results** - Some endpoints return empty arrays or empty `result`
6. **Log response structure** - If unexpected, verify against rule file example


path: references/SupportedApisAndChains.md
content: # Supported APIs and Chains

Complete list of supported Web3 Data APIs and blockchain networks with feature availability per chain.

## API Categories

| API Category              | Field Name       | Description                                  |
| ------------------------- | ---------------- | -------------------------------------------- |
| **Wallet API**            | `walletApi`      | Balances, transactions, history, approvals   |
| **NFT API**               | `nftApi`         | Metadata, transfers, collections             |
| **Token API**             | `tokenApi`       | Prices, metadata, pairs, holders             |
| **DeFi API**              | `defiApi`        | Protocol positions, liquidity                |
| **Entity API**            | `entityApi`      | Labeled addresses (exchanges, funds, whales) |
| **Blockchain API**        | `blockchainApi`  | Blocks, transactions                         |
| **Profitability API**     | `pnlApi`         | Wallet profit/loss analysis                  |
| **Token Prices**          | `tokenPrices`    | ERC20 token price data                       |
| **Internal Transactions** | `internalTxs`    | Internal ETH transfers                       |
| **NFT Trades**            | `nftTrades`      | NFT trade history                            |
| **NFT Prices**            | `nftPrices`      | NFT sale prices                              |
| **NFT Floor Prices**      | `nftFloorPrices` | NFT floor price data                         |

## Support by Chain

Legend: ✅ Supported | ❌ Not Supported | 🔄 Coming Soon

### Major EVM Chains

| Chain                  | Wallet | NFT | Token | DeFi | Entity | Blockchain | PnL | Prices | Internal Tx | NFT Trades | NFT Prices | Floor Prices |
| ---------------------- | ------ | --- | ----- | ---- | ------ | ---------- | --- | ------ | ----------- | ---------- | ---------- | ------------ |
| **Ethereum** (0x1)     | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ✅  | ✅     | ✅          | ✅         | ✅         | ✅           |
| **Sepolia** (0xaa36a7) | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Holesky** (0x4268)   | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Polygon** (0x89)     | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ✅  | ✅     | ✅          | ✅         | ✅         | ❌           |
| **Amoy** (0x13882)     | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **BSC** (0x38)         | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ✅         | ✅         | ❌           |
| **BSC Testnet** (0x61) | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |

### L2 Chains

| Chain                           | Wallet | NFT | Token | DeFi | Entity | Blockchain | PnL | Prices | Internal Tx | NFT Trades | NFT Prices | Floor Prices |
| ------------------------------- | ------ | --- | ----- | ---- | ------ | ---------- | --- | ------ | ----------- | ---------- | ---------- | ------------ |
| **Arbitrum** (0xa4b1)           | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ✅         | ✅         | ❌           |
| **Arbitrum Sepolia** (0x66eee)  | ❌     | ❌  | ❌    | ❌   | ❌     | ❌         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Base** (0x2105)               | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ✅  | ✅     | ✅          | ✅         | ✅         | ✅           |
| **Base Sepolia** (0x14a34)      | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Optimism** (0xa)              | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ✅         | ✅         | ❌           |
| **Optimism Sepolia** (0xaa37dc) | ❌     | ❌  | ❌    | ❌   | ❌     | ❌         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |

### Alternative Chains

| Chain                      | Wallet | NFT | Token | DeFi | Entity | Blockchain | PnL | Prices | Internal Tx | NFT Trades | NFT Prices | Floor Prices |
| -------------------------- | ------ | --- | ----- | ---- | ------ | ---------- | --- | ------ | ----------- | ---------- | ---------- | ------------ |
| **Avalanche** (0xa86a)     | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ✅         | ✅         | ❌           |
| **Fantom** (0xfa)          | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Fantom Testnet** (0xfa2) | ❌     | ❌  | ❌    | ❌   | ❌     | ❌         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Cronos** (0x19)          | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Gnosis** (0x64)          | ✅     | ❌  | ✅    | ❌   | ✅     | ✅         | ❌  | ✅     | ❌          | ❌         | ❌         | ❌           |
| **Gnosis Chiado** (0x27d8) | ✅     | ❌  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Linea** (0xe708)         | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ❌         | ❌         | ❌           |
| **Linea Sepolia** (0xe705) | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |

### Additional Chains

| Chain                        | Wallet | NFT | Token | DeFi | Entity | Blockchain | PnL | Prices | Internal Tx | NFT Trades | NFT Prices | Floor Prices |
| ---------------------------- | ------ | --- | ----- | ---- | ------ | ---------- | --- | ------ | ----------- | ---------- | ---------- | ------------ |
| **Chiliz** (0x15b38)         | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Chiliz Testnet** (0x15b32) | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Moonbeam** (0x504)         | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ✅     | ❌          | ❌         | ❌         | ❌           |
| **Moonriver** (0x505)        | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Moonbase** (0x507)         | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Flow** (0x2eb)             | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Flow Testnet** (0x221)     | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ❌          | ❌         | ❌         | ❌           |
| **Ronin** (0x7e4)            | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ✅     | ✅          | ❌         | ❌         | ❌           |
| **Ronin Saigon** (0x7e5)     | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Lisk** (0x46f)             | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Lisk Sepolia** (0x106a)    | ✅     | ✅  | ✅    | ❌   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Pulse** (0x171)            | ✅     | ❌  | ✅    | ❌   | ✅     | ✅         | ❌  | ✅     | ✅          | ❌         | ❌         | ❌           |
| **Sei** (0x531)              | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ✅         | ✅         | ✅           |
| **Sei Testnet** (0x530)      | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ❌     | ✅          | ❌         | ❌         | ❌           |
| **Monad** (0x8f)             | ✅     | ✅  | ✅    | ✅   | ✅     | ✅         | ❌  | ✅     | ✅          | ✅         | ✅         | ❌           |

### Coming Soon / Unsupported

| Chain                             | Status         |
| --------------------------------- | -------------- |
| **Blast** (0x13e31)               | 🔄 Coming Soon |
| **Blast Sepolia** (0xa0c71fd)     | 🔄 Coming Soon |
| **zkSync** (0x144)                | 🔄 Coming Soon |
| **zkSync Sepolia** (0x12c)        | 🔄 Coming Soon |
| **Mantle** (0x1388)               | 🔄 Coming Soon |
| **Mantle Sepolia** (0x138b)       | 🔄 Coming Soon |
| **opBNB** (0xcc)                  | 🔄 Coming Soon |
| **Polygon zkEVM** (0x44d)         | 🔄 Coming Soon |
| **Polygon zkEVM Cardona** (0x98a) | 🔄 Coming Soon |
| **Zetachain** (0x1b58)            | 🔄 Coming Soon |
| **Zetachain Testnet** (0x1b59)    | 🔄 Coming Soon |
| **HyperEVM** (0x3e7)              | ❌ Unsupported |

### Solana

Solana uses a separate base URL (`https://solana-gateway.moralis.io`) and dedicated endpoints with the `__solana` suffix.

| Network | Wallet | NFT | Token | Token Price | SPL |
| ------- | ------ | --- | ----- | ----------- | --- |
| **Mainnet** | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Devnet** | ✅ | ✅ | ✅ | ❌ | ✅ |

**Supported Solana APIs:**
- **Wallet**: Native balance (`balance__solana`), portfolio (`getPortfolio__solana`)
- **Token**: Metadata (`getTokenMetadata__solana`), prices (`getTokenPrice__solana`, `getMultipleTokenPrices__solana`)
- **NFT**: Metadata (`getNFTMetadata__solana`), owned NFTs (`getNFTs__solana`)
- **SPL**: SPL token balances (`getSPL__solana`)
- **Analytics**: Token scores, trending tokens, volume stats, candlesticks, pair stats

**Limitations:**
- No DeFi position tracking on Solana
- No profitability/PnL analysis
- No floor price data
- Price data only available on Mainnet

## Key Insights

### Full API Coverage

Only **Ethereum (0x1)** and **Base (0x2105)** have complete coverage of all APIs including floor prices.

### Strong Coverage (Most APIs)

- **Polygon** - Missing only floor prices
- **BSC** - Missing only profitability and floor prices
- **Arbitrum** - Missing profitability and floor prices
- **Avalanche** - Missing profitability and floor prices
- **Sei** - Missing profitability (new chain)

### Common Limitations

- **Profitability API**: Only supported on Ethereum, Polygon, Base
- **Internal Transactions**: Not available on most sidechains (Gnosis, Moonbeam family, Flow)
- **NFT Floor Prices**: Only Ethereum, Base, and Sei support this
- **DeFi API**: Testnets generally don't support DeFi protocol data

### Chain Query Params

When using the API, you can specify chains using:

- Hex format: `0x1`, `0x89`, `0x38`
- String format: `eth`, `polygon`, `bsc`

## Documentation

For complete and up-to-date support matrix:

- [Supported Web3 Data APIs](https://docs.moralis.com/supported-web3data-apis) - Interactive support table
- [Supported Chains for Web3 API](https://docs.moralis.com/supported-chains?service=web3api) - Chain-specific details


path: references/SupportedDexs.md
content: # Supported DEXs

List of supported Decentralized Exchanges (DEXs) for token API endpoints including pair addresses, reserves, prices, swaps, and stats.

## Supported DEXs by Chain

### Ethereum (0x1)
- Uniswap V2
- Uniswap V3
- SushiSwap
- PancakeSwap
- Balancer V2
- Curve
- Bancor
- Kyber Network

### Polygon (0x89)
- QuickSwap
- Uniswap V3
- SushiSwap
- Balancer V2
- Curve

### BSC (0x38)
- PancakeSwap V2
- PancakeSwap V3
- Biswap
- BakerySwap
- MDEX

### Arbitrum (0xa4b1)
- Uniswap V3
- SushiSwap
- Balancer V2
- Curve

### Base (0x2105)
- Uniswap V3
- SushiSwap
- Balancer V2
- Curve

### Avalanche (0xa86a)
- Trader Joe
- Pangolin
- Uniswap V3
- SushiSwap

## Related Endpoints

- [getPairAddress](rules/getPairAddress.md) - Get DEX token pair address
- [getPairReserves](rules/getPairReserves.md) - Get DEX token pair reserves
- [getPairPrice](rules/getPairPrice.md) - Get DEX token pair price
- [getSwapsByPairAddress](rules/getSwapsByPairAddress__evm.md) - Get swap transactions by pair
- [getSwapsByTokenAddress](rules/getSwapsByTokenAddress__evm.md) - Get swap transactions by token
- [getTokenPairs](rules/getTokenPairs__evm.md) - Get token pairs by address

## Documentation

For complete list of supported DEXs per chain, see:
[https://docs.moralis.com/web3-data-api/evm/supported-dexs-token-api](https://docs.moralis.com/web3-data-api/evm/supported-dexs-token-api)


path: references/TokenHoldersFaq.md
content: # Token Holders API FAQ

Frequently asked questions and important notes about the Token Holders API.

## Key Considerations

### Data Freshness
- Holder data is continuously updated
- May have a slight delay from blockchain state
- Large-cap tokens update more frequently

### Sampling for Large Tokens
- For tokens with many holders (>100,000), data may be sampled
- Provides representative subset rather than complete list
- Ensures API response performance

### Historical Holders
- Current holders: Addresses currently holding the token
- Historical holders: Includes addresses that previously held but no longer do

## Common Questions

**Q: How often is holder data updated?**
A: Continuously, with higher frequency for popular tokens.

**Q: Why do some tokens return fewer holders than expected?**
A: May be due to sampling for very large token sets, or recent transfers not yet indexed.

**Q: Can I get historical holder data?**
A: Yes, use the historical holders endpoints for time-series data.

**Q: What's the difference between holders and owners?**
A: Generally interchangeable, but "holders" typically refers to token balances while "owners" may include NFT ownership.

## Related Endpoints

- [getTokenHolders](rules/getTokenHolders__evm.md) - Get holders summary by token address
- [getHistoricalTokenHolders](rules/getHistoricalTokenHolders__evm.md) - Get time-series holders data
- [getTokenOwners](rules/getTokenOwners.md) - Get ERC20 token owners by contract
- [getTopHolders](rules/getTopHolders__solana.md) - Get top holders for a token (Solana)

## Documentation

For complete FAQ and details, see:
[https://docs.moralis.com/web3-data-api/evm/token-holders-api-faq](https://docs.moralis.com/web3-data-api/evm/token-holders-api-faq)


path: references/TokenSearch.md
content: # Token Search

Understanding token search functionality and how to find tokens by various criteria.

## Search Capabilities

The token search API allows you to find tokens using multiple search criteria:

### Search By
- **Contract Address**: Exact match for token contract
- **Pair Address**: DEX pair address
- **Token Name**: Partial or exact name match
- **Token Symbol**: Partial or exact symbol match

### Filtering Options

- **Chains**: Filter by specific blockchain(s)
- **Token Types**: Filter by token type (ERC20, etc.)
- **Categories**: Filter by token category
- **Market Cap**: Filter by market cap range
- **Volume**: Filter by trading volume

## Response Fields

Search results include:
- Token contract address
- Token name and symbol
- Decimals
- Logo/thumbnail URLs
- Chain information
- Market data (price, market cap, volume)
- Pair information (for DEX listings)

## Related Endpoints

- [searchTokens](rules/searchTokens.md) - Search for tokens by multiple criteria
- [getTokenMetadata](rules/getTokenMetadata__evm.md) - Get token metadata by contract
- [getTokenPairs](rules/getTokenPairs__evm.md) - Get token pairs by address

## Documentation

For complete token search documentation and examples, see:
[https://docs.moralis.com/web3-data-api/evm/token-search](https://docs.moralis.com/web3-data-api/evm/token-search)


path: references/WalletHistory.md
content: # Wallet History

Understanding wallet history transaction categories, classifications, and interpretation.

## Transaction Categories

Wallet history categorizes transactions into these main types:

### Native Transfers
- **Received**: Incoming native token transfers (ETH, MATIC, BNB, etc.)
- **Sent**: Outgoing native token transfers
- **Self**: Transactions sent to self (e.g., contract deployment)

### Token Transfers
- **ERC20**: Token transfers and approvals
- **ERC721**: NFT transfers
- **ERC1155**: Multi-token transfers

### Contract Interactions
- **Contract Interaction**: Transactions that interact with smart contracts
- Classified by protocol type (DEX, NFT marketplace, DeFi, etc.)

### Internal Transactions
- **Internal**: Internal value transfers within contract execution

### Classification Types

Each transaction may include:
- **Category**: Broad classification (e.g., "token-transfer", "contract-interaction")
- **Method**: Specific function called (e.g., "transfer", "swap")
- **Protocol**: Protocol name if applicable (e.g., "uniswap", "aave")
- **Direction**: "in" for incoming, "out" for outgoing

## Related Endpoints

- [getWalletHistory](rules/getWalletHistory.md) - Get complete decoded transaction history
- [getWalletTransactions](rules/getWalletTransactions.md) - Get native transactions
- [getWalletTransactionsVerbose](rules/getWalletTransactionsVerbose.md) - Get decoded transactions
- [getWalletTokenTransfers](rules/getWalletTokenTransfers.md) - Get ERC20 token transfers
- [getWalletNFTTransfers](rules/getWalletNFTTransfers.md) - Get NFT transfers

## Performance Characteristics

- Most requests return quickly, but response time depends on wallet activity volume and chain
- Wallets with extensive transaction history (whale wallets, power users) take longer to process
- Use pagination with smaller `limit` values (25–50) for large wallets
- Set client timeout to **30s** to handle edge cases

See [PerformanceAndLatency.md](PerformanceAndLatency.md) for full optimization guidance.

## Documentation

For complete wallet history documentation and examples, see:
[https://docs.moralis.com/web3-data-api/evm/wallet-history](https://docs.moralis.com/web3-data-api/evm/wallet-history)


path: rules/ApiResponseCodes.md
content: # API Response Reference

Common response formats, status codes, and field descriptions for the Moralis Web3 Data API.

## Status Codes

| Code | Description                               |
| ---- | ----------------------------------------- |
| 200  | Success                                   |
| 400  | Bad Request - Invalid parameters          |
| 401  | Unauthorized - Invalid or missing API key |
| 404  | Not Found - Resource doesn't exist        |
| 429  | Too Many Requests - Rate limit exceeded   |
| 500  | Internal Server Error                     |

## Common Response Fields

| Field     | Type   | Description                     |
| --------- | ------ | ------------------------------- |
| cursor    | string | Pagination cursor for next page |
| total     | number | Total count of results          |
| page      | number | Current page number             |
| page_size | number | Number of results per page      |
| result    | array  | The actual response data        |

## Error Response Format

```json
{
    "message": "Error description",
    "statusCode": 400
}
```


path: rules/SpamDetection.md
content: # Spam Detection

Understanding how Moralis detects and handles spam tokens and NFTs.

## How Spam Detection Works

Moralis uses multiple heuristics to identify potential spam:

### Token Spam Indicators
- Suspicious token names/symbols (mimicking legitimate projects)
- Low or no liquidity
- High supply held by few addresses
- Recent contract deployment
- No verified contract code
- Suspicious transaction patterns

### NFT Spam Indicators
- Bulk transfers to many wallets
- Hidden/delayed reveal
- Low or zero floor prices
- Suspicious metadata
- Known spam collections

## Spam Criteria

### Likely Spam
- Tokens with multiple red flags
- Unsolicited NFT airdrops
- Collections with no trading activity

### Possible Spam
- Tokens with some risk indicators
- Low-volume collections
- Recently deployed contracts

## Using Spam Detection

### Filter Results
Many endpoints support spam filtering:
- `excludeSpam=true` parameter filters out known spam
- Default behavior varies by endpoint

### Token and NFT Balances
- Wallet endpoints may flag spam tokens/NFTs
- Check token/contract metadata for spam indicators

## Related Endpoints

- [getWalletTokenBalancesPrice](rules/getWalletTokenBalancesPrice.md) - Get ERC20 balances with prices (supports spam filtering)
- [getWalletNFTs](rules/getWalletNFTs.md) - Get NFTs by wallet (supports spam filtering)
- [getTokenMetadata](rules/getTokenMetadata__evm.md) - Get token metadata (includes spam flags)
- [getNFTMetadata](rules/getNFTMetadata__evm.md) - Get NFT metadata (includes spam flags)
- [getTokenScore](rules/getTokenScore.md) - Get token security score (includes spam analysis)

## Documentation

For complete spam detection documentation, see:
[https://docs.moralis.com/web3-data-api/evm/spam-detection](https://docs.moralis.com/web3-data-api/evm/spam-detection)


path: rules/balance__solana.md
content: # Gets native balance owned by the given address

Gets native balance owned by the given address

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/account/:network/:address/balance`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs\` |

## Response Example

Status: 200

```json
{
  "solana": "solana_example",
  "lamports": "lamports_example"
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/balance" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getAggregatedTokenPairStats__evm.md
content: # Get aggregated token pair statistics by address

Summarize statistics across all supported pairs for a token. We recommended to use `getTokenAnalytics` or `getMultipleTokenAnalytics` for more accurate results.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/:token_address/pairs/stats`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| token_address | string | Yes | The address of the token | \`0x6982508145454ce325ddbe47a25d4ec3d2311933\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | Yes | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the statistics for supported pairs of the token.

```json
{
  "total_liquidity_usd": "total_liquidity_usd_example",
  "total_active_pairs": "total_active_pairs_example",
  "total_active_dexes": "total_active_dexes_example"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/erc20/0x6982508145454ce325ddbe47a25d4ec3d2311933/pairs/stats?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getAggregatedTokenPairStats__solana.md
content: # Get aggregated token pair statistics by address

Get aggregated statistics across supported pairs of a token.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/:address/pairs/stats`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`So11111111111111111111111111111111111111112\` |

## Response Example

Status: 200

```json
{
  "totalLiquidityUsd": 0,
  "totalActivePairs": 0,
  "totalActiveDexes": 0,
  "totalSwaps": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "totalVolume": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "totalBuyVolume": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "totalSellVolume": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "totalBuyers": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "totalSellers": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  }
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/So11111111111111111111111111111111111111112/pairs/stats" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getBlock.md
content: # Get block by hash

Get the contents of a block given the block hash.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/block/:block_number_or_hash`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| block_number_or_hash | string | Yes | The block number or block hash | \`15863321\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| include | string (internal_transactions) | No | If the result should contain the internal transactions. | \`-\` |

## Response Example

Status: 200

Returns the contents of a block

```json
{
  "timestamp": "2021-05-07T11:08:35.000Z",
  "number": 12386788,
  "hash": "0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171",
  "parent_hash": "0x011d1fc45839de975cc55d758943f9f1d204f80a90eb631f3bf064b80d53e045",
  "nonce": "0xedeb2d8fd2b2bdec",
  "sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "logs_bloom": "0xdde5fc46c5d8bcbd58207bc9f267bf43298e23791a326ff02661e99790da9996b3e0dd912c0b8202d389d282c56e4d11eb2dec4898a32b6b165f1f4cae6aa0079498eab50293f3b8defbf6af11bb75f0408a563ddfc26a3323d1ff5f9849e95d5f034d88a757ddea032c75c00708c9ff34d2207f997cc7d93fd1fa160a6bfaf62a54e31f9fe67ab95752106ba9d185bfdc9b6dc3e17427f844ee74e5c09b17b83ad6e8fc7360f5c7c3e4e1939e77a6374bee57d1fa6b2322b11ad56ad0398302de9b26d6fbfe414aa416bff141fad9d4af6aea19322e47595e342cd377403f417dfd396ab5f151095a5535f51cbc34a40ce9648927b7d1d72ab9daf253e31daf",
  "transactions_root": "0xe4c7bf3aff7ad07f9e80d57f7189f0252592fee6321c2a9bd9b09b6ce0690d27",
  "state_root": "0x49e3bfe7b618e27fde8fa08884803a8458b502c6534af69873a3cc926a7c724b",
  "receipts_root": "0x7cf43d7e837284f036cf92c56973f5e27bdd253ca46168fa195a6b07fa719f23",
  "miner": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
  "difficulty": "7253857437305950",
  "total_difficulty": "24325637817906576196890",
  "size": "61271",
  "extra_data": "0x65746865726d696e652d6575726f70652d7765737433",
  "gas_limit": "14977947",
  "gas_used": "14964688",
  "transaction_count": "252",
  "transactions": [
    {
      "hash": "0x1ed85b3757a6d31d01a4d6677fc52fd3911d649a0af21fe5ca3f886b153773ed",
      "nonce": "1848059",
      "transaction_index": "108",
      "from_address_entity": "Opensea",
      "from_address_entity_logo": "https://opensea.io/favicon.ico",
      "from_address": "0x267be1c1d684f78cb4f6a176c4911b741e4ffdc0",
      "from_address_label": "Binance 1",
      "to_address_entity": "Beaver Build",
      "to_address_entity_logo": "https://beaverbuild.com/favicon.ico",
      "to_address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
      "to_address_label": "Binance 2",
      "value": "115580000000000000",
      "gas": "30000",
      "gas_price": "52500000000",
      "input": "0x",
      "receipt_cumulative_gas_used": "4923073",
      "receipt_gas_used": "21000",
      "receipt_contract_address": null,
      "receipt_root": null,
      "receipt_status": "1",
      "block_timestamp": "2021-05-07T11:08:35.000Z",
      "block_number": "12386788",
      "block_hash": "0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171",
      "logs": [
        {
          "log_index": "273",
          "transaction_hash": "0xdd9006489e46670e0e85d1fb88823099e7f596b08aeaac023e9da0851f26fdd5",
          "transaction_index": "204",
          "address": "0x3105d328c66d8d55092358cf595d54608178e9b5",
          "data": "0x00000000000000000000000000000000000000000000000de05239bccd4d537400000000000000000000000000024dbc80a9f80e3d5fc0a0ee30e2693781a443",
          "topic0": "0x2caecd17d02f56fa897705dcc740da2d237c373f70686f4e0d9bd3bf0400ea7a",
          "topic1": "0x000000000000000000000000031002d15b0d0cd7c9129d6f644446368deae391",
          "topic2": "0x000000000000000000000000d25943be09f968ba740e0782a34e710100defae9",
          "topic3": null,
          "block_timestamp": "2021-05-07T11:08:35.000Z",
          "block_number": "12386788",
          "block_hash": "0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171"
        }
      ],
      "internal_transactions": [
        {
          "transaction_hash": [REDACTED_SECRET],
          "block_number": 12526958,
          "block_hash": "0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86",
          "type": "CALL",
          "from": [REDACTED_SECRET],
          "to": "0xa71db868318f0a0bae9411347cd4a6fa23d8d4ef",
          "value": "650000000000000000",
          "gas": "6721975",
          "gas_used": "6721975",
          "input": "0x",
          "output": "0x",
          "error": "Execution reverted"
        }
      ]
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/block/15863321?chain=eth&include=" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getBondingTokensByExchange__evm.md
content: # Get bonding tokens by exchange

Identify tokens in the bonding phase on a specific exchange. Currently only supports tama.meme on Ronin.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/exchange/:exchangeName/bonding`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| exchangeName | string | Yes | The name of the exchange | \`tama.meme\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | Yes | The chain to query | \`eth\` |
| limit | number | No | The maximum number of items to return | - |
| cursor | string | No | The cursor to use for pagination | - |

## Cursor/Pagination

- **limit**: The maximum number of items to return
- **cursor**: The cursor to use for pagination

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the bonding tokens for the specified exchange.

```json
{
  "total": 10,
  "page": 1,
  "page_size": 100,
  "cursor": "<cursor_from_previous_response>",
  "result": [
    {
      "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "name": "Test Token",
      "symbol": "TEST",
      "logo": "https://example.com/logo.png",
      "decimals": 18,
      "priceNative": "0.5",
      "priceUsd": "2.0",
      "liquidity": "500000",
      "fullyDilutedValuation": "2000000",
      "bondingCurveProgress": 50
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/erc20/exchange/tama.meme/bonding?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getBondingTokensByExchange__solana.md
content: # Get bonding tokens by exchange

Get the list of bonding tokens by given exchange.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/exchange/:exchange/bonding`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| exchange | string | Yes | - | - |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| cursor | string | No | The cursor to the next page | - |
| limit | number | No | The limit per page | - |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "cursor": "cursor_example",
  "pageSize": 0,
  "page": 0,
  "result": [
    {
      "tokenAddress": "tokenAddress_example",
      "name": "name_example",
      "symbol": "symbol_example",
      "logo": "logo_example",
      "decimals": "decimals_example",
      "priceNative": "priceNative_example",
      "priceUsd": "priceUsd_example",
      "liquidity": "liquidity_example",
      "fullyDilutedValuation": "fullyDilutedValuation_example",
      "bondingCurveProgress": 0
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/exchange/:exchange/bonding" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getCandleSticks__solana.md
content: # Get candlesticks for a pair address

Gets the candlesticks for a specific pair address

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/pairs/:address/ohlcv`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`So11111111111111111111111111111111111111112\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| cursor | string | No | The cursor to the next page | - |
| fromDate | string | Yes | The starting date (format in seconds or datestring accepted by momentjs) | - |
| toDate | string | Yes | The ending date (format in seconds or datestring accepted by momentjs) | - |
| timeframe | string | Yes | The interval of the candle stick | - |
| currency | string | Yes | The currency format | - |
| limit | number | No | The limit per page | - |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "cursor": "cursor_example",
  "page": 0,
  "pairAddress": "pairAddress_example",
  "tokenAddress": "tokenAddress_example",
  "timeframe": "timeframe_example",
  "currency": "currency_example",
  "result": [
    {
      "timestamp": "timestamp_example",
      "open": 0,
      "close": 0,
      "high": 0,
      "low": 0,
      "volume": 0,
      "trades": 0
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/pairs/So11111111111111111111111111111111111111112/ohlcv" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getContractNFTs.md
content: # Get NFTs by contract address

Fetch all NFTs for a given collection. Each NFT returned includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x306b1ea3ecdf94aB739F1910bbda052Ed4A9f949\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| format | string | No | The format of the token ID | \`decimal\` |
| limit | number | No | The desired page size of the result. | - |
| totalRanges | number | No | The number of subranges to split the results into | - |
| range | number | No | The desired subrange to query | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| normalizeMetadata | boolean | No | Should normalized metadata be returned? | - |
| media_items | boolean | No | Should preview media data be returned? | - |
| include_prices | boolean | No | Should NFT last sale prices be included in the result? | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns a collection of NFTs

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "token_address": [REDACTED_SECRET],
      "token_id": "15",
      "owner_of": "0x9c83ff0f1c8924da96cb2fcb7e093f78eb2e316b",
      "token_hash": "502cee781b0fb40ea02508b21d319ced",
      "block_number": "88256",
      "block_number_minted": "88256",
      "contract_type": "ERC721",
      "token_uri": "token_uri_example",
      "metadata": "metadata_example",
      "minter_address": "0x9c83ff0f1c8924da96cb2fcb7e093f78eb2e316b",
      "last_token_uri_sync": "last_token_uri_sync_example",
      "last_metadata_sync": "last_metadata_sync_example",
      "amount": "1",
      "name": "CryptoKitties",
      "symbol": "RARI",
      "possible_spam": "false",
      "verified_collection": "false",
      "rarity_rank": 21669,
      "rarity_percentage": 98,
      "rarity_label": "Top 98%",
      "last_sale": {
        "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
        "block_timestamp": "2023-04-04T15:59:11.000Z",
        "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
        "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
        "price": "7300000000000000",
        "price_formatted": "0.0073",
        "usd_price_at_sale": "13.61",
        "current_usd_value": "15.53",
        "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
        "token_id": "170",
        "payment_token": {
          "token_name": "Ether",
          "token_symbol": "ETH",
          "token_logo": "https://cdn.moralis.io/eth/0x.png",
          "token_decimals": "18",
          "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        }
      },
      "list_price": {
        "listed": true,
        "price": "27008",
        "price_currency": "eth",
        "price_usd": "13.61",
        "marketplace": "opensea"
      },
      "floor_price": "12345",
      "floor_price_usd": "12345.4899",
      "floor_price_currency": "eth"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x306b1ea3ecdf94aB739F1910bbda052Ed4A9f949?chain=eth&format=decimal" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getDateToBlock.md
content: # Get block by date

Find the closest block to a specific date on a blockchain.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/dateToBlock`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| date | string | No | Unix date in milliseconds or a datestring (format in seconds or datestring accepted by momentjs) | - |

## Response Example

Status: 200

Returns the block number and corresponding date and timestamp

```json
{
  "date": "2020-01-01T00:00:00+00:00",
  "block": 9193266,
  "timestamp": 1577836811,
  "block_timestamp": "2019-12-31T23:59:45.000Z",
  "hash": "0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171",
  "parent_hash": "0x011d1fc45839de975cc55d758943f9f1d204f80a90eb631f3bf064b80d53e045"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/dateToBlock?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getDefiPositionsByProtocol.md
content: # Get detailed DeFi positions by protocol for a wallet

Fetch detailed DeFi positions for a given wallet and protocol.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/wallets/:address/defi/:protocol/positions`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | Wallet address | \`0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd\` |
| protocol | string (uniswap-v2, uniswap-v3, pancakeswap-v2, pancakeswap-v3, quickswap-v2, quickswap-v3, sushiswap-v2, aave-v2, aave-v3, aave-lido, fraxswap-v1, fraxswap-v2, lido, makerdao, eigenlayer, pendle, etherfi, rocketpool, sparkfi, takara-lend, neverland, kintsu) | Yes | The protocol to query | \`uniswap-v3\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the defi positions by protocol for the wallet address.

```json
{
  "protocol_name": "Uniswap v2",
  "protocol_id": "uniswap-v2",
  "protocol_url": "https://app.uniswap.org/pools/v2",
  "protocol_logo": "https://cdn.moralis.io/defi/uniswap.png",
  "total_usd_value": 47754.14278954011,
  "total_unclaimed_usd_value": null,
  "positions": [
    {
      "label": "liquidity",
      "tokens": [
        {
          "token_type": "defi-token",
          "name": "Wrapped Ether",
          "symbol": "WETH",
          "contract_address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
          "decimals": "18",
          "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
          "thumbnail": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
          "balance": "1000000",
          "balance_formatted": "1.000000",
          "usd_price": "1000000",
          "usd_value": "1000000"
        }
      ],
      "address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
      "balance_usd": "1000000",
      "total_unclaimed_usd_value": "1000000",
      "position_details": {
        "fee_tier": 0,
        "range_tnd": 0,
        "reserves": [],
        "current_price": 0,
        "is_in_range": true,
        "price_upper": 0,
        "price_lower": 0,
        "price_label": "price_label_example",
        "liquidity": 0,
        "range_start": 0,
        "pool_address": "pool_address_example",
        "position_key": "position_key_example",
        "nft_metadata": {},
        "asset_standard": "asset_standard_example",
        "apy": 0,
        "is_debt": true,
        "is_variable_debt": true,
        "is_stable_debt": true,
        "shares": "shares_example",
        "reserve0": "reserve0_example",
        "reserve1": "reserve1_example",
        "factory": "factory_example",
        "pair": "pair_example",
        "share_of_pool": 0,
        "no_price_available": true,
        "shares_in_strategy": "shares_in_strategy_example",
        "strategy_address": "strategy_address_example",
        "base_type": "base_type_example",
        "health_factor": 0,
        "is_enabled_collateral": true
      }
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/uniswap-v3/positions?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getDefiPositionsSummary.md
content: # Get DeFi positions of a wallet

Get a concise overview of a wallet’s DeFi positions across all protocols.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/wallets/:address/defi/positions`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | Wallet address | \`0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns all defi positions for the wallet address.

```json
[
  {
    "protocol_name": "Uniswap v2",
    "protocol_id": "uniswap-v2",
    "protocol_url": "https://app.uniswap.org/pools/v2",
    "protocol_logo": "https://cdn.moralis.io/defi/uniswap.png",
    "position": {
      "label": "liquidity",
      "tokens": [],
      "address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
      "balance_usd": "1000000",
      "total_unclaimed_usd_value": "1000000"
    }
  }
]
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/positions?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getDefiSummary.md
content: # Get the DeFi summary of a wallet

Summarize a wallet’s DeFi activity, including total USD value, unclaimed rewards and active protocols.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/wallets/:address/defi/summary`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | Wallet address | \`0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the defi summary for the wallet address.

```json
{
  "active_protocols": "10",
  "total_positions": "100",
  "total_usd_value": "1000000",
  "total_unclaimed_usd_value": "1000000",
  "protocols": [
    {
      "total_usd_value": "1000000",
      "total_unclaimed_usd_value": "1000000",
      "positions": "100"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/wallets/0xd100d8b69c5ae23d6aa30c6c3874bf47539b95fd/defi/summary?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getDiscoveryToken.md
content: # Get token details

Retrieve comprehensive details for a specific token, including metadata and stats. For more detailed tokens stats we recommended to use `getTokenAnalytics` or `getMultipleTokenAnalytics`. For pair stats, we recommend to use `getPairStats`.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/discovery/token`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | Yes | The chain to query | \`eth\` |
| token_address | string | Yes | The address of the token | \`0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2\` |

## Response Example

Status: 200

Returns the token details

```json
{
  "chain_id": "0x1",
  "token_address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
  "token_name": "Maker",
  "token_symbol": "MKR",
  "token_logo": "token_logo_example",
  "block_number": 0,
  "block_timestamp": "block_timestamp_example",
  "links": {
    "bitbucket": "bitbucket_example",
    "discord": "discord_example",
    "facebook": "facebook_example",
    "github": "github_example",
    "instagram": "instagram_example",
    "linkedin": "linkedin_example",
    "medium": "medium_example",
    "reddit": "reddit_example",
    "telegram": "telegram_example",
    "tiktok": "tiktok_example",
    "twitter": "twitter_example",
    "website": "website_example",
    "youtube": "youtube_example"
  },
  "rating": 0,
  "total_number_of_rating": 0,
  "total_liquidity_locked_in_percent": 0,
  "total_supply_locked_in_percent": 0,
  "price_usd": 0,
  "token_age_in_days": 0,
  "on_chain_strength_index": 0,
  "security_score": 88,
  "market_cap": 1351767630.85,
  "fully_diluted_valuation": 1363915420.28,
  "twitter_followers": 255217,
  "holders_change": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "liquidity_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "experienced_net_buyers_change": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "volume_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "net_volume_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "price_percent_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  }
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/discovery/token?chain=eth&token_address=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getDiscoveryToken__solana.md
content: # Get token details

**Solana variant:** Retrieve comprehensive details for a specific token, including metadata and stats. For more detailed tokens stats we recommended to use `getTokenAnalytics` or `getMultipleTokenAnalytics`. For pair stats, we recommend to use `getPairStats`.

This EVM endpoint supports Solana via the `chain=solana` parameter.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/discovery/token`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | Yes | The chain to query | \`solana\` |
| token_address | string | Yes | The address of the token | \`0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2\` |

## Response Example

Status: 200

Returns the token details

```json
{
  "chain_id": "0x1",
  "token_address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
  "token_name": "Maker",
  "token_symbol": "MKR",
  "token_logo": "token_logo_example",
  "block_number": 0,
  "block_timestamp": "block_timestamp_example",
  "links": {
    "bitbucket": "bitbucket_example",
    "discord": "discord_example",
    "facebook": "facebook_example",
    "github": "github_example",
    "instagram": "instagram_example",
    "linkedin": "linkedin_example",
    "medium": "medium_example",
    "reddit": "reddit_example",
    "telegram": "telegram_example",
    "tiktok": "tiktok_example",
    "twitter": "twitter_example",
    "website": "website_example",
    "youtube": "youtube_example"
  },
  "rating": 0,
  "total_number_of_rating": 0,
  "total_liquidity_locked_in_percent": 0,
  "total_supply_locked_in_percent": 0,
  "price_usd": 0,
  "token_age_in_days": 0,
  "on_chain_strength_index": 0,
  "security_score": 88,
  "market_cap": 1351767630.85,
  "fully_diluted_valuation": 1363915420.28,
  "twitter_followers": 255217,
  "holders_change": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "liquidity_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "experienced_net_buyers_change": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "volume_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "net_volume_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  },
  "price_percent_change_usd": {
    "1h": 14,
    "1d": 14,
    "1w": 162,
    "1M": 162
  }
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/discovery/token?chain=solana&token_address=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getEntitiesByCategory.md
content: # Get Entities By Category

Fetch entities belonging to a specific category. Each entity returns name, logo, description, external links, total addresses and more.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/entities/categories/:categoryId`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| categoryId | string | Yes | The category Id | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| limit | number | No | The desired page size of the result. | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.

## Response Example

Status: 200

Returns the entities belonging to the category.

```json
{
  "page": "1",
  "page_size": "100",
  "result": [
    {
      "total_addresses": 100
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/entities/categories/1" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getEntity.md
content: # Get Entity Details By Id

Retrieve details for a specific entity using its unique ID. Returns name, logo, description, external links and related addresses.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/entities/:entityId`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| entityId | string | Yes | - | \`1\` |

## Response Example

Status: 200

Returns the entity.

```json
{
  "addresses": [
    {
      "additional_labels": [
        [
          "Uniswap",
          "Uniswap V3"
        ]
      ]
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/entities/1" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getEntityCategories.md
content: # Get Entity Categories

List available categories for blockchain entities.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/entities/categories`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| limit | number | No | The desired page size of the result. | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.

## Response Example

Status: 200

Returns the entity categories.

```json
{
  "page": "1",
  "page_size": "100",
  "result": [
    {
      "total_entities": 100
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/entities/categories" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getFilteredTokens.md
content: # Returns a list of tokens that match the specified filters and criteria

Fetch a list of tokens across multiple chains, filtered and ranked by dynamic on-chain metrics like volume, price change, liquidity, holder composition, and more. Supports advanced filters (e.g. “top 10 whales hold <40%”), category-based inclusion/exclusion (e.g. “exclude stablecoins”), and time-based analytics. Ideal for token discovery, investor research, risk analysis, and portfolio tools. Each token returned includes detailed trading metrics as well as on-chain and off-chain metadata.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/discovery/tokens`

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string | Yes | Chain hex ID (e.g. "0x1" for Ethereum). Required unless 'chains' is provided. See references/FilteredTokens.md for metrics and filter details. | \`0x1\` |
| filters | array | Yes | Array of filter objects. Each has metric, timeFrame, and at least one of gt/lt/eq. Filters are combined with AND logic. See references/FilteredTokens.md for all metrics and timeframes. | \`[object Object]\` |
| sortBy | object | Yes | Sort configuration with metric, timeFrame, and type (ASC or DESC). See references/FilteredTokens.md for all metrics and timeframes. | \`[object Object]\` |
| limit | number | Yes | Maximum number of tokens to return | \`20\` |
| chains | array | No | Array of chain hex IDs for multi-chain queries. Use instead of 'chain' to query multiple chains. | \`0x1,0x89\` |
| categories | object | No | Category-based filtering. Object with 'include' and/or 'exclude' arrays (e.g. ["stablecoin", "meme"]). | \`[object Object]\` |
| timeFramesToReturn | array | No | Which timeframes to include in response metrics. Defaults to all if omitted. See references/FilteredTokens.md for values. | \`oneDay,oneWeek\` |
| metricsToReturn | array | No | Which metrics to include in response. Defaults to all if omitted. See references/FilteredTokens.md for values. | \`volumeUsd,usdPricePercentChange\` |
| excludeMetadata | boolean | No | If true, omits token metadata from response to reduce payload size | \`-\` |

## Response Example

Status: 200

Returns the token details

```json
{
  "metadata": {},
  "metrics": {}
}
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/discovery/tokens" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "chain": "0x1",
  "filters": [
    {
      "metric": "volumeUsd",
      "timeFrame": "oneDay",
      "gt": 100000
    }
  ],
  "sortBy": {
    "metric": "volumeUsd",
    "timeFrame": "oneDay",
    "type": "DESC"
  },
  "limit": 20,
  "chains": [
    "0x1",
    "0x89"
  ],
  "categories": {
    "exclude": [
      "stablecoin"
    ]
  },
  "timeFramesToReturn": [
    "oneDay",
    "oneWeek"
  ],
  "metricsToReturn": [
    "volumeUsd",
    "usdPricePercentChange"
  ],
  "excludeMetadata": false
}'
```


path: rules/getGraduatedTokensByExchange__evm.md
content: # Get graduated tokens by exchange

List tokens that have completed bonding on a specific exchange. Currently only supports tama.meme on Ronin.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/exchange/:exchangeName/graduated`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| exchangeName | string | Yes | The name of the exchange | \`tama.meme\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | Yes | The chain to query | \`eth\` |
| limit | number | No | The maximum number of items to return | - |
| cursor | string | No | The cursor to use for pagination | - |

## Cursor/Pagination

- **limit**: The maximum number of items to return
- **cursor**: The cursor to use for pagination

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the graduated tokens for the specified exchange.

```json
{
  "total": 10,
  "page": 1,
  "page_size": 100,
  "cursor": "<cursor_from_previous_response>",
  "result": [
    {
      "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "name": "Test Token",
      "symbol": "TEST",
      "logo": "https://example.com/logo.png",
      "decimals": 18,
      "priceNative": "0.5",
      "priceUsd": "2.0",
      "liquidity": "500000",
      "fullyDilutedValuation": "2000000",
      "graduatedAt": "2023-01-15T12:30:45.000Z"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/erc20/exchange/tama.meme/graduated?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getGraduatedTokensByExchange__solana.md
content: # Get graduated tokens by exchange

Get the list of graduated tokens by given exchange.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/exchange/:exchange/graduated`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| exchange | string | Yes | - | - |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| cursor | string | No | The cursor to the next page | - |
| limit | number | No | The limit per page | - |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "cursor": "cursor_example",
  "pageSize": 0,
  "page": 0,
  "result": [
    {
      "tokenAddress": "tokenAddress_example",
      "name": "name_example",
      "symbol": "symbol_example",
      "logo": "logo_example",
      "decimals": "decimals_example",
      "priceNative": "priceNative_example",
      "priceUsd": "priceUsd_example",
      "liquidity": "liquidity_example",
      "fullyDilutedValuation": "fullyDilutedValuation_example",
      "graduatedAt": "2024-11-28T09:44:55.000Z"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/exchange/:exchange/graduated" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getHistoricalTokenHolders__evm.md
content: # Get timeseries holders data

Track changes in the holder base of an ERC20 token over time. Supports timeseries data for total holders as well as change metrics such as holder distribution and holder acquisition.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/:tokenAddress/holders/historical`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokenAddress | string | Yes | The token address | \`0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| fromDate | string | Yes | The starting date (format in seconds or datestring accepted by momentjs)
 | \`2025-01-01T10:00:00\` |
| toDate | string | Yes | The ending date (format in seconds or datestring accepted by momentjs)
 | \`2025-02-01T11:00:00\` |
| limit | number | No | The number of results to return | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page) | - |
| timeFrame | string | Yes | The time frame to group the data by | \`1d\` |

## Cursor/Pagination

- **limit**: The number of results to return
- **cursor**: The cursor returned in the previous response (used for getting the next page)

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns token

```json
{
  "page": "1",
  "pageSize": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "timestamp": "2021-05-07T11:08:35.000Z",
      "totalHolders": "100",
      "netHolderChange": 0,
      "holderPercentChange": 0,
      "newHoldersByAcquisition": {
        "swap": "10",
        "transfer": "10",
        "airdrop": "10"
      },
      "holdersIn": {
        "whales": "100",
        "sharks": "100",
        "dolphins": "100",
        "fish": "100",
        "octopus": "100",
        "crabs": "100",
        "shrimps": "100"
      },
      "holdersOut": {
        "whales": "100",
        "sharks": "100",
        "dolphins": "100",
        "fish": "100",
        "octopus": "100",
        "crabs": "100",
        "shrimps": "100"
      }
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/erc20/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0/holders/historical?chain=eth&fromDate=2025-01-01T10%3A00%3A00&toDate=2025-02-01T11%3A00%3A00&timeFrame=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getHistoricalTokenHolders__solana.md
content: # Get token holders overtime for a given tokens

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/holders/:address/historical`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| cursor | string | No | The cursor to the next page | - |
| timeFrame | string | Yes | The interval of the holders data | - |
| fromDate | string | Yes | The starting date (format in seconds or datestring accepted by momentjs) | - |
| toDate | string | Yes | The ending date (format in seconds or datestring accepted by momentjs) | - |
| limit | number | No | The limit per page depending on the plan | - |

## Cursor/Pagination

- **limit**: The limit per page depending on the plan
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "cursor": "cursor_example",
  "result": [
    {
      "timestamp": "2025-02-25T00:00:00Z",
      "totalHolders": 2000,
      "netHolderChange": 50,
      "holderPercentChange": 2.5,
      "newHoldersByAcquisition": {
        "swap": 150,
        "transfer": 50,
        "airdrop": 20
      },
      "holdersIn": {
        "whales": 5,
        "sharks": 12,
        "dolphins": 20,
        "fish": 100,
        "octopus": 50,
        "crabs": 200,
        "shrimps": 1000
      },
      "holdersOut": {
        "whales": 5,
        "sharks": 12,
        "dolphins": 20,
        "fish": 100,
        "octopus": 50,
        "crabs": 200,
        "shrimps": 1000
      }
    }
  ],
  "page": 0
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/holders/6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN/historical" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getHistoricalTokenScore.md
content: # Get historical token score by token address

Retrieve historical score data for a specific token over time.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/tokens/:tokenAddress/score/historical`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokenAddress | string | Yes | The token address to query | \`0x6982508145454ce325ddbe47a25d4ec3d2311933\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | No | The chain to query | \`eth\` |
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Response Example

Status: 200

Successful response

```json
{
  "chainId": "0x1",
  "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "timeseries": [
    {
      "timestamp": "2022-02-22T00:00:00Z",
      "score": 85
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933/score/historical?chain=eth&timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getHistoricalTokenScore__solana.md
content: # Get historical token score by token address

**Solana variant:** Retrieve historical score data for a specific token over time.

This EVM endpoint supports Solana via the `chain=solana` parameter.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/tokens/:tokenAddress/score/historical`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokenAddress | string | Yes | The token address to query | \`0x6982508145454ce325ddbe47a25d4ec3d2311933\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | No | The chain to query | \`solana\` |
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Response Example

Status: 200

Successful response

```json
{
  "chainId": "0x1",
  "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "timeseries": [
    {
      "timestamp": "2022-02-22T00:00:00Z",
      "score": 85
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/tokens/0x6982508145454ce325ddbe47a25d4ec3d2311933/score/historical?chain=solana&timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getLatestBlockNumber.md
content: # Get latest block number

Get the most recent block number for a specified blockchain.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/latestBlockNumber/:chain`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | Yes | The chain to query | \`eth\` |

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/latestBlockNumber/eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getMultipleNFTs.md
content: # Get Metadata for NFTs

Get NFT metadata for one or many NFTs. Accepts an array of up to 25 `tokens`, each requiring `token_address` and `token_id`. Each NFT returned includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/getMultipleNFTs`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokens | array | No | The tokens to be fetched (max 25 tokens) | \`[object Object],[object Object],[object Object]\` |
| normalizeMetadata | boolean | No | Should normalized metadata be returned? | \`-\` |
| media_items | boolean | No | Should preview media data be returned? | \`-\` |

## Response Example

Status: 200

Returns a collection of NFT owners

```json
[
  {
    "token_address": [REDACTED_SECRET],
    "token_id": "15",
    "contract_type": "ERC721",
    "owner_of": [REDACTED_SECRET],
    "block_number": "88256",
    "block_number_minted": "88256",
    "token_uri": "token_uri_example",
    "metadata": "metadata_example",
    "amount": "1",
    "name": "CryptoKitties",
    "symbol": "RARI",
    "token_hash": "502cee781b0fb40ea02508b21d319ced",
    "rarity_rank": 21669,
    "rarity_percentage": 98,
    "rarity_label": "Top 98%",
    "last_token_uri_sync": "2021-02-24T00:47:26.647Z",
    "last_metadata_sync": "2021-02-24T00:47:26.647Z",
    "possible_spam": "false",
    "verified_collection": "false",
    "floor_price": "12345",
    "floor_price_usd": "12345.4899",
    "floor_price_currency": "eth",
    "last_sale": {
      "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
      "block_timestamp": "2023-04-04T15:59:11.000Z",
      "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
      "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
      "price": "7300000000000000",
      "price_formatted": "0.0073",
      "usd_price_at_sale": "13.61",
      "current_usd_value": "15.53",
      "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
      "token_id": "170",
      "payment_token": {
        "token_name": "Ether",
        "token_symbol": "ETH",
        "token_logo": "https://cdn.moralis.io/eth/0x.png",
        "token_decimals": "18",
        "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
      }
    }
  }
]
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/nft/getMultipleNFTs?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "tokens": [
    {
      "token_address": "0xa4991609c508b6d4fb7156426db0bd49fe298bd8",
      "token_id": "12"
    },
    {
      "token_address": "0x3c64dc415ebb4690d1df2b6216148c8de6dd29f7",
      "token_id": "1"
    },
    {
      "token_address": "0x3c64dc415ebb4690d1df2b6216148c8de6dd29f7",
      "token_id": "200"
    }
  ],
  "normalizeMetadata": false,
  "media_items": false
}'
```


path: rules/getMultipleTokenAnalytics.md
content: # Get token analytics for a list of token addresses

Fetch analytics for multiple tokens, including buy volume, sell volume, buyers, sellers, transactions, liquidity and FDV trends over time. Accepts an array of up to 200 `tokens`, each requiring `chain` and `tokenAddress`.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/tokens/analytics`

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokens | array | No | The tokens to be fetched | \`[object Object],[object Object]\` |

## Response Example

Status: 200

Successful response

```json
{
  "categories": [
    {
      "categoryId": "0x1",
      "totalBuyVolume": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "totalSellVolume": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "totalBuyers": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "totalSellers": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "totalBuys": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "totalSells": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "uniqueWallets": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "pricePercentChange": {
        "5m": 6516719.425429553,
        "1h": 137489621.30780438,
        "6h": 585436101.0503464,
        "24h": 2668170156.0409784
      },
      "usdPrice": "530",
      "totalLiquidity": "530",
      "totalFullyDilutedValuation": "530"
    }
  ]
}
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/tokens/analytics" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "tokens": [
    {
      "chain": "0x1",
      "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7"
    },
    {
      "chain": "solana",
      "tokenAddress": [REDACTED_SECRET]
    }
  ]
}'
```


path: rules/getMultipleTokenMetadata__solana.md
content: # Get multiple token metadata

Get multiple global token metadata for a given network and contract (mint, standard, name, symbol, metaplex).

## Method

POST

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/metadata`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| addresses | array | No | - | \`So11111111111111111111111111111111111111112\` |

## Response Example

Status: default

```json
[
  {
    "mint": "mint_example",
    "standard": "standard_example",
    "name": "name_example",
    "symbol": "symbol_example",
    "logo": "logo_example",
    "decimals": "decimals_example",
    "tokenStandard": 0,
    "score": 0,
    "totalSupply": "totalSupply_example",
    "totalSupplyFormatted": "totalSupplyFormatted_example",
    "fullyDilutedValue": "fullyDilutedValue_example",
    "marketCap": "marketCap_example",
    "circulatingSupply": "circulatingSupply_example",
    "metaplex": {
      "metadataUri": "metadataUri_example",
      "masterEdition": true,
      "isMutable": true,
      "primarySaleHappened": 0,
      "sellerFeeBasisPoints": 0,
      "updateAuthority": "updateAuthority_example"
    },
    "links": {},
    "description": "description_example",
    "isVerifiedContract": true,
    "possibleSpam": true
  }
]
```

## Example (curl)

```bash
curl -X POST "https://solana-gateway.moralis.io/token/mainnet/metadata" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "addresses": [
    [REDACTED_SECRET]
  ]
}'
```


path: rules/getMultipleTokenPrices__evm.md
content: # Get Multiple ERC20 token prices

Retrieve the current or historical prices for multiple ERC20 tokens in the blockchain’s native currency and USD. Accepts an array of up to 100 `tokens`, each requiring `token_address` and optional fields such as `to_block` or `exchange`. Each token returned includes on-chain metadata, as well as off-chain metadata, logos, spam status and more. Additional options to exclude low-liquidity tokens and inactive tokens.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/prices`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| include | string | No | This parameter is now deprecated as percentage change are included by default | \`-\` |
| max_token_inactivity | number | No | Exclude tokens inactive for more than the given amount of days | - |
| min_pair_side_liquidity_usd | number | No | Exclude tokens with liquidity less than the specified amount in USD. This parameter refers to the liquidity on a single side of the pair. | - |

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokens | array | No | The tokens to be fetched | \`[object Object],[object Object],[object Object],[object Object]\` |

## Response Example

Status: 200

Returns an array of token prices denominated in the blockchain's native token and USD for a given token contract address

```json
[
  {
    "tokenName": "Kylin Network",
    "tokenSymbol": "KYL",
    "tokenLogo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
    "tokenDecimals": "18",
    "usdPrice": 19.722370676,
    "usdPriceFormatted": "19.722370676",
    "24hrPercentChange": "-0.8842730258590583",
    "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
    "exchangeName": "Uniswap v3",
    "tokenAddress": "0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c",
    "toBlock": "16314545",
    "possibleSpam": "false",
    "verifiedContract": true,
    "pairAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
    "pairTotalLiquidityUsd": "123.45",
    "usdPrice24h": 1,
    "usdPrice24hrUsdChange": -0.00008615972490000345,
    "usdPrice24hrPercentChange": -0.008615972490000345,
    "securityScore": 1
  }
]
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/erc20/prices?chain=eth&include=" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "tokens": [
    {
      "token_address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
    },
    {
      "token_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
    },
    {
      "token_address": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
      "exchange": "uniswapv2",
      "to_block": "16314545"
    },
    {
      "token_address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"
    }
  ]
}'
```


path: rules/getMultipleTokenPrices__solana.md
content: # Get token price

Gets the token price (usd and native) for a given contract address and network.

## Method

POST

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/prices`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| addresses | array | No | - | \`\` |

## Response Example

Status: default

```json
[
  {
    "tokenAddress": "tokenAddress_example",
    "pairAddress": "pairAddress_example",
    "nativePrice": {
      "value": "value_example",
      "decimals": 0,
      "name": "name_example",
      "symbol": "symbol_example"
    },
    "usdPrice": 0,
    "exchangeAddress": "exchangeAddress_example",
    "exchangeName": "exchangeName_example",
    "logo": "logo_example",
    "name": "name_example",
    "symbol": "symbol_example",
    "score": 0,
    "usdPrice24h": 0,
    "usdPrice24hrUsdChange": 0,
    "usdPrice24hrPercentChange": 0,
    "isVerifiedContract": true
  }
]
```

## Example (curl)

```bash
curl -X POST "https://solana-gateway.moralis.io/token/mainnet/prices" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "addresses": []
}'
```


path: rules/getNFTBulkContractMetadata.md
content: # Get metadata for multiple NFT contracts

Retrieve metadata (name, symbol) for up to 25 NFT contracts in one call. Also returns off-chain metadata, floor prices and more where available.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/metadata`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| include_prices | boolean | No | Should NFT last sale prices be included in the result? | - |

## Body


## Response Example

Status: 200

Returns the metadata for the requested NFT collections.

```json
[
  {
    "token_address": "0x2d30ca6f024dbc1307ac8a1a44ca27de6f797ec22ef20627a1307243b0ab7d09",
    "name": "KryptoKitties",
    "synced_at": "synced_at_example",
    "symbol": "RARI",
    "contract_type": "ERC721",
    "possible_spam": "false",
    "verified_collection": "false",
    "collection_logo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
    "collection_banner_image": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
    "collection_category": "Art",
    "project_url": "https://www.cryptokitties.co/",
    "wiki_url": "https://en.wikipedia.org/wiki/CryptoKitties",
    "discord_url": "https://discord.com/invite/cryptokitties",
    "telegram_url": "https://t.me/cryptokitties",
    "twitter_username": "CryptoKitties",
    "instagram_username": "cryptokitties",
    "floor_price": "12345",
    "floor_price_usd": "12345.4899",
    "floor_price_currency": "eth",
    "last_sale": {
      "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
      "block_timestamp": "2023-04-04T15:59:11.000Z",
      "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
      "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
      "price": "7300000000000000",
      "price_formatted": "0.0073",
      "usd_price_at_sale": "13.61",
      "current_usd_value": "15.53",
      "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
      "token_id": "170",
      "payment_token": {
        "token_name": "Ether",
        "token_symbol": "ETH",
        "token_logo": "https://cdn.moralis.io/eth/0x.png",
        "token_decimals": "18",
        "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
      }
    }
  }
]
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/nft/metadata?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{}'
```


path: rules/getNFTByContractTraits.md
content: # Get NFTs by traits

Find NFTs in a contract matching specific traits, perfect for attribute-based searches.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/nfts-by-traits`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| limit | number | No | The desired page size of the result. | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| format | string | No | The format of the token ID | \`decimal\` |
| normalizeMetadata | boolean | No | Should normalized metadata be returned? | - |
| media_items | boolean | No | Should preview media data be returned? | - |

## Body


## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns a collection of NFTs

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "token_address": [REDACTED_SECRET],
      "token_id": "15",
      "owner_of": "0x9c83ff0f1c8924da96cb2fcb7e093f78eb2e316b",
      "token_hash": "502cee781b0fb40ea02508b21d319ced",
      "block_number": "88256",
      "block_number_minted": "88256",
      "contract_type": "ERC721",
      "token_uri": "token_uri_example",
      "metadata": "metadata_example",
      "minter_address": "0x9c83ff0f1c8924da96cb2fcb7e093f78eb2e316b",
      "last_token_uri_sync": "last_token_uri_sync_example",
      "last_metadata_sync": "last_metadata_sync_example",
      "amount": "1",
      "name": "CryptoKitties",
      "symbol": "RARI",
      "possible_spam": "false",
      "verified_collection": "false",
      "rarity_rank": 21669,
      "rarity_percentage": 98,
      "rarity_label": "Top 98%",
      "last_sale": {
        "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
        "block_timestamp": "2023-04-04T15:59:11.000Z",
        "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
        "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
        "price": "7300000000000000",
        "price_formatted": "0.0073",
        "usd_price_at_sale": "13.61",
        "current_usd_value": "15.53",
        "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
        "token_id": "170",
        "payment_token": {
          "token_name": "Ether",
          "token_symbol": "ETH",
          "token_logo": "https://cdn.moralis.io/eth/0x.png",
          "token_decimals": "18",
          "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        }
      },
      "list_price": {
        "listed": true,
        "price": "27008",
        "price_currency": "eth",
        "price_usd": "13.61",
        "marketplace": "opensea"
      },
      "floor_price": "12345",
      "floor_price_usd": "12345.4899",
      "floor_price_currency": "eth"
    }
  ]
}
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/nfts-by-traits?chain=eth&format=decimal" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{}'
```


path: rules/getNFTCollectionStats.md
content: # Get summary stats by NFT collection

Get summary stats by NFT collection including total NFT transfers, total tokens and total owners.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/stats`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT collection | \`0x306b1ea3ecdf94aB739F1910bbda052Ed4A9f949\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the stats for the nft collection address.

```json
{
  "total_tokens": "100",
  "owners": {
    "current": "1000"
  },
  "transfers": {
    "total": "1000"
  }
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x306b1ea3ecdf94aB739F1910bbda052Ed4A9f949/stats?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTContractMetadata.md
content: # Get NFT collection metadata

Fetch on-chain metadata like name, symbol, and base token URI for an NFT contract. Also returns off-chain metadata, floor prices and more where available.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/metadata`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| include_prices | boolean | No | Should NFT last sale prices be included in the result? | - |

## Response Example

Status: 200

Returns the metadata for an NFT collection.

```json
{
  "token_address": "0x2d30ca6f024dbc1307ac8a1a44ca27de6f797ec22ef20627a1307243b0ab7d09",
  "name": "KryptoKitties",
  "synced_at": "synced_at_example",
  "symbol": "RARI",
  "contract_type": "ERC721",
  "possible_spam": "false",
  "verified_collection": "false",
  "collection_logo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
  "collection_banner_image": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
  "collection_category": "Art",
  "project_url": "https://www.cryptokitties.co/",
  "wiki_url": "https://en.wikipedia.org/wiki/CryptoKitties",
  "discord_url": "https://discord.com/invite/cryptokitties",
  "telegram_url": "https://t.me/cryptokitties",
  "twitter_username": "CryptoKitties",
  "instagram_username": "cryptokitties",
  "floor_price": "12345",
  "floor_price_usd": "12345.4899",
  "floor_price_currency": "eth",
  "last_sale": {
    "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
    "block_timestamp": "2023-04-04T15:59:11.000Z",
    "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
    "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
    "price": "7300000000000000",
    "price_formatted": "0.0073",
    "usd_price_at_sale": "13.61",
    "current_usd_value": "15.53",
    "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
    "token_id": "170",
    "payment_token": {
      "token_name": "Ether",
      "token_symbol": "ETH",
      "token_logo": "https://cdn.moralis.io/eth/0x.png",
      "token_decimals": "18",
      "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
    }
  }
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/metadata?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTContractSalePrices.md
content: # Get NFT sale prices by collection

Fetch sale prices for NFTs in a contract over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/price`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT collection | \`0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| days | number | No | The number of days to look back to find the lowest price
If not provided 7 days will be the default and 365 is the maximum
 | - |

## Response Example

Status: 200

Returns the sold price details

```json
{
  "last_sale": {
    "transaction_hash": "transaction_hash_example",
    "block_timestamp": "block_timestamp_example",
    "buyer_address": "buyer_address_example",
    "seller_address": "seller_address_example",
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "usd_price_at_sale": "usd_price_at_sale_example",
    "current_usd_value": "current_usd_value_example",
    "token_id": "token_id_example",
    "payment_token": {
      "token_name": "token_name_example",
      "token_symbol": "token_symbol_example",
      "token_logo": "token_logo_example",
      "token_decimals": "token_decimals_example",
      "token_address": "token_address_example"
    }
  },
  "lowest_sale": {
    "transaction_hash": "transaction_hash_example",
    "block_timestamp": "block_timestamp_example",
    "buyer_address": "buyer_address_example",
    "seller_address": "seller_address_example",
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "usd_price_at_sale": "usd_price_at_sale_example",
    "current_usd_value": "current_usd_value_example",
    "token_id": "token_id_example",
    "payment_token": {
      "token_name": "token_name_example",
      "token_symbol": "token_symbol_example",
      "token_logo": "token_logo_example",
      "token_decimals": "token_decimals_example",
      "token_address": "token_address_example"
    }
  },
  "highest_sale": {
    "transaction_hash": "transaction_hash_example",
    "block_timestamp": "block_timestamp_example",
    "buyer_address": "buyer_address_example",
    "seller_address": "seller_address_example",
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "usd_price_at_sale": "usd_price_at_sale_example",
    "current_usd_value": "current_usd_value_example",
    "token_id": "token_id_example",
    "payment_token": {
      "token_name": "token_name_example",
      "token_symbol": "token_symbol_example",
      "token_logo": "token_logo_example",
      "token_decimals": "token_decimals_example",
      "token_address": "token_address_example"
    }
  },
  "average_sale": {
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "current_usd_value": "current_usd_value_example"
  },
  "total_trades": 0,
  "message": "message_example"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/price?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTContractTransfers.md
content: # Get NFT transfers by contract address

Get NFT transfers for a contract, with options to filter by date, token, or other parameters.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/transfers`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x306b1ea3ecdf94ab739f1910bbda052ed4a9f949\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| from_block | number | No | The minimum block number from where to get the transfers
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_block | number | No | The maximum block number from where to get the transfers.
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| from_date | string | No | The date from where to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_date | string | No | Get transfers up until this date (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| format | string | No | The format of the token ID | \`decimal\` |
| include_prices | boolean | No | Should NFT last sale prices be included in the result? | - |
| limit | number | No | The desired page size of the result. | - |
| order | string (ASC, DESC) | No | The order of the result, in ascending (ASC) or descending (DESC) | \`DESC\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns a collection of NFT transfers

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "token_address": [REDACTED_SECRET],
      "token_id": "15",
      "token_name": "Tether USD",
      "token_symbol": "USDT",
      "from_address_entity": "Opensea",
      "from_address_entity_logo": "https://opensea.io/favicon.ico",
      "from_address": [REDACTED_SECRET],
      "from_address_label": "Binance 1",
      "to_address_entity": "Beaver Build",
      "to_address_entity_logo": "https://beaverbuild.com/favicon.ico",
      "to_address": [REDACTED_SECRET],
      "to_address_label": "Binance 2",
      "value": "1000000000000000",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "88256",
      "block_timestamp": "2021-06-04T16:00:15",
      "block_hash": "block_hash_example",
      "transaction_hash": [REDACTED_SECRET],
      "transaction_type": "transaction_type_example",
      "transaction_index": 0,
      "log_index": 0,
      "operator": [REDACTED_SECRET],
      "possible_spam": "false",
      "verified_collection": "false",
      "last_sale": {
        "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
        "block_timestamp": "2023-04-04T15:59:11.000Z",
        "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
        "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
        "price": "7300000000000000",
        "price_formatted": "0.0073",
        "usd_price_at_sale": "13.61",
        "current_usd_value": "15.53",
        "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
        "token_id": "170",
        "payment_token": {
          "token_name": "Ether",
          "token_symbol": "ETH",
          "token_logo": "https://cdn.moralis.io/eth/0x.png",
          "token_decimals": "18",
          "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        }
      }
    }
  ],
  "block_exists": true,
  "index_complete": true
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x306b1ea3ecdf94ab739f1910bbda052ed4a9f949/transfers?chain=eth&format=decimal&order=DESC" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTFloorPriceByContract.md
content: # Get NFT floor price by contract

Get floor price for a given collection. Refreshes every 30 minutes.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/floor-price`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the conract's floor price

```json
{
  "address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
  "floor_price": "0.2176",
  "floor_price_usd": "564.24",
  "currency": "eth",
  "last_updated": "2024-08-21T15:59:11.000Z"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/floor-price?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTFloorPriceByToken.md
content: # Get NFT floor price by token

Get the floor price for a specific NFT, defined by its contract and token ID. Refreshes every 30 minutes.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/:token_id/floor-price`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d\` |
| token_id | string | Yes | The token ID of the NFT | \`2441\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the token's floor price

```json
{
  "address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
  "token_id": "2441",
  "floor_price": "0.2176",
  "floor_price_usd": "564.24",
  "currency": "eth",
  "last_updated": "2024-08-21T15:59:11.000Z"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/2441/floor-price?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTHistoricalFloorPriceByContract.md
content: # Get historical NFT floor price by contract

Get timeseries historical floor prices for a given NFT collection. Refreshes every 30 minutes.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/floor-price/historical`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| interval | string (1d, 7d, 30d, 60d, 90d, 1y, all) | Yes | The duration to query | \`1d\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |

## Cursor/Pagination

- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the conract's historical floor price

```json
{
  "page": "1",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "floor_price": "0.2176",
      "floor_price_usd": "564.24",
      "currency": "eth",
      "marketplace": "blur",
      "timestamp": "2024-08-21T15:59:11.000Z"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/floor-price/historical?chain=eth&interval=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTMetadata__evm.md
content: # Get NFT metadata

Fetch metadata for a specific NFT. Includes on-chain metadata as well as off-chain metadata, floor prices, rarity and more where available.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/:token_id`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |
| token_id | string | Yes | The ID of the token | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| format | string | No | The format of the token ID | \`decimal\` |
| normalizeMetadata | boolean | No | Should normalized metadata be returned? | - |
| media_items | boolean | No | Should preview media data be returned? | - |
| include_prices | boolean | No | Should NFT last sale prices be included in the result? | - |

## Response Example

Status: 200

Returns the specified NFT.

```json
{
  "token_address": [REDACTED_SECRET],
  "token_id": "15",
  "owner_of": "0x9c83ff0f1c8924da96cb2fcb7e093f78eb2e316b",
  "token_hash": "502cee781b0fb40ea02508b21d319ced",
  "block_number": "88256",
  "block_number_minted": "88256",
  "contract_type": "ERC721",
  "token_uri": "token_uri_example",
  "metadata": "metadata_example",
  "minter_address": "0x9c83ff0f1c8924da96cb2fcb7e093f78eb2e316b",
  "last_token_uri_sync": "last_token_uri_sync_example",
  "last_metadata_sync": "last_metadata_sync_example",
  "amount": "1",
  "name": "CryptoKitties",
  "symbol": "RARI",
  "possible_spam": "false",
  "verified_collection": "false",
  "rarity_rank": 21669,
  "rarity_percentage": 98,
  "rarity_label": "Top 98%",
  "last_sale": {
    "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
    "block_timestamp": "2023-04-04T15:59:11.000Z",
    "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
    "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
    "price": "7300000000000000",
    "price_formatted": "0.0073",
    "usd_price_at_sale": "13.61",
    "current_usd_value": "15.53",
    "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
    "token_id": "170",
    "payment_token": {
      "token_name": "Ether",
      "token_symbol": "ETH",
      "token_logo": "https://cdn.moralis.io/eth/0x.png",
      "token_decimals": "18",
      "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
    }
  },
  "list_price": {
    "listed": true,
    "price": "27008",
    "price_currency": "eth",
    "price_usd": "13.61",
    "marketplace": "opensea"
  },
  "floor_price": "12345",
  "floor_price_usd": "12345.4899",
  "floor_price_currency": "eth"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/1?chain=eth&format=decimal" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTMetadata__solana.md
content: # Get the global metadata for a given contract

Gets the contract level metadata (mint, standard, name, symbol, metaplex) for the given contract

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/nft/:network/:address/metadata`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`So11111111111111111111111111111111111111112\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| mediaItems | boolean | No | Should return media items | - |

## Response Example

Status: 200

```json
{
  "mint": "mint_example",
  "address": "address_example",
  "standard": "standard_example",
  "name": "name_example",
  "symbol": "symbol_example",
  "tokenStandard": 0,
  "description": "description_example",
  "imageOriginalUrl": "imageOriginalUrl_example",
  "externalUrl": "externalUrl_example",
  "metadataOriginalUrl": "metadataOriginalUrl_example",
  "totalSupply": "totalSupply_example",
  "metaplex": {
    "metadataUri": "metadataUri_example",
    "masterEdition": true,
    "isMutable": true,
    "primarySaleHappened": 0,
    "sellerFeeBasisPoints": 0,
    "updateAuthority": "updateAuthority_example"
  },
  "attributes": [
    {
      "traitType": "traitType_example",
      "value": {}
    }
  ],
  "contract": {
    "type": "type_example",
    "name": "name_example",
    "symbol": "symbol_example"
  },
  "collection": {
    "collectionAddress": "collectionAddress_example",
    "name": "name_example",
    "description": "description_example",
    "imageOriginalUrl": "imageOriginalUrl_example",
    "externalUrl": "externalUrl_example",
    "metaplexMint": "metaplexMint_example",
    "sellerFeeBasisPoints": 0
  },
  "firstCreated": {
    "mintTimestamp": 0,
    "mintBlockNumber": 0,
    "mintTransaction": "mintTransaction_example"
  },
  "creators": [
    {
      "address": "address_example",
      "share": 0,
      "verified": true
    }
  ],
  "properties": {},
  "possibleSpam": true
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/nft/mainnet/So11111111111111111111111111111111111111112/metadata" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTOwners.md
content: # Get NFT owners by contract address

Identify wallets owning NFTs from a specific contract.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/owners`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x306b1ea3ecdf94ab739f1910bbda052ed4a9f949\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| format | string | No | The format of the token ID | \`decimal\` |
| limit | number | No | The desired page size of the result. | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| normalizeMetadata | boolean | No | Should normalized metadata be returned? | - |
| media_items | boolean | No | Should preview media data be returned? | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns a collection of NFT owners

```json
{
  "status": "SYNCING",
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "token_address": [REDACTED_SECRET],
      "token_id": "15",
      "contract_type": "ERC721",
      "owner_of": [REDACTED_SECRET],
      "block_number": "88256",
      "block_number_minted": "88256",
      "token_uri": "token_uri_example",
      "metadata": "metadata_example",
      "amount": "1",
      "name": "CryptoKitties",
      "symbol": "RARI",
      "token_hash": "502cee781b0fb40ea02508b21d319ced",
      "rarity_rank": 21669,
      "rarity_percentage": 98,
      "rarity_label": "Top 98%",
      "last_token_uri_sync": "2021-02-24T00:47:26.647Z",
      "last_metadata_sync": "2021-02-24T00:47:26.647Z",
      "possible_spam": "false",
      "verified_collection": "false",
      "floor_price": "12345",
      "floor_price_usd": "12345.4899",
      "floor_price_currency": "eth",
      "last_sale": {
        "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
        "block_timestamp": "2023-04-04T15:59:11.000Z",
        "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
        "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
        "price": "7300000000000000",
        "price_formatted": "0.0073",
        "usd_price_at_sale": "13.61",
        "current_usd_value": "15.53",
        "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
        "token_id": "170",
        "payment_token": {
          "token_name": "Ether",
          "token_symbol": "ETH",
          "token_logo": "https://cdn.moralis.io/eth/0x.png",
          "token_decimals": "18",
          "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        }
      }
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x306b1ea3ecdf94ab739f1910bbda052ed4a9f949/owners?chain=eth&format=decimal" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTSalePrices.md
content: # Get NFT sale prices by token

Fetch sale prices for a specific NFT over a specified number of days. Returns the last sale, lowest sale, highest sale, average sale and total trades within the specified period.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/:token_id/price`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT collection | \`0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D\` |
| token_id | string | Yes | The token id of the NFT collection | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| days | number | No | The number of days to look back to find the lowest price
If not provided 7 days will be the default and 365 is the maximum
 | - |

## Response Example

Status: 200

Returns the sold price details

```json
{
  "last_sale": {
    "transaction_hash": "transaction_hash_example",
    "block_timestamp": "block_timestamp_example",
    "buyer_address": "buyer_address_example",
    "seller_address": "seller_address_example",
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "usd_price_at_sale": "usd_price_at_sale_example",
    "current_usd_value": "current_usd_value_example",
    "token_id": "token_id_example",
    "payment_token": {
      "token_name": "token_name_example",
      "token_symbol": "token_symbol_example",
      "token_logo": "token_logo_example",
      "token_decimals": "token_decimals_example",
      "token_address": "token_address_example"
    }
  },
  "lowest_sale": {
    "transaction_hash": "transaction_hash_example",
    "block_timestamp": "block_timestamp_example",
    "buyer_address": "buyer_address_example",
    "seller_address": "seller_address_example",
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "usd_price_at_sale": "usd_price_at_sale_example",
    "current_usd_value": "current_usd_value_example",
    "token_id": "token_id_example",
    "payment_token": {
      "token_name": "token_name_example",
      "token_symbol": "token_symbol_example",
      "token_logo": "token_logo_example",
      "token_decimals": "token_decimals_example",
      "token_address": "token_address_example"
    }
  },
  "highest_sale": {
    "transaction_hash": "transaction_hash_example",
    "block_timestamp": "block_timestamp_example",
    "buyer_address": "buyer_address_example",
    "seller_address": "seller_address_example",
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "usd_price_at_sale": "usd_price_at_sale_example",
    "current_usd_value": "current_usd_value_example",
    "token_id": "token_id_example",
    "payment_token": {
      "token_name": "token_name_example",
      "token_symbol": "token_symbol_example",
      "token_logo": "token_logo_example",
      "token_decimals": "token_decimals_example",
      "token_address": "token_address_example"
    }
  },
  "average_sale": {
    "price": "price_example",
    "price_formatted": "price_formatted_example",
    "current_usd_value": "current_usd_value_example"
  },
  "total_trades": 0,
  "message": "message_example"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/1/price?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTokenIdOwners.md
content: # Get NFT owners by token ID

List wallets owning a specific NFT, defined by its contract and token ID.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/:token_id/owners`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |
| token_id | string | Yes | The ID of the token | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| format | string | No | The format of the token ID | \`decimal\` |
| limit | number | No | The desired page size of the result. | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| normalizeMetadata | boolean | No | Should normalized metadata be returned? | - |
| media_items | boolean | No | Should preview media data be returned? | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns a collection of NFTs with their respective owners.

```json
{
  "status": "SYNCING",
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "token_address": [REDACTED_SECRET],
      "token_id": "15",
      "contract_type": "ERC721",
      "owner_of": [REDACTED_SECRET],
      "block_number": "88256",
      "block_number_minted": "88256",
      "token_uri": "token_uri_example",
      "metadata": "metadata_example",
      "amount": "1",
      "name": "CryptoKitties",
      "symbol": "RARI",
      "token_hash": "502cee781b0fb40ea02508b21d319ced",
      "rarity_rank": 21669,
      "rarity_percentage": 98,
      "rarity_label": "Top 98%",
      "last_token_uri_sync": "2021-02-24T00:47:26.647Z",
      "last_metadata_sync": "2021-02-24T00:47:26.647Z",
      "possible_spam": "false",
      "verified_collection": "false",
      "floor_price": "12345",
      "floor_price_usd": "12345.4899",
      "floor_price_currency": "eth",
      "last_sale": {
        "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
        "block_timestamp": "2023-04-04T15:59:11.000Z",
        "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
        "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
        "price": "7300000000000000",
        "price_formatted": "0.0073",
        "usd_price_at_sale": "13.61",
        "current_usd_value": "15.53",
        "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
        "token_id": "170",
        "payment_token": {
          "token_name": "Ether",
          "token_symbol": "ETH",
          "token_logo": "https://cdn.moralis.io/eth/0x.png",
          "token_decimals": "18",
          "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        }
      }
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/1/owners?chain=eth&format=decimal" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTrades.md
content: # Get NFT trades by collection

Get NFT trades for a given contract with the ability to filter by marketplace.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/trades`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| from_block | number | No | The minimum block number from which to get the transfers
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_block | string | No | The block number to get the trades from | - |
| from_date | string | No | The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_date | string | No | The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| marketplace | string | No | Marketplace from which to get the trades. See [supported Marketplaces](https://docs.moralis.io/web3-data-api/evm/nft-marketplaces). | \`opensea\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| nft_metadata | boolean | No | Include the NFT Metadata of the NFT Token | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the trades

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "transaction_hash": [REDACTED_SECRET],
      "transaction_index": "transaction_index_example",
      "token_ids": [
        "15",
        "54"
      ],
      "seller_address": [REDACTED_SECRET],
      "buyer_address": [REDACTED_SECRET],
      "token_address": "0x4ad3785ec7eed7589fa86538244a4530f962434f",
      "marketplace_address": [REDACTED_SECRET],
      "price_token_address": "0x60e4d786628fea6478f785a6d7e704777c86a7c6",
      "price": "1000000000000000",
      "block_timestamp": "2021-06-04T16:00:15",
      "block_number": "13680123",
      "block_hash": "0x4a7c916ca4a970358b9df90051008f729685ff05e9724a9dddba32630c37cb96"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/trades?chain=eth&marketplace=opensea" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTradesByToken.md
content: # Get NFT trades by token

Get NFT trades for a specific NFT by specifying a contract addres and token ID.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/:token_id/trades`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |
| token_id | string | Yes | The token ID of the NFT contract | \`123\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| from_block | number | No | The minimum block number from which to get the transfers
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_block | string | No | The block number to get the trades from | - |
| from_date | string | No | The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_date | string | No | The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| nft_metadata | boolean | No | Include the NFT Metadata of the NFT Token | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the trades

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "transaction_hash": [REDACTED_SECRET],
      "transaction_index": "transaction_index_example",
      "token_ids": [
        "15",
        "54"
      ],
      "seller_address": [REDACTED_SECRET],
      "buyer_address": [REDACTED_SECRET],
      "token_address": "0x4ad3785ec7eed7589fa86538244a4530f962434f",
      "marketplace_address": [REDACTED_SECRET],
      "price_token_address": "0x60e4d786628fea6478f785a6d7e704777c86a7c6",
      "price": "1000000000000000",
      "block_timestamp": "2021-06-04T16:00:15",
      "block_number": "13680123",
      "block_hash": "0x4a7c916ca4a970358b9df90051008f729685ff05e9724a9dddba32630c37cb96"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/123/trades?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTradesByWallet.md
content: # Get NFT trades by wallet address

Get NFT trades for a specific wallet address.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/wallets/:address/nfts/trades`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The owner wallet address | \`0xcB1C1FdE09f811B294172696404e88E658659905\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| from_block | number | No | The minimum block number from which to get the transfers
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_block | string | No | The block number to get the trades from | - |
| from_date | string | No | The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| to_date | string | No | The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| nft_metadata | boolean | No | Include the NFT Metadata of the NFT Token | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the trades

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "transaction_hash": [REDACTED_SECRET],
      "transaction_index": "transaction_index_example",
      "token_ids": [
        "15",
        "54"
      ],
      "seller_address": [REDACTED_SECRET],
      "buyer_address": [REDACTED_SECRET],
      "token_address": "0x4ad3785ec7eed7589fa86538244a4530f962434f",
      "marketplace_address": [REDACTED_SECRET],
      "price_token_address": "0x60e4d786628fea6478f785a6d7e704777c86a7c6",
      "price": "1000000000000000",
      "block_timestamp": "2021-06-04T16:00:15",
      "block_number": "13680123",
      "block_hash": "0x4a7c916ca4a970358b9df90051008f729685ff05e9724a9dddba32630c37cb96"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/wallets/0xcB1C1FdE09f811B294172696404e88E658659905/nfts/trades?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTraitsByCollection.md
content: # Get NFT traits by collection

Explore the distinct traits of NFTs in a contract, showcasing their unique attributes.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/traits`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the traits

```json
{
  "traits": [
    {
      "trait_type": "Background",
      "values": [
        {
          "trait_value": "Lavendar",
          "count": 18593,
          "percentage": 85.8,
          "rarity_label": "Top 4% trait"
        }
      ]
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/traits?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTraitsByCollectionPaginate.md
content: # Get NFT traits by collection paginate

Fetch NFT traits for a contract with pagination for efficient navigation of large collections.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/traits/paginate`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| order | string (ASC, DESC) | No | The order of the result, in ascending (ASC) or descending (DESC) | \`DESC\` |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the traits

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "trait_type": "Background",
      "trait_value": "Lavendar",
      "count": 18593,
      "percentage": 85.8,
      "rarity_label": "Top 4% trait"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/traits/paginate?chain=eth&order=DESC" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTTransfers.md
content: # Get NFT transfers by token ID

Get transfers of a specific NFT given a contract address and token ID.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/nft/:address/:token_id/transfers`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address of the NFT contract | \`0x524cab2ec69124574082676e6f654a18df49a048\` |
| token_id | string | Yes | The ID of the token | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| format | string | No | The format of the token ID | \`decimal\` |
| include_prices | boolean | No | Should NFT last sale prices be included in the result? | - |
| limit | number | No | The desired page size of the result. | - |
| order | string (ASC, DESC) | No | The order of the result, in ascending (ASC) or descending (DESC) | \`DESC\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns a collection of NFT transfers

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "token_address": [REDACTED_SECRET],
      "token_id": "15",
      "token_name": "Tether USD",
      "token_symbol": "USDT",
      "from_address_entity": "Opensea",
      "from_address_entity_logo": "https://opensea.io/favicon.ico",
      "from_address": [REDACTED_SECRET],
      "from_address_label": "Binance 1",
      "to_address_entity": "Beaver Build",
      "to_address_entity_logo": "https://beaverbuild.com/favicon.ico",
      "to_address": [REDACTED_SECRET],
      "to_address_label": "Binance 2",
      "value": "1000000000000000",
      "amount": "1",
      "contract_type": "ERC721",
      "block_number": "88256",
      "block_timestamp": "2021-06-04T16:00:15",
      "block_hash": "block_hash_example",
      "transaction_hash": [REDACTED_SECRET],
      "transaction_type": "transaction_type_example",
      "transaction_index": 0,
      "log_index": 0,
      "operator": [REDACTED_SECRET],
      "possible_spam": "false",
      "verified_collection": "false",
      "last_sale": {
        "transaction_hash": "0x19e14f34b8f120c980f7ba05338d64c00384857fb9c561e2c56d0f575424a95c",
        "block_timestamp": "2023-04-04T15:59:11.000Z",
        "buyer_address": "0xcb1c1fde09f811b294172696404e88e658659905",
        "seller_address": "0x497a7dee2f13db161eb2fec060fa783cb041419f",
        "price": "7300000000000000",
        "price_formatted": "0.0073",
        "usd_price_at_sale": "13.61",
        "current_usd_value": "15.53",
        "token_address": "0xe8778996e096b39705c6a0a937eb587a1ebbda17",
        "token_id": "170",
        "payment_token": {
          "token_name": "Ether",
          "token_symbol": "ETH",
          "token_logo": "https://cdn.moralis.io/eth/0x.png",
          "token_decimals": "18",
          "token_address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        }
      }
    }
  ],
  "block_exists": true,
  "index_complete": true
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/nft/0x524cab2ec69124574082676e6f654a18df49a048/1/transfers?chain=eth&format=decimal&order=DESC" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNFTs__solana.md
content: # Gets NFTs owned by the given address

Gets NFTs owned by the given address

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/account/:network/:address/nft`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| nftMetadata | boolean | No | Should return the full NFT metadata | - |
| mediaItems | boolean | No | Should return media items | - |
| excludeSpam | boolean | No | Should exclude spam NFTs | - |
| includeFungibleAssets | boolean | No | Should include fungible assets (tokenStandard:1) | - |

## Response Example

Status: 200

```json
[
  {
    "associatedTokenAddress": "associatedTokenAddress_example",
    "mint": "mint_example",
    "name": "name_example",
    "symbol": "symbol_example",
    "tokenStandard": 0,
    "amount": "amount_example",
    "amountRaw": "amountRaw_example",
    "decimals": 0,
    "possibleSpam": true,
    "totalSupply": "totalSupply_example",
    "attributes": [
      {
        "traitType": "traitType_example",
        "value": {}
      }
    ],
    "contract": {
      "type": "type_example",
      "name": "name_example",
      "symbol": "symbol_example"
    },
    "collection": {
      "collectionAddress": "collectionAddress_example",
      "name": "name_example",
      "description": "description_example",
      "imageOriginalUrl": "imageOriginalUrl_example",
      "externalUrl": "externalUrl_example",
      "metaplexMint": "metaplexMint_example",
      "sellerFeeBasisPoints": 0
    },
    "firstCreated": {
      "mintTimestamp": 0,
      "mintBlockNumber": 0,
      "mintTransaction": "mintTransaction_example"
    },
    "creators": [
      {
        "address": "address_example",
        "share": 0,
        "verified": true
      }
    ],
    "properties": {}
  }
]
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/nft" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNativeBalance.md
content: # Get native balance by wallet

Check the native token balance (e.g. ETH) for a specific wallet.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/:address/balance`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The address from which the native balance will be checked | \`0x057Ec652A4F150f7FF94f089A38008f49a0DF88e\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| to_block | number | No | The block number up to which the balances will be checked. | - |

## Response Example

Status: 200

Returns the native balance for a specific address

```json
{
  "balance": "1234567890"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/0x057Ec652A4F150f7FF94f089A38008f49a0DF88e/balance?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNativeBalancesForAddresses.md
content: # Get native balance for a set of wallets

Retrieve native token balances (e.g. ETH) for one or many wallet addresses in single request.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/wallets/balances`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| to_block | number | No | The block number on which the balances should be checked | - |
| wallet_addresses | array | Yes | The addresses to get metadata for | - |

## Response Example

Status: 200

Returns a collection of balances

```json
[]
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/wallets/balances?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNewTokensByExchange__evm.md
content: # Get new tokens by exchange

List newly added tokens on a specific exchange. Currently only supports tama.meme on Ronin.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/exchange/:exchangeName/new`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| exchangeName | string | Yes | The name of the exchange | \`tama.meme\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | Yes | The chain to query | \`eth\` |
| limit | number | No | The maximum number of items to return | - |
| cursor | string | No | The cursor to use for pagination | - |

## Cursor/Pagination

- **limit**: The maximum number of items to return
- **cursor**: The cursor to use for pagination

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the new tokens for the specified exchange.

```json
{
  "total": 10,
  "page": 1,
  "page_size": 100,
  "cursor": "<cursor_from_previous_response>",
  "result": [
    {
      "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "name": "Test Token",
      "symbol": "TEST",
      "logo": "https://example.com/logo.png",
      "decimals": 18,
      "priceNative": "0.5",
      "priceUsd": "2.0",
      "liquidity": "500000",
      "fullyDilutedValuation": "2000000",
      "createdAt": "2023-01-20T09:39:55.818Z"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/erc20/exchange/tama.meme/new?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getNewTokensByExchange__solana.md
content: # Get new tokens by exchange

Get the list of new tokens by given exchange.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/exchange/:exchange/new`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| exchange | string | Yes | - | - |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| cursor | string | No | The cursor to the next page | - |
| limit | number | No | The limit per page | - |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "cursor": "cursor_example",
  "pageSize": 0,
  "page": 0,
  "result": [
    {
      "tokenAddress": "tokenAddress_example",
      "name": "name_example",
      "symbol": "symbol_example",
      "logo": "logo_example",
      "decimals": "decimals_example",
      "priceNative": "priceNative_example",
      "priceUsd": "priceUsd_example",
      "liquidity": "liquidity_example",
      "fullyDilutedValuation": "fullyDilutedValuation_example",
      "createdAt": "2024-11-28T09:44:55.000Z"
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/exchange/:exchange/new" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPairAddress.md
content: # Get DEX token pair address

Get the pair address for a token0/token1 combination on a DEX, interchangeable order.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/:token0_address/:token1_address/pairAddress`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| token0_address | string | Yes | The token0 address | \`0x2b591e99afe9f32eaa6214f7b7629768c40eeb39\` |
| token1_address | string | Yes | The token1 address | \`0xdac17f958d2ee523a2206206994597c13d831ec7\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| to_block | string | No | The block number to get the reserves from | - |
| to_date | string | No | Get the reserves up to this date (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| exchange | string | Yes | The factory name or address of the token exchange | \`uniswapv2\` |

## Response Example

Status: 200

Returns the pair address of the two tokens.

```json
{
  "token0": {
    "address": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39",
    "name": "HEX",
    "symbol": "HEX",
    "decimals": 9,
    "logo": "https://cdn.moralis.io/eth/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39.png",
    "logo_hash": "b3bd1b5512965d7b6aeee903dcc6d28b116d58c788eb41e9c1690baed878beaa",
    "thumbnail": "https://cdn.moralis.io/eth/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39_thumb.png",
    "block_number": 14836562,
    "validated": 0,
    "created_at": "2022-01-20T09:39:55.818Z"
  },
  "token1": {
    "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "name": "Tether USD",
    "symbol": "USDT",
    "decimals": 6,
    "logo": "https://cdn.moralis.io/eth/0xdac17f958d2ee523a2206206994597c13d831ec7.png",
    "logo_hash": "ee7aa2cdf100649a3521a082116258e862e6971261a39b5cd4e4354fcccbc54d",
    "thumbnail": "https://cdn.moralis.io/eth/0xdac17f958d2ee523a2206206994597c13d831ec7_thumb.png",
    "block_number": "4638568",
    "validated": 1,
    "created_at": "2022-01-20T09:39:55.818Z"
  },
  "pairAddress": "0xbbb9bf440d0f686487925fef3b0a0f9aa67753f6"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39/0xdac17f958d2ee523a2206206994597c13d831ec7/pairAddress?chain=eth&exchange=uniswapv2" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPairCandlesticks.md
content: # Get OHLCV by pair address

Retrieve OHLCV (Open, High, Low, Close, Volume) candlestick data for a token pair.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/pairs/:address/ohlcv`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The pair address | \`0xa43fe16908251ee70ef74718545e4fe6c5ccec9f\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| timeframe | string | Yes | The timeframe | \`1h\` |
| currency | string | Yes | The currency | \`usd\` |
| fromDate | string | Yes | The starting date (format in seconds or datestring accepted by momentjs)
* Provide the param 'fromBlock' or 'fromDate'
* If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.
 | \`2025-01-01T10:00:00.000\` |
| toDate | string | Yes | The ending date (format in seconds or datestring accepted by momentjs)
* Provide the param 'toBlock' or 'toDate'
* If 'toDate' and 'toBlock' are provided, 'toBlock' will be used.
 | \`2025-01-02T10:00:00.000\` |
| limit | number | No | The number of results to return | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page) | - |

## Cursor/Pagination

- **limit**: The number of results to return
- **cursor**: The cursor returned in the previous response (used for getting the next page)

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns the OHLCV data.

```json
{
  "cursor": "cursor_example",
  "page": "2",
  "pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
  "tokenAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
  "timeframe": "30min",
  "currency": "usd",
  "result": [
    {
      "timestamp": "timestamp_example",
      "open": 0,
      "high": 0,
      "low": 0,
      "close": 0,
      "volume": 0,
      "trades": 0
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/pairs/0xa43fe16908251ee70ef74718545e4fe6c5ccec9f/ohlcv?chain=eth&timeframe=1h&currency=usd&fromDate=2025-01-01T10%3A00%3A00.000&toDate=2025-01-02T10%3A00%3A00.000" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPairPrice.md
content: # Get DEX token pair price

Fetch the current price of a token pair on Uniswap V2-based DEXs.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/:token0_address/:token1_address/price`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| token0_address | string | Yes | The token0 address | \`0xae7ab96520de3a18e5e111b5eaab095312d7fe84\` |
| token1_address | string | Yes | The token1 address | \`0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| to_block | string | No | The block number to get the reserves from | - |
| to_date | string | No | Get the price up to this date (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| exchange | string | No | The factory name or address of the token exchange | - |

## Response Example

Status: 200

Returns the pair price

```json
{
  "pair_address": "0x4028daac072e492d34a3afdbef0ba7e35d8b55c4",
  "pair_label": "stETH/WETH",
  "exchange": "Uniswap v2",
  "quote_price": "1.000094331827400707",
  "price_usd": "2905.023454928171304346",
  "base_token": {
    "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
    "address_label": "Binance 1",
    "name": "Kylin Network",
    "symbol": "KYL",
    "decimals": "18",
    "logo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
    "logo_hash": "ee7aa2cdf100649a3521a082116258e862e6971261a39b5cd4e4354fcccbc54d",
    "thumbnail": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c_thumb.png",
    "total_supply": "420689899999994793099999999997400",
    "total_supply_formatted": "420689899999994.7930999999999974",
    "implementations": [
      {
        "chainId": "0x1",
        "chain": "eth",
        "chainName": "Ethereum",
        "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933"
      }
    ],
    "fully_diluted_valuation": "3407271444.05",
    "block_number": "block_number_example",
    "validated": 0,
    "created_at": "created_at_example",
    "possible_spam": "false",
    "verified_contract": false,
    "categories": [
      "stablecoin"
    ],
    "circulating_supply": "4206864.7489303",
    "market_cap": "3407271444.05"
  },
  "quote_token": {
    "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
    "address_label": "Binance 1",
    "name": "Kylin Network",
    "symbol": "KYL",
    "decimals": "18",
    "logo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
    "logo_hash": "ee7aa2cdf100649a3521a082116258e862e6971261a39b5cd4e4354fcccbc54d",
    "thumbnail": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c_thumb.png",
    "total_supply": "420689899999994793099999999997400",
    "total_supply_formatted": "420689899999994.7930999999999974",
    "implementations": [
      {
        "chainId": "0x1",
        "chain": "eth",
        "chainName": "Ethereum",
        "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933"
      }
    ],
    "fully_diluted_valuation": "3407271444.05",
    "block_number": "block_number_example",
    "validated": 0,
    "created_at": "created_at_example",
    "possible_spam": "false",
    "verified_contract": false,
    "categories": [
      "stablecoin"
    ],
    "circulating_supply": "4206864.7489303",
    "market_cap": "3407271444.05"
  }
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/0xae7ab96520de3a18e5e111b5eaab095312d7fe84/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/price?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPairReserves.md
content: # Get DEX token pair reserves

Retrieve liquidity reserves for a token pair on Uniswap V2-based DEXs.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/:pair_address/reserves`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| pair_address | string | Yes | The liquidity pair address | \`0xa2107fa5b38d9bbd2c461d6edf11b11a50f6b974\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| to_block | string | No | The block number to get the reserves from | - |
| to_date | string | No | Get the reserves up to this date (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |

## Response Example

Status: 200

Returns the pair reserves

```json
{
  "reserve0": "220969226548536862025877",
  "reserve1": "844810441191293211036"
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/0xa2107fa5b38d9bbd2c461d6edf11b11a50f6b974/reserves?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPairStats__evm.md
content: # Get stats by pair address

Access key statistics for a token pair, such as price, buyers, sellers, liquidity, volume and more.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/pairs/:address/stats`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The pair address | \`0xa43fe16908251ee70ef74718545e4fe6c5ccec9f\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |

## Response Example

Status: 200

Returns the pair stats.

```json
{
  "tokenAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
  "tokenName": "Wrapped Ether",
  "tokenSymbol": "WETH",
  "tokenLogo": "https://cdn.moralis.io/coins/images/2518/large/weth.png?1595348880",
  "pairCreated": "2021-04-02T10:07:54.000Z",
  "pairLabel": "WETH/PEPE",
  "pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
  "exchange": "Uniswap v2",
  "exchangeAddress": "0x101cc05f4a51c0319f570d5e146a8c625198e222",
  "exchangeLogo": "uniswap.png",
  "exchangeUrl": "app.uniswap.com",
  "currentUsdPrice": "0.00000194",
  "currentNativePrice": "0.0000000042",
  "totalLiquidityUsd": "43345522",
  "pricePercentChange": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "liquidityPercentChange": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "buys": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "sells": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "totalVolume": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "buyVolume": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "sellVolume": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "buyers": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  },
  "sellers": {
    "5min": 0,
    "1h": 0,
    "4h": 0,
    "24h": 0
  }
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/pairs/0xa43fe16908251ee70ef74718545e4fe6c5ccec9f/stats?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPairStats__solana.md
content: # Get stats for a pair address

Gets the stats for a specific pair address

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/pairs/:pairAddress/stats`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| pairAddress | string | Yes | The address of the pair to query | \`Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE\` |

## Response Example

Status: 200

```json
{
  "tokenAddress": "tokenAddress_example",
  "tokenName": "tokenName_example",
  "tokenSymbol": "tokenSymbol_example",
  "tokenLogo": "tokenLogo_example",
  "pairCreated": "pairCreated_example",
  "pairLabel": "pairLabel_example",
  "pairAddress": "pairAddress_example",
  "exchange": "exchange_example",
  "exchangeAddress": "exchangeAddress_example",
  "exchangeLogo": "exchangeLogo_example",
  "exchangeUrl": "exchangeUrl_example",
  "currentUsdPrice": "currentUsdPrice_example",
  "currentNativePrice": "currentNativePrice_example",
  "totalLiquidityUsd": "totalLiquidityUsd_example"
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/stats" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getPortfolio__solana.md
content: # Gets the portfolio of the given address

Gets all the native and token balances of the given address

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/account/:network/:address/portfolio`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| nftMetadata | boolean | No | Should return the full NFT metadata | - |
| mediaItems | boolean | No | Should return media items | - |
| excludeSpam | boolean | No | Should exclude spam NFTs | - |

## Response Example

Status: 200

```json
{
  "nativeBalance": {
    "solana": "solana_example",
    "lamports": "lamports_example"
  },
  "nfts": [
    {
      "associatedTokenAddress": "associatedTokenAddress_example",
      "mint": "mint_example",
      "name": "name_example",
      "symbol": "symbol_example",
      "tokenStandard": 0,
      "amount": "amount_example",
      "amountRaw": "amountRaw_example",
      "decimals": 0,
      "possibleSpam": true,
      "totalSupply": "totalSupply_example",
      "attributes": [
        {
          "traitType": "traitType_example",
          "value": {}
        }
      ],
      "contract": {
        "type": "type_example",
        "name": "name_example",
        "symbol": "symbol_example"
      },
      "collection": {
        "collectionAddress": "collectionAddress_example",
        "name": "name_example",
        "description": "description_example",
        "imageOriginalUrl": "imageOriginalUrl_example",
        "externalUrl": "externalUrl_example",
        "metaplexMint": "metaplexMint_example",
        "sellerFeeBasisPoints": 0
      },
      "firstCreated": {
        "mintTimestamp": 0,
        "mintBlockNumber": 0,
        "mintTransaction": "mintTransaction_example"
      },
      "creators": [
        {
          "address": "address_example",
          "share": 0,
          "verified": true
        }
      ],
      "properties": {}
    }
  ],
  "tokens": [
    {
      "associatedTokenAddress": "associatedTokenAddress_example",
      "mint": "mint_example",
      "name": "name_example",
      "symbol": "symbol_example",
      "tokenStandard": 0,
      "score": 0,
      "amount": "amount_example",
      "amountRaw": "amountRaw_example",
      "decimals": 0,
      "logo": "logo_example",
      "isVerifiedContract": true,
      "possibleSpam": true
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/portfolio" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSPL__solana.md
content: # Gets token balances owned by the given address

Gets token balances owned by the given address

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/account/:network/:address/tokens`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| excludeSpam | boolean | No | Should exclude spam tokens | - |

## Response Example

Status: 200

```json
[
  {
    "associatedTokenAddress": "associatedTokenAddress_example",
    "mint": "mint_example",
    "name": "name_example",
    "symbol": "symbol_example",
    "tokenStandard": 0,
    "score": 0,
    "amount": "amount_example",
    "amountRaw": "amountRaw_example",
    "decimals": 0,
    "logo": "logo_example",
    "isVerifiedContract": true,
    "possibleSpam": true
  }
]
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/tokens" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSnipersByPairAddress__evm.md
content: # Get snipers by pair address

Identify sniper wallets that bought a token within a specified timeframe (`blocksAfterCreation`). Each wallet returned includes detailed information about how much was bought, sold as well as PnL stats and more.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/pairs/:address/snipers`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The pair address token-transactions are to be retrieved for. | \`0xa3c2076eb97d573cc8842f1db1ecdf7b6f77ba27\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| blocksAfterCreation | number | No | Number of blocks after the creation
 | - |

## Response Example

Status: 200

Returns snipers by pair address.

```json
{
  "transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abecab76c9db813602015b3134ad",
  "blockTimestamp": "2022-02-22T00:00:00Z",
  "blockNumber": 21093423,
  "result": [
    {
      "walletAddress": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
      "totalTokensSniped": 0,
      "totalSnipedUsd": 0,
      "totalSnipedTransactions": 0,
      "totalTokensSold": 0,
      "totalSoldUsd": 0,
      "totalSellTransactions": 0,
      "currentBalance": 0,
      "currentBalanceUsdValue": 0,
      "realizedProfitPercentage": 0,
      "realizedProfitUsd": 0,
      "snipedTransactions": [
        {
          "transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
          "blocksAfterCreation": 0,
          "transactionTimestamp": 0
        }
      ],
      "sellTransactions": [
        {
          "transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
          "blocksAfterCreation": 0,
          "transactionTimestamp": 0
        }
      ]
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/pairs/0xa3c2076eb97d573cc8842f1db1ecdf7b6f77ba27/snipers?chain=eth" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSnipersByPairAddress__solana.md
content: # Get snipers by pair address.

Get all snipers.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/pairs/:pairAddress/snipers`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| pairAddress | string | Yes | The address of the pair to query | \`Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| blocksAfterCreation | number | No | - | - |

## Response Example

Status: 200

```json
{
  "transactionHash": "transactionHash_example",
  "blockNumber": 0,
  "blockTimestamp": "blockTimestamp_example",
  "result": [
    {
      "walletAddress": "walletAddress_example",
      "totalTokensSniped": 0,
      "totalSnipedUsd": 0,
      "totalSnipedTransactions": 0,
      "snipedTransactions": [
        {
          "transactionHash": "transactionHash_example",
          "transactionTimestamp": "transactionTimestamp_example",
          "blocksAfterCreation": 0
        }
      ],
      "totalTokensSold": 0,
      "totalSoldUsd": 0,
      "totalSellTransactions": 0,
      "sellTransactions": [
        {
          "transactionHash": "transactionHash_example",
          "transactionTimestamp": "transactionTimestamp_example",
          "blocksAfterCreation": 0
        }
      ],
      "currentBalance": 0,
      "currentBalanceUsdValue": 0,
      "realizedProfitPercentage": 0,
      "realizedProfitUsd": 0
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/snipers" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSwapsByPairAddress__evm.md
content: # Get swap transactions by pair address

Fetch swap transactions (buy, sell, add/remove liquidity) for a specific token pair.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/pairs/:address/swaps`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The pair address token-transactions are to be retrieved for. | \`0xa43fe16908251ee70ef74718545e4fe6c5ccec9f\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| fromBlock | number | No | The minimum block number from which to get the token transactions
* Provide the param 'fromBlock' or 'fromDate'
* If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.
 | - |
| toBlock | string | No | The block number to get the token transactions from | - |
| fromDate | string | No | The start date from which to get the token transactions (format in seconds or datestring accepted by momentjs)
* Provide the param 'fromBlock' or 'fromDate'
* If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.
 | - |
| toDate | string | No | The end date from which to get the token transactions (format in seconds or datestring accepted by momentjs)
* Provide the param 'toBlock' or 'toDate'
* If 'toDate' and 'toBlock' are provided, 'toBlock' will be used.
 | - |
| order | string (ASC, DESC) | No | The order of the result, in ascending (ASC) or descending (DESC) | \`DESC\` |
| transactionTypes | string | No | Array of transaction types. Allowed values are 'buy', 'sell', 'addLiquidity', 'removeLiquidity'. | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns swap transactions by pair address.

```json
{
  "page": "2",
  "pageSize": "100",
  "cursor": "cursor_example",
  "exchangeAddress": [REDACTED_SECRET],
  "exchangeName": "Uniswap v2",
  "exchangeLogo": "https://entities-logos.s3.us-east-1.amazonaws.com/uniswap.png",
  "pairLabel": "BRETT/WETH",
  "pairAddress": "0x36a46dff597c5a444bbc521d26787f57867d2214",
  "baseToken": {
    "address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
    "name": "BRETT",
    "symbol": "BRETT",
    "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
    "amount": "14811.98",
    "usdPrice": 0.078634,
    "usdAmount": 1155.33
  },
  "quoteToken": {
    "address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
    "name": "BRETT",
    "symbol": "BRETT",
    "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
    "amount": "14811.98",
    "usdPrice": 0.078634,
    "usdAmount": 1155.33
  },
  "result": [
    {
      "transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abecab76c9db813602015b3134ad",
      "transactionIndex": 1,
      "transactionType": "buy",
      "blockTimestamp": "2022-02-22T00:00:00Z",
      "blockNumber": 21093423,
      "subCategory": "accumulation",
      "walletAddress": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
      "baseTokenAmount": "1481.00",
      "quoteTokenAmount": "0.634",
      "baseTokenPriceUsd": 0.0734634,
      "quoteTokenPriceUsd": 23330,
      "baseQuotePrice": "0.00003376480687",
      "totalValueUsd": 1165
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/pairs/0xa43fe16908251ee70ef74718545e4fe6c5ccec9f/swaps?chain=eth&order=DESC" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSwapsByPairAddress__solana.md
content: # Get all swap related transactions (buy, sell, add liquidity & remove liquidity)

Get all swap related transactions (buy, sell, add liquidity & remove liquidity) for a specific pair address.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/pairs/:pairAddress/swaps`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| pairAddress | string | Yes | The address of the pair to query | \`Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| limit | number | No | The limit per page | - |
| cursor | string | No | The cursor to the next page | - |
| order | string | No | The order of items | - |
| fromDate | string | No | The starting date (format in seconds or datestring accepted by momentjs) | - |
| toDate | string | No | The ending date (format in seconds or datestring accepted by momentjs) | - |
| transactionTypes | string | No | Transaction types to fetch. Possible values: 'buy', 'sell', 'addLiquidity' or 'removeLiquidity' separated by comma | \`buy,sell,addLiquidity,removeLiquidity\` |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "page": 1,
  "pageSize": 100,
  "cursor": "<cursor_from_previous_response>",
  "exchangeName": "Raydium AMM v4",
  "exchangeLogo": "https://entities-logos.s3.amazonaws.com/raydium.png",
  "exchangeAddress": [REDACTED_SECRET],
  "pairLabel": "BREAD/SOL",
  "pairAddress": [REDACTED_SECRET],
  "baseToken": {
    "address": [REDACTED_SECRET],
    "name": "MAD",
    "symbol": "MAD",
    "logo": "https://ipfs.io/ipfs/QmeCR6o1FrYjczPdDDDm4623usKksjj9BQLu89WqV8jFZW?filename=MAD.jpg",
    "decimals": "18"
  },
  "quoteToken": {
    "address": [REDACTED_SECRET],
    "name": "MAD",
    "symbol": "MAD",
    "logo": "https://ipfs.io/ipfs/QmeCR6o1FrYjczPdDDDm4623usKksjj9BQLu89WqV8jFZW?filename=MAD.jpg",
    "decimals": "18"
  },
  "result": [
    {
      "transactionHash": [REDACTED_SECRET],
      "transactionType": "sell",
      "transactionIndex": 250,
      "subCategory": "sellAll",
      "blockTimestamp": "2024-11-28T09:44:55.000Z",
      "blockNumber": 304108120,
      "walletAddress": [REDACTED_SECRET],
      "baseTokenAmount": "199255.444466200",
      "quoteTokenAmount": "0.007374998",
      "baseTokenPriceUsd": 0.000008794,
      "quoteTokenPriceUsd": 237.60336565,
      "baseQuotePrice": "0.0000000370127",
      "totalValueUsd": 1.752324346
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/pairs/Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE/swaps?transactionTypes=buy%2Csell%2CaddLiquidity%2CremoveLiquidity" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSwapsByTokenAddress__evm.md
content: # Get swap transactions by token address

Get all swap transactions (buy/sell) for a specific ERC20 token.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/erc20/:address/swaps`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The token address to get transaction for | \`0x6982508145454ce325ddbe47a25d4ec3d2311933\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| order | string (ASC, DESC) | No | The order of the result, in ascending (ASC) or descending (DESC) | \`DESC\` |
| fromBlock | number | No | The minimum block number from which to get the token transactions
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| toBlock | string | No | The block number to get the token transactions from | - |
| fromDate | string | No | The start date from which to get the token transactions (format in seconds or datestring accepted by momentjs)
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| toDate | string | No | The end date from which to get the token transactions (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| transactionTypes | string | No | Array of transaction types. Allowed values are 'buy', 'sell'. | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns swap transactions by wallet address.

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abecab76c9db813602015b3134ad",
      "transactionIndex": 1,
      "transactionType": "buy",
      "blockTimestamp": "2022-02-22T00:00:00Z",
      "blockNumber": 21093423,
      "subCategory": "accumulation",
      "walletAddress": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
      "walletAddressLabel": "Murad Wallet",
      "entity": "Murad",
      "entityLogo": "https://entities-logos.s3.us-east-1.amazonaws.com/murad.png",
      "pairAddress": "0x36a46dff597c5a444bbc521d26787f57867d2214",
      "pairLabel": "BRETT/WETH",
      "exchangeAddress": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
      "exchangeName": "Uniswap v2",
      "exchangeLogo": "https://entities-logos.s3.us-east-1.amazonaws.com/uniswap.png",
      "bought": {
        "address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
        "name": "BRETT",
        "symbol": "BRETT",
        "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
        "amount": "14811.98",
        "usdPrice": 0.078634,
        "usdAmount": 1155.33
      },
      "sold": {
        "address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
        "name": "BRETT",
        "symbol": "BRETT",
        "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
        "amount": "14811.98",
        "usdPrice": 0.078634,
        "usdAmount": 1155.33
      },
      "baseQuotePrice": "0.00003376480687",
      "totalValueUsd": 1165
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/erc20/0x6982508145454ce325ddbe47a25d4ec3d2311933/swaps?chain=eth&order=DESC" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSwapsByTokenAddress__solana.md
content: # Get all swap related transactions (buy, sell)

Get all swap related transactions (buy, sell) for a specific token address.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/:address/swaps`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`So11111111111111111111111111111111111111112\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| limit | number | No | The limit per page | - |
| cursor | string | No | The cursor to the next page | - |
| fromDate | string | No | The starting date (format in seconds or datestring accepted by momentjs) | - |
| toDate | string | No | The ending date (format in seconds or datestring accepted by momentjs) | - |
| order | string | No | The order of the results, in ascending (ASC) or descending (DESC). | \`DESC\` |
| transactionTypes | string | No | Transaction types to fetch. Possible values: 'buy','sell' or both separated by comma | \`buy,sell\` |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "page": 1,
  "pageSize": 100,
  "cursor": "<cursor_from_previous_response>",
  "result": [
    {
      "transactionHash": "0xafc66b9b1802618f560be5244395f0fc0b95a1f1fdeee7a206acbb546c9e8a72",
      "transactionIndex": 5,
      "transactionType": "buy",
      "blockNumber": 12345678,
      "blockTimestamp": "2024-11-21T09:22:28.000Z",
      "subCategory": "ACCUMULATION",
      "walletAddress": "0x1c584a6baecb7c5d51caa0ef3a579e08bd49d4e5",
      "pairAddress": "0xdded227d71a096c6b5d87807c1b5c456771aaa94",
      "pairLabel": "USDC/WETH",
      "exchangeAddress": "0x1080ee857d165186af7f8d63e8ec510c28a6d1ea",
      "exchangeName": "Uniswap",
      "exchangeLogo": "https://logo.moralis.io/0xe708_0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f_769a0b766bd3d6d1830f0a95d7b3e313",
      "baseToken": "ETH",
      "quoteToken": "USDT",
      "bought": {
        "address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f",
        "name": "Wrapped Ether",
        "symbol": "SYM",
        "logo": "https://example.com/logo-token1.png",
        "amount": "0.000014332429005002",
        "usdPrice": 3148.1828278180296,
        "usdAmount": 1230,
        "tokenType": "token1"
      },
      "sold": {
        "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff",
        "name": "USDC",
        "symbol": "SYM",
        "logo": "https://example.com/logo-token2.png",
        "amount": "1000",
        "usdPrice": 0.9999999999999986,
        "usdAmount": -0.045138999999999936,
        "tokenType": "token0"
      },
      "baseQuotePrice": "0.01",
      "totalValueUsd": 1230
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/So11111111111111111111111111111111111111112/swaps?order=DESC&transactionTypes=buy%2Csell" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSwapsByWalletAddress__evm.md
content: # Get swap transactions by wallet address

List all swap transactions (buy/sell) for a specific wallet. Optionally filter by `tokenAddress` for specific token swaps.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/wallets/:address/swaps`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| address | string | Yes | The wallet address token-transactions are to be retrieved for. | \`0xcB1C1FdE09f811B294172696404e88E658659905\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f) | No | The chain to query | \`eth\` |
| tokenAddress | string | No | The token address to get transaction for (optional) | - |
| cursor | string | No | The cursor returned in the previous response (used for getting the next page). | - |
| limit | number | No | The desired page size of the result. | - |
| fromBlock | number | No | The minimum block number from which to get the token transactions
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| toBlock | string | No | The block number to get the token transactions from | - |
| fromDate | string | No | The start date from which to get the token transactions (format in seconds or datestring accepted by momentjs)
* Provide the param 'from_block' or 'from_date'
* If 'from_date' and 'from_block' are provided, 'from_block' will be used.
 | - |
| toDate | string | No | The end date from which to get the token transactions (format in seconds or datestring accepted by momentjs)
* Provide the param 'to_block' or 'to_date'
* If 'to_date' and 'to_block' are provided, 'to_block' will be used.
 | - |
| order | string (ASC, DESC) | No | The order of the result, in ascending (ASC) or descending (DESC) | \`DESC\` |
| transactionTypes | string | No | Array of transaction types. Allowed values are 'buy', 'sell'. | - |

## Cursor/Pagination

- **limit**: The desired page size of the result.
- **cursor**: The cursor returned in the previous response (used for getting the next page).

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

Returns swap transactions by wallet address.

```json
{
  "page": "2",
  "page_size": "100",
  "cursor": "cursor_example",
  "result": [
    {
      "transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abecab76c9db813602015b3134ad",
      "transactionIndex": 1,
      "transactionType": "buy",
      "blockTimestamp": "2022-02-22T00:00:00Z",
      "blockNumber": 21093423,
      "subCategory": "accumulation",
      "walletAddress": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
      "walletAddressLabel": "Murad Wallet",
      "entity": "Murad",
      "entityLogo": "https://entities-logos.s3.us-east-1.amazonaws.com/murad.png",
      "pairAddress": "0x36a46dff597c5a444bbc521d26787f57867d2214",
      "pairLabel": "BRETT/WETH",
      "exchangeAddress": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
      "exchangeName": "Uniswap v2",
      "exchangeLogo": "https://entities-logos.s3.us-east-1.amazonaws.com/uniswap.png",
      "bought": {
        "address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
        "name": "BRETT",
        "symbol": "BRETT",
        "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
        "amount": "14811.98",
        "usdPrice": 0.078634,
        "usdAmount": 1155.33
      },
      "sold": {
        "address": "0x003dde3494f30d861d063232c6a8c04394b686ff",
        "name": "BRETT",
        "symbol": "BRETT",
        "logo": "https://cdn.moralis.io/tokens/0x0000000000085d4780b73119b644ae5ecd22b376.png",
        "amount": "14811.98",
        "usdPrice": 0.078634,
        "usdAmount": 1155.33
      },
      "baseQuotePrice": "0.00003376480687",
      "totalValueUsd": 1165
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/wallets/0xcB1C1FdE09f811B294172696404e88E658659905/swaps?chain=eth&order=DESC" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getSwapsByWalletAddress__solana.md
content: # Get all swap related transactions (buy, sell) for a specific wallet address.

Get all swap related transactions (buy, sell) for a specific wallet address.

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/account/:network/:address/swaps`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| limit | number | No | The limit per page | - |
| cursor | string | No | The cursor to the next page | - |
| order | string | No | The order of items | - |
| fromDate | string | No | The starting date (format in seconds or datestring accepted by momentjs) | - |
| toDate | string | No | The ending date (format in seconds or datestring accepted by momentjs) | - |
| transactionTypes | string | No | Transaction types to fetch. Possible values: 'buy','sell' or both separated by comma | \`buy,sell\` |
| tokenAddress | string | No | Token address to get transactions for | - |

## Cursor/Pagination

- **limit**: The limit per page
- **cursor**: The cursor to the next page

The response includes a **cursor** field for pagination. Use this cursor in the next request to get the next page of results.

## Response Example

Status: 200

```json
{
  "page": 0,
  "pageSize": 0,
  "cursor": "cursor_example",
  "result": [
    {
      "transactionHash": "0xafc66b9b1802618f560be5244395f0fc0b95a1f1fdeee7a206acbb546c9e8a72",
      "transactionIndex": 5,
      "transactionType": "buy",
      "blockNumber": 12345678,
      "blockTimestamp": "2024-11-21T09:22:28.000Z",
      "subCategory": "ACCUMULATION",
      "walletAddress": "0x1c584a6baecb7c5d51caa0ef3a579e08bd49d4e5",
      "pairAddress": "0xdded227d71a096c6b5d87807c1b5c456771aaa94",
      "pairLabel": "USDC/WETH",
      "exchangeAddress": "0x1080ee857d165186af7f8d63e8ec510c28a6d1ea",
      "exchangeName": "Uniswap",
      "exchangeLogo": "https://logo.moralis.io/0xe708_0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f_769a0b766bd3d6d1830f0a95d7b3e313",
      "baseToken": "ETH",
      "quoteToken": "USDT",
      "bought": {
        "address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f",
        "name": "Wrapped Ether",
        "symbol": "SYM",
        "logo": "https://example.com/logo-token1.png",
        "amount": "0.000014332429005002",
        "usdPrice": 3148.1828278180296,
        "usdAmount": 1230,
        "tokenType": "token1"
      },
      "sold": {
        "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff",
        "name": "USDC",
        "symbol": "SYM",
        "logo": "https://example.com/logo-token2.png",
        "amount": "1000",
        "usdPrice": 0.9999999999999986,
        "usdAmount": -0.045138999999999936,
        "tokenType": "token0"
      },
      "baseQuotePrice": "0.01",
      "totalValueUsd": 1230
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/account/mainnet/kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs/swaps?transactionTypes=buy%2Csell" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getTimeSeriesTokenAnalytics.md
content: # Retrieve timeseries trading stats by token addresses

Fetch timeseries buy volume, sell volume, liquidity and FDV for multiple tokens. Accepts an array of up to 200 `tokens`, each requiring `chain` and `tokenAddress`.

## Method

POST

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/tokens/analytics/timeseries`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Body

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| tokens | array | No | The tokens to be fetched | \`[object Object],[object Object]\` |

## Response Example

Status: 200

Successful response

```json
{
  "result": [
    {
      "chainId": "0x1",
      "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "timeseries": [
        {
          "timestamp": "2022-02-22T00:00:00Z",
          "buyVolume": 4565,
          "sellVolume": 4565,
          "liquidityUsd": 4565,
          "fullyDilutedValuation": 4565
        }
      ]
    }
  ]
}
```

## Example (curl)

```bash
curl -X POST "https://deep-index.moralis.io/api/v2.2/tokens/analytics/timeseries?timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -d '{
  "tokens": [
    {
      "chain": "0x1",
      "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7"
    },
    {
      "chain": "solana",
      "tokenAddress": [REDACTED_SECRET]
    }
  ]
}'
```


path: rules/getTimeSeriesVolume.md
content: # Retrieve timeseries trading stats by chain

Fetch timeseries volume, liquidity and FDV for a specific blockchain.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/volume/timeseries`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | No | The chain to query | \`eth\` |
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Response Example

Status: 200

Successful response

```json
{
  "timeseries": [
    {
      "timestamp": "2022-02-22T00:00:00Z",
      "volume": 4565,
      "liquidityUsd": 4565,
      "fullyDilutedValuation": 4565
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/volume/timeseries?chain=eth&timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getTimeSeriesVolumeByCategory.md
content: # Retrieve timeseries trading stats by category

Fetch timeseries buy volume, sell volume, liquidity and FDV for a specific category. Optionally filter by `chain`.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/volume/timeseries/:categoryId`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| categoryId | string | Yes | The category id | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | No | The chain to query | \`eth\` |
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Response Example

Status: 200

Successful response

```json
{
  "timeseries": [
    {
      "timestamp": "2022-02-22T00:00:00Z",
      "buyVolume": 4565,
      "sellVolume": 4565,
      "liquidityUsd": 4565,
      "fullyDilutedValuation": 4565
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/volume/timeseries/1?chain=eth&timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getTimeSeriesVolumeByCategory__solana.md
content: # Retrieve timeseries trading stats by category

**Solana variant:** Fetch timeseries buy volume, sell volume, liquidity and FDV for a specific category. Optionally filter by `chain`.

This EVM endpoint supports Solana via the `chain=solana` parameter.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/volume/timeseries/:categoryId`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| categoryId | string | Yes | The category id | \`1\` |

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | No | The chain to query | \`solana\` |
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Response Example

Status: 200

Successful response

```json
{
  "timeseries": [
    {
      "timestamp": "2022-02-22T00:00:00Z",
      "buyVolume": 4565,
      "sellVolume": 4565,
      "liquidityUsd": 4565,
      "fullyDilutedValuation": 4565
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/volume/timeseries/1?chain=solana&timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getTimeSeriesVolume__solana.md
content: # Retrieve timeseries trading stats by chain

**Solana variant:** Fetch timeseries volume, liquidity and FDV for a specific blockchain.

This EVM endpoint supports Solana via the `chain=solana` parameter.

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/volume/timeseries`

## Query Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| chain | string (eth, 0x1, sepolia, 0xaa36a7, polygon, 0x89, bsc, 0x38, bsc testnet, 0x61, avalanche, 0xa86a, fantom, 0xfa, cronos, 0x19, arbitrum, 0xa4b1, chiliz, 0x15b38, chiliz testnet, 0x15b32, gnosis, 0x64, gnosis testnet, 0x27d8, base, 0x2105, base sepolia, 0x14a34, optimism, 0xa, polygon amoy, 0x13882, linea, 0xe708, moonbeam, 0x504, moonriver, 0x505, moonbase, 0x507, linea sepolia, 0xe705, flow, 0x2eb, flow-testnet, 0x221, ronin, 0x7e4, ronin-testnet, 0x31769, lisk, 0x46f, lisk-sepolia, 0x106a, pulse, 0x171, sei-testnet, 0x530, sei, 0x531, monad, 0x8f, solana) | No | The chain to query | \`solana\` |
| timeframe | string | Yes | The timeframe to query | \`1d\` |

## Response Example

Status: 200

Successful response

```json
{
  "timeseries": [
    {
      "timestamp": "2022-02-22T00:00:00Z",
      "volume": 4565,
      "liquidityUsd": 4565,
      "fullyDilutedValuation": 4565
    }
  ]
}
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/volume/timeseries?chain=solana&timeframe=1d" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getTokenBondingStatus__solana.md
content: # Get Token Bonding Status

Get the token bonding status for a given network and contract (if relevant).

## Method

GET

## Base URL

`https://solana-gateway.moralis.io`

## Path

`/token/:network/:address/bonding-status`

## Path Params

| Name | Type | Required | Description | Example |
|------|------|----------|-------------|----------|
| network | string (mainnet) | Yes | The network to query | - |
| address | string | Yes | The address to query | \`So11111111111111111111111111111111111111112\` |

## Response Example

Status: default

```json
{
  "mint": [REDACTED_SECRET],
  "bondingProgress": 50,
  "graduatedAt": "2024-11-28T09:44:55.000Z"
}
```

## Example (curl)

```bash
curl -X GET "https://solana-gateway.moralis.io/token/mainnet/So11111111111111111111111111111111111111112/bonding-status" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


path: rules/getTokenCategories.md
content: # Get ERC20 token categories

## Method

GET

## Base URL

`https://deep-index.moralis.io/api/v2.2`

## Path

`/tokens/categories`

## Response Example

Status: 200

Returns a list of ERC20 token categories, such as stablecoin, meme, governance, and more. Use this endpoint to explore available token categories for filtering or analytics.

```json
[
  {
    "categories": [
      {
        "name": "Stablecoin",
        "id": "stablecoin"
      }
    ]
  }
]
```

## Example (curl)

```bash
curl -X GET "https://deep-index.moralis.io/api/v2.2/tokens/categories" \
  -H "accept: application/json" \
  -H "X-[REDACTED_SECRET]"
```


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)