{
  "openapi": "3.0.1",
  "info": {
    "title": "DefiLlama Scraper",
    "description": "Pull DeFi data from DefiLlama's public APIs with protocols + historical TVL, chain TVL aggregates, stablecoins, yield pools, DEX volumes, lending markets, bridge volumes. No auth, no proxy, no cookies.",
    "version": "1.0",
    "x-build-id": "pkzL6QvfO708Pn4YN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~defillama-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-defillama-scraper",
        "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/crawlerbros~defillama-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-defillama-scraper",
        "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/crawlerbros~defillama-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-defillama-scraper",
        "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. 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 (mode=protocols)",
            "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 protocols by DefiLlama category (e.g. `Lending`, `Dexes`, `Liquid Staking`, `Yield Aggregator`, `Bridge`, `CDP`, `Yield`, `Derivatives`, `Cross Chain`).",
            "default": ""
          },
          "minTvlUsd": {
            "title": "Minimum TVL in USD (mode=protocols / yields)",
            "minimum": 0,
            "maximum": 1000000000000,
            "type": "integer",
            "description": "Drop records with TVL below this threshold (USD)."
          },
          "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",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on emitted records. Example: `100`.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}