{
  "openapi": "3.0.1",
  "info": {
    "title": "DefiLlama Protocol, Chain & Yield Data Extractor",
    "description": "Pull DeFi protocol TVL history, chain rankings, stablecoin supply, yield-pool APY, DEX and lending volume, fees, bridge flow, and token prices from DefiLlama's open datasets.",
    "version": "1.0",
    "x-build-id": "gSwiMv6IAfamCsQ2k"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vexaloom-labs~defillama-protocol-chain-and-yield-data-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vexaloom-labs-defillama-protocol-chain-and-yield-data-extractor",
        "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/vexaloom-labs~defillama-protocol-chain-and-yield-data-extractor/runs": {
      "post": {
        "operationId": "runs-sync-vexaloom-labs-defillama-protocol-chain-and-yield-data-extractor",
        "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/vexaloom-labs~defillama-protocol-chain-and-yield-data-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-vexaloom-labs-defillama-protocol-chain-and-yield-data-extractor",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "protocols",
              "byProtocol",
              "tvl",
              "historicalChainTvl",
              "stablecoins",
              "stablecoinChains",
              "stablecoinPrices",
              "yields",
              "yieldsByPool",
              "dexVolumes",
              "dexByProtocol",
              "lendingMarkets",
              "lendingByProtocol",
              "fees",
              "bridges",
              "bridgeByName",
              "currentPrices",
              "byUrl"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "protocols"
          },
          "protocolSlug": {
            "title": "Protocol slug (mode=byProtocol / dexByProtocol / lendingByProtocol)",
            "type": "string",
            "description": "DefiLlama protocol slug — visible in the URL on defillama.com (e.g. `aave`, `lido`, `uniswap`, `curve-dex`). Example: `aave`."
          },
          "chain": {
            "title": "Chain (mode=historicalChainTvl, optional filter)",
            "enum": [
              "",
              "Ethereum",
              "Tron",
              "Solana",
              "BSC",
              "Bitcoin",
              "Base",
              "Arbitrum",
              "Polygon",
              "Avalanche",
              "Sui",
              "Hyperliquid",
              "Optimism",
              "Sei",
              "Aptos",
              "Mantle",
              "Sonic",
              "Cronos",
              "Linea",
              "Cardano",
              "Mixin",
              "Hedera",
              "Manta",
              "Blast",
              "Scroll",
              "Algorand",
              "Polygon zkEVM",
              "Fantom",
              "Gnosis",
              "Celo",
              "zkSync Era",
              "Stellar"
            ],
            "type": "string",
            "description": "Chain name as DefiLlama uses it. Required for `historicalChainTvl`; also filters protocols, chains, stablecoins, yields, DEX, lending, fees, and bridges by chain where the source exposes it. Use the dropdown for top chains, OR paste an exact chain name from the chains list (case-sensitive — DefiLlama uses `Ethereum`, `BSC`, etc.).",
            "default": ""
          },
          "category": {
            "title": "Category filter (protocols / DEX / lending / fees)",
            "enum": [
              "",
              "Lending",
              "Dexes",
              "Liquid Staking",
              "Yield Aggregator",
              "Bridge",
              "CDP",
              "Yield",
              "Derivatives",
              "Cross Chain",
              "Restaking",
              "Liquid Restaking",
              "RWA",
              "Stablecoin Issuer",
              "Insurance",
              "Synthetics",
              "Options",
              "Indexes",
              "NFT Marketplace",
              "NFT Lending",
              "Launchpad",
              "Prediction Market",
              "Privacy",
              "Algo-Stables",
              "Services"
            ],
            "type": "string",
            "description": "Filter records by DefiLlama category (e.g. `Lending`, `Dexes`, `Liquid Staking`, `Yield Aggregator`, `Bridge`, `CDP`, `Yield`, `Derivatives`, `Cross Chain`).",
            "default": ""
          },
          "minTvlUsd": {
            "title": "Minimum TVL in USD (protocols / chains / yields / lending)",
            "minimum": 0,
            "maximum": 1000000000000,
            "type": "integer",
            "description": "Drop records with TVL below this threshold (USD)."
          },
          "searchQuery": {
            "title": "Name search (any list mode)",
            "type": "string",
            "description": "Case-insensitive text match on name, symbol, or project — e.g. `aave`, `uniswap`, `USDC`."
          },
          "minApy": {
            "title": "Minimum APY % (mode=yields)",
            "minimum": -100000,
            "maximum": 1000000,
            "type": "number",
            "description": "Drop yield pools whose total APY is below this percentage. Applies to `mode=yields` only."
          },
          "yieldStablecoinOnly": {
            "title": "Stablecoin pools only (mode=yields)",
            "type": "boolean",
            "description": "Keep only yield pools where DefiLlama marks the underlying asset as a stablecoin.",
            "default": false
          },
          "yieldProject": {
            "title": "Yield project filter (mode=yields)",
            "type": "string",
            "description": "Only keep yield pools from projects whose slug contains this text, e.g. `aave`, `lido`, `curve`."
          },
          "stablecoinId": {
            "title": "Stablecoin ID (mode=stablecoinPrices)",
            "minimum": 1,
            "maximum": 999,
            "type": "integer",
            "description": "DefiLlama stablecoin ID (e.g. `1` = USDT, `2` = USDC). See `mode=stablecoins` to enumerate."
          },
          "poolId": {
            "title": "Pool ID (mode=yieldsByPool)",
            "type": "string",
            "description": "DefiLlama yield pool UUID (visible in the pool URL on yields.llama.fi)."
          },
          "bridgeName": {
            "title": "Bridge name (mode=bridgeByName)",
            "type": "string",
            "description": "Bridge identifier from the bridges list."
          },
          "tokenIds": {
            "title": "Token IDs (mode=currentPrices)",
            "type": "array",
            "description": "List of token IDs in DefiLlama format: `coingecko:bitcoin`, `ethereum:0x...`, `bsc:0x...`. Up to 100 per call.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "stablecoinIncludePrices": {
            "title": "Include current prices (mode=stablecoins)",
            "type": "boolean",
            "description": "When true, the stablecoins endpoint includes current price data per asset.",
            "default": true
          },
          "url": {
            "title": "URL (mode=byUrl)",
            "type": "string",
            "description": "Any defillama.com URL — auto-detected. Examples: defillama.com/protocol/aave , defillama.com/chain/Ethereum , stablecoins.llama.fi (homepage → top stablecoins)."
          },
          "maxItems": {
            "title": "Max items (page size)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on records emitted in this run. Combine with `offset` to page through a long result set. Example: `100`.",
            "default": 100
          },
          "offset": {
            "title": "Pagination offset",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Skip this many records after filtering and sorting, then emit up to `maxItems`. Page 2 with `maxItems=100` means `offset=100`.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "",
              "tvlUsd",
              "apy",
              "apyBase",
              "apyReward",
              "change1d",
              "change7d",
              "volume24hUsd",
              "fees24hUsd",
              "circulating",
              "priceUsd",
              "marketCapUsd",
              "date",
              "timestamp",
              "name"
            ],
            "type": "string",
            "description": "Sort matching records before applying `offset` and `maxItems`. Leave empty to keep the source order.",
            "default": ""
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Direction used when `sortBy` is set. Records with a missing sort value are placed last.",
            "default": "desc"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}