{
  "openapi": "3.0.1",
  "info": {
    "title": "DefiLlama Scraper — Protocol TVL, Chains, Yields & Stablecoins",
    "description": "DeFi data from DefiLlama for AI agents: protocol TVL rankings with growth filters, protocol detail, chain TVL, yield pools with risk filters, stablecoin supply and depegs, fees/revenue, DEX volumes, TVL history and exploits. No API key.",
    "version": "0.1",
    "x-build-id": "2OsUNPxaF5xPFUAbf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~defillama-protocols/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-defillama-protocols",
        "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/yadroo~defillama-protocols/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-defillama-protocols",
        "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/yadroo~defillama-protocols/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-defillama-protocols",
        "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": "Mode",
            "enum": [
              "protocols",
              "protocol",
              "chains",
              "yields",
              "stablecoins",
              "fees",
              "volumes",
              "protocolHistory",
              "chainHistory",
              "yieldHistory",
              "stablecoinHistory",
              "hacks"
            ],
            "type": "string",
            "description": "Which dataset to fetch. Each mode has its own row shape (see README → Output).",
            "default": "protocols"
          },
          "limit": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum rows this run saves, across all chains, slugs and series of the mode (after filtering and sorting). Billing is per row. The status message says when the limit cut matching rows.",
            "default": 100
          },
          "fields": {
            "title": "Output fields (optional)",
            "type": "array",
            "description": "Keep only these columns, in this order, e.g. [\"slug\",\"tvl\",\"change7d\"]; `id` is always kept (first unless you place it). Letter case and -/_ are forgiven; a name that is not a column of the mode is left out with a \"did you mean\" note, and the run stops before any request when no name is a column. Empty = all columns (README → Output).",
            "items": {
              "type": "string"
            }
          },
          "chain": {
            "title": "Chain",
            "type": "string",
            "description": "Single chain filter, e.g. Ethereum, Base, Solana, Arbitrum, BSC. Legacy field — same as putting one item in `chains`."
          },
          "chains": {
            "title": "Chains (multiple)",
            "type": "array",
            "description": "Several chains at once. protocols: one row per (protocol, chain) with that chain's TVL; fees/volumes: one row per (protocol, chain) with that chain's totals; chains: only these chains (minTvl is not applied to them unless you set it); yields/stablecoins/hacks: items on any of them; history modes: one series per chain. See README → Reference for chain names.",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "title": "Category / project",
            "type": "string",
            "description": "protocols, fees, volumes: DefiLlama category, e.g. Dexs, Lending, Liquid Staking, Derivatives, Yield, Bridge, RWA, CDP (full list in README; aliases like dex, perps, lst, lrt, rwas work). yields: a project slug like aave-v3, uniswap-v3, lido. Legacy field — same as one item in `categories` / `projects`. Unknown names stop the run with a \"did you mean\" list."
          },
          "categories": {
            "title": "Categories (multiple)",
            "type": "array",
            "description": "Several DefiLlama categories (protocols / fees / volumes modes). Unknown names stop the run with a \"did you mean\" list.",
            "items": {
              "type": "string"
            }
          },
          "excludeCategories": {
            "title": "Exclude categories",
            "type": "array",
            "description": "Drop these categories from protocols mode. DefiLlama lists CEX reserves and L1 chains as \"protocols\"; exclude them to get pure DeFi rankings. Unknown names stop the run with a \"did you mean\" list.",
            "items": {
              "type": "string"
            }
          },
          "slugs": {
            "title": "Protocol slugs",
            "type": "array",
            "description": "Protocol slugs (from defillama.com/protocol/<slug>), e.g. aave, uniswap, lido, aerodrome-v2. Required for protocol and protocolHistory; optional whitelist in protocols / fees / volumes, where a parent slug (aave, uniswap) matches its versions. minTvl is not applied to named slugs unless you set it. Slugs DefiLlama does not know are named in the status message, never billed.",
            "items": {
              "type": "string"
            }
          },
          "search": {
            "title": "Search text",
            "type": "string",
            "description": "Case-insensitive substring match on name / symbol (protocols, chains, yields, stablecoins, fees, volumes, hacks)."
          },
          "minTvl": {
            "title": "Min TVL / supply (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum TVL (USD) for protocols/chains/yields, minimum circulating supply for stablecoins. Empty = $1,000,000 for rankings (keeps dust out), but 0 for slugs or chains you name and when maxTvl is below $1M. Set 0 to see everything. Not used by fees/volumes (see minTotal24h)."
          },
          "maxTvl": {
            "title": "Max TVL (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "protocols: drop protocols above this TVL — handy for finding small/emerging projects."
          },
          "minChange7d": {
            "title": "Min 7d TVL change (%)",
            "type": "number",
            "description": "protocols: keep only protocols whose TVL grew at least this % over 7 days (e.g. 20 = fastest growers; decimals allowed). Negative values find decliners with maxChange7d."
          },
          "maxChange7d": {
            "title": "Max 7d TVL change (%)",
            "type": "number",
            "description": "protocols: keep only protocols whose 7d change is at most this % (e.g. -30 = TVL outflow alerts)."
          },
          "minChange1d": {
            "title": "Min 1d TVL change (%)",
            "type": "number",
            "description": "protocols: lower bound on 24h TVL change in %."
          },
          "maxChange1d": {
            "title": "Max 1d TVL change (%)",
            "type": "number",
            "description": "protocols: upper bound on 24h TVL change in %."
          },
          "listedAfter": {
            "title": "Listed after",
            "type": "string",
            "description": "protocols: only protocols listed on DefiLlama on/after this date (YYYY-MM-DD). Great for \"new protocols this month\" lead lists."
          },
          "listedBefore": {
            "title": "Listed before",
            "type": "string",
            "description": "protocols: only protocols listed on/before this date."
          },
          "auditedOnly": {
            "title": "Audited only",
            "type": "boolean",
            "description": "protocols: keep only protocols with at least one audit recorded on DefiLlama.",
            "default": false
          },
          "includeChainTvls": {
            "title": "Include per-chain TVL map",
            "type": "boolean",
            "description": "protocols: add `chainTvls` object {chain: tvlUsd} to each row.",
            "default": false
          },
          "chainDetails": {
            "title": "Chain TVL changes & protocol count",
            "type": "boolean",
            "description": "chains: add `change1d`, `change7d`, `change1m` (TVL change %, vs the live TVL), `tvlPrevDay`/`tvlPrevWeek`/`tvlPrevMonth` and `protocolCount` to each returned chain. Costs one small request per returned chain plus the protocol list (≈5–30 s for 30–100 chains). Off = TVL only, instant.",
            "default": true
          },
          "projects": {
            "title": "Projects",
            "type": "array",
            "description": "Yield project slugs, e.g. aave-v3, compound-v3, lido, pendle, morpho-v1, uniswap-v3, aerodrome-slipstream. ~500 projects; see defillama.com/yields. An unknown slug stops the run with a \"did you mean\" list (it used to be dropped, which returned every project).",
            "items": {
              "type": "string"
            }
          },
          "symbols": {
            "title": "Symbols",
            "type": "array",
            "description": "Match pools whose symbol contains one of these tokens, e.g. [\"USDC\",\"USDT\"] matches USDC, USDC-WETH, USDT-USDC.",
            "items": {
              "type": "string"
            }
          },
          "minApy": {
            "title": "Min APY (%)",
            "type": "number",
            "description": "Lower bound on total APY, in percent (decimals allowed, e.g. 4.5)."
          },
          "maxApy": {
            "title": "Max APY (%)",
            "type": "number",
            "description": "Upper bound on total APY, in percent — cut off unsustainable farm APYs (e.g. 50)."
          },
          "minApyMean30d": {
            "title": "Min 30-day mean APY (%)",
            "type": "number",
            "description": "Lower bound on the 30-day average APY, in percent — filters flash-in-the-pan yields."
          },
          "stablecoinOnly": {
            "title": "Stablecoin pools only",
            "type": "boolean",
            "description": "Only pools DefiLlama flags as stablecoin pools.",
            "default": false
          },
          "singleExposureOnly": {
            "title": "Single-asset only",
            "type": "boolean",
            "description": "Only single-token pools (no LP pairs).",
            "default": false
          },
          "noIlOnly": {
            "title": "No impermanent-loss only",
            "type": "boolean",
            "description": "Only pools with ilRisk = no.",
            "default": false
          },
          "excludeOutliers": {
            "title": "Exclude outliers",
            "type": "boolean",
            "description": "Drop pools DefiLlama marks as statistical outliers (usually broken or manipulated APYs).",
            "default": true
          },
          "poolIds": {
            "title": "Pool ids (yieldHistory)",
            "type": "array",
            "description": "Pool UUIDs from yields mode (field `pool`), e.g. 747c1d2a-c668-4682-b9f9-296708a3dd90 (Lido stETH).",
            "items": {
              "type": "string"
            }
          },
          "pegTypes": {
            "title": "Peg types",
            "type": "array",
            "description": "e.g. [\"peggedUSD\"], [\"peggedEUR\"] — or just the currency: [\"USD\"], [\"EUR\"]. All values: peggedUSD, peggedEUR, peggedGBP, peggedJPY, peggedCNY, peggedCHF, peggedCAD, peggedAUD, peggedSGD, peggedHKD, peggedKRW, peggedTRY, peggedRUB, peggedUAH, peggedARS, peggedREAL, peggedMXN, peggedCOP, peggedCLP, peggedPEN, peggedPHP, peggedMYR, peggedKES, peggedZAR, peggedNGN, peggedXOF, peggedGHS, peggedVAR. stablecoinHistory uses the first one (default peggedUSD). Unknown values stop the run.",
            "items": {
              "type": "string"
            }
          },
          "pegMechanisms": {
            "title": "Peg mechanisms",
            "type": "array",
            "description": "Any of fiat-backed, crypto-backed, algorithmic (fiat / crypto / algo work too). Unknown values stop the run.",
            "items": {
              "type": "string"
            }
          },
          "minPegDeviationPct": {
            "title": "Min |peg deviation| (%)",
            "type": "string",
            "description": "Depeg alert: keep USD stablecoins whose price is at least this % away from $1.00 (e.g. 0.5). Text field: decimals with a dot or a comma; anything that is not a number stops the run."
          },
          "maxPegDeviationPct": {
            "title": "Max |peg deviation| (%)",
            "type": "string",
            "description": "Keep only stablecoins within this % of peg (e.g. 0.2 = healthy pegs only). Text field like minPegDeviationPct."
          },
          "includeChainBreakdown": {
            "title": "Include per-chain supply map",
            "type": "boolean",
            "description": "stablecoins: add `chainCirculating` {chain: amount}.",
            "default": false
          },
          "feeMetric": {
            "title": "Fee metric",
            "enum": [
              "dailyFees",
              "dailyRevenue"
            ],
            "type": "string",
            "description": "fees mode: which metric to rank protocols by.",
            "default": "dailyFees"
          },
          "volumeType": {
            "title": "Volume type",
            "enum": [
              "dexs",
              "aggregators",
              "options",
              "aggregator-derivatives",
              "bridge-aggregators",
              "open-interest"
            ],
            "type": "string",
            "description": "volumes mode: which dimension to fetch. (Plain perp DEX volume is paid-only on DefiLlama and not available.)",
            "default": "dexs"
          },
          "includeBreakdown": {
            "title": "Include 24h chain breakdown",
            "type": "boolean",
            "description": "fees/volumes: add `breakdown24h` {chain: usd}.",
            "default": false
          },
          "minTotal24h": {
            "title": "Min 24h total (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "fees/volumes: keep protocols whose last-24h fees (or volume) is at least this many USD, e.g. 10000. Empty = no threshold (minTvl is not used in these modes)."
          },
          "from": {
            "title": "From date",
            "type": "string",
            "description": "Start date YYYY-MM-DD (inclusive)."
          },
          "to": {
            "title": "To date",
            "type": "string",
            "description": "End date YYYY-MM-DD (inclusive)."
          },
          "days": {
            "title": "Last N days",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Alternative to from/to: last N days (history modes default to 90; hacks default to all time)."
          },
          "aggregate": {
            "title": "Aggregate",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ],
            "type": "string",
            "description": "History modes: bucket the daily series to cut row count (and cost).",
            "default": "daily"
          },
          "minAmountUsd": {
            "title": "Min hack amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "hacks: only exploits with losses at or above this amount."
          },
          "sortBy": {
            "title": "Sort by",
            "type": "string",
            "description": "protocols: tvl, change1d, change7d, change1m, mcap, mcapTvl, listedAt, name. yields: tvl, apy, apyBase, apyReward, apyMean30d, apyPct7d, volumeUsd1d. stablecoins: circulating, change1d, change7d, change30d, pegDeviationPct, chainCount, name. fees/volumes: total24h, total7d, total30d, total1y, change1d, change7d, change1m, name. chains: tvl, chain. hacks: date, amountUsd, name. Empty = the first one of the mode. Letter case is forgiven; a key the mode cannot sort by stops the run with the list."
          },
          "sortDir": {
            "title": "Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction for sortBy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}