{
  "openapi": "3.0.1",
  "info": {
    "title": "Crypto Wallet PnL API - Allium Token Prices and Balances",
    "description": "Crypto wallet and token data from the Allium Realtime APIs: wallet PnL with cost basis, token balances, decoded transactions and transfers, USD holdings history, DEX token prices, OHLC candles, price stats and token search on Ethereum, Solana, Base, Bitcoin and 17 more chains. Bring your own key.",
    "version": "0.1",
    "x-build-id": "GuPfAfAiDd7m6uXzY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~crypto-wallet-pnl-token-price-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-crypto-wallet-pnl-token-price-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~crypto-wallet-pnl-token-price-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-crypto-wallet-pnl-token-price-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~crypto-wallet-pnl-token-price-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-crypto-wallet-pnl-token-price-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "latestPrice",
              "priceHistory",
              "priceStats",
              "priceAtTimestamp",
              "listTokens",
              "searchTokens",
              "tokenDetails",
              "tokenTransfers",
              "walletTransactions",
              "walletBalances",
              "balanceHistory",
              "holdingsHistory",
              "walletPnl",
              "walletTokenPnl"
            ],
            "type": "string",
            "description": "Token modes read the Tokens field; wallet modes read the Wallets field; wallet PnL by token reads the Wallet and token pairs field. Top tokens and token search need neither. Prices come from on-chain DEX trades; PnL uses the average cost basis method.",
            "default": "latestPrice"
          },
          "tokens": {
            "title": "Tokens",
            "type": "array",
            "description": "Token modes. One token per line as chain:address (contract address, Solana mint, or the zero address 0x0000000000000000000000000000000000000000 for a native EVM token), or an address alone on the default chain. Sent 200 to a request; up to 1000 per run.",
            "items": {
              "type": "string"
            }
          },
          "wallets": {
            "title": "Wallets",
            "type": "array",
            "description": "Wallet modes. One wallet per line as chain:address, or an address alone on the default chain. The same address on two chains is two lines. Up to 1000 per run.",
            "items": {
              "type": "string"
            }
          },
          "walletTokens": {
            "title": "Wallet and token pairs",
            "type": "array",
            "description": "Wallet PnL by token mode. One pair per line as chain:wallet:token, or wallet:token on the default chain.",
            "items": {
              "type": "string"
            }
          },
          "chain": {
            "title": "Default chain",
            "enum": [
              "ethereum",
              "solana",
              "base",
              "arbitrum",
              "optimism",
              "polygon",
              "bsc",
              "avalanche",
              "bitcoin",
              "unichain",
              "zksync",
              "celo",
              "hyperevm",
              "monad",
              "robinhood",
              "x_layer",
              "xdc_network",
              "arc",
              "near",
              "stellar",
              "dogecoin"
            ],
            "type": "string",
            "description": "The chain for lines that do not name one, and the chain top tokens and token search are limited to. Endpoint coverage differs by chain: prices cover 13 chains, balances and transactions 19, PnL 16 (see the README).",
            "default": "ethereum"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Token search mode. A case-insensitive substring of the token name or symbol, such as usdc or pepe."
          },
          "allChains": {
            "title": "Search all chains",
            "type": "boolean",
            "description": "Top tokens and token search. Ignore the default chain and rank or search tokens across every chain.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume",
              "trade_count",
              "fully_diluted_valuation"
            ],
            "type": "string",
            "description": "Top tokens and token search. The field tokens are ranked by.",
            "default": "volume"
          },
          "sortGranularity": {
            "title": "Sort window",
            "enum": [
              "1d",
              "1h"
            ],
            "type": "string",
            "description": "Top tokens and token search. The window volume or trade count is measured over.",
            "default": "1d"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Top tokens and token search.",
            "default": "desc"
          },
          "minVolumeUsd1d": {
            "title": "Minimum 24h volume (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Top tokens and token search. Only tokens with at least this much USD volume over the last day."
          },
          "minVolumeUsd1h": {
            "title": "Minimum 1h volume (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Top tokens and token search. Only tokens with at least this much USD volume over the last hour."
          },
          "startTime": {
            "title": "Start time",
            "type": "string",
            "description": "Price history, historical balances, holdings history and transfers. An ISO 8601 time (2026-01-01T00:00:00Z), a date (2026-01-01), or a lookback such as 24h or 30d. Empty means 7 days before the end time (no lower bound for transfers)."
          },
          "endTime": {
            "title": "End time",
            "type": "string",
            "description": "Same forms as the start time. Empty means now (no upper bound for transfers)."
          },
          "timeGranularity": {
            "title": "Time granularity",
            "enum": [
              "15s",
              "1m",
              "5m",
              "1h",
              "1d"
            ],
            "type": "string",
            "description": "Price history, price at timestamp and holdings history. Holdings history allows 15s for ranges up to 24 hours (last 7 days only), 5m up to 7 days, 1h up to a year and 1d beyond.",
            "default": "1h"
          },
          "atTimestamp": {
            "title": "Price timestamp",
            "type": "string",
            "description": "Price at timestamp mode. The moment to price the tokens at, in the same forms as the start time. Allium returns the closest earlier price."
          },
          "stalenessTolerance": {
            "title": "Staleness tolerance",
            "type": "string",
            "description": "Price at timestamp mode. The furthest back Allium may look for a price, such as 30m, 1h or 1d. Empty uses the provider default."
          },
          "withLiquidityInfo": {
            "title": "Include liquidity",
            "type": "boolean",
            "description": "Latest token price and latest wallet balances. Adds total DEX liquidity in USD per token (or LIQUIDITY_TOO_HIGH for majors such as WETH), useful to filter spam tokens.",
            "default": false
          },
          "minLiquidityUsd": {
            "title": "Minimum token liquidity (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Wallet PnL and holdings history. Leave out tokens with less DEX liquidity than this, which drops spam and dust tokens from the totals."
          },
          "includeTokenBreakdown": {
            "title": "Per-token breakdown",
            "type": "boolean",
            "description": "Holdings history. Adds the USD value of each token held at every interval.",
            "default": false
          },
          "activityType": {
            "title": "Activity type",
            "enum": [
              "dex_trade",
              "nft_trade",
              "asset_approval",
              "asset_bridge",
              "dex_liquidity_pool_mint",
              "dex_liquidity_pool_burn",
              "dex_liquidity_pool_created"
            ],
            "type": "string",
            "description": "Wallet transactions. Only transactions with this decoded activity. Empty returns every transaction."
          },
          "transactionHash": {
            "title": "Transaction hash",
            "type": "string",
            "description": "Wallet transactions. Return only this one transaction (hash or Solana signature)."
          },
          "transferType": {
            "title": "Transfer direction",
            "enum": [
              "any",
              "sent",
              "received"
            ],
            "type": "string",
            "description": "Wallet token transfers.",
            "default": "any"
          },
          "transferToken": {
            "title": "Transfer token",
            "type": "string",
            "description": "Wallet token transfers. Only transfers of this token contract or mint address."
          },
          "sortDirection": {
            "title": "Transfer order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Wallet token transfers.",
            "default": "desc"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most rows this run returns and charges for. Paged requests ask Allium only for the rows still left.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Pacing. Allium answers 429 above your plan limit, which the actor waits out and retries.",
            "default": 60
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own Allium API key, from Settings > API Keys in the Allium app (app.allium.so). Stored as a secret and sent only in the X-API-KEY header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}