{
  "openapi": "3.0.1",
  "info": {
    "title": "DefiLlama Scraper: TVL, Yields, Stables & DEXs",
    "description": "Scrape DefiLlama DeFi data: protocol TVL, a year of daily TVL history per protocol, chain TVL, stablecoin market caps, 16,990 live yield pools with APY and DEX volumes. Filter by name, chain or min TVL. Export CSV, Excel, JSON. No login or API key needed.",
    "version": "0.1",
    "x-build-id": "zokL82sX4shfjIF6t"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~defillama-tvl-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-defillama-tvl-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/recordsdata~defillama-tvl-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-defillama-tvl-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/recordsdata~defillama-tvl-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-defillama-tvl-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",
        "properties": {
          "includeProtocols": {
            "title": "Protocols (TVL)",
            "type": "boolean",
            "description": "DeFi protocols with TVL by chain, category, description, 1h/1d/7d change, market cap, mcap/TVL, forks, oracles, audits, listing date and links.",
            "default": true
          },
          "includeChains": {
            "title": "Blockchains (TVL per chain)",
            "type": "boolean",
            "description": "TVL per blockchain (467 chains).",
            "default": false
          },
          "includeStablecoins": {
            "title": "Stablecoins",
            "type": "boolean",
            "description": "Stablecoin market caps, peg type and mechanism, current price, 1d/7d/30d change and every chain they live on.",
            "default": false
          },
          "includeYields": {
            "title": "Yield pools (APY)",
            "type": "boolean",
            "description": "17,000+ pools with APY (base and reward), 1d/7d/30d APY change, 30-day mean, impermanent loss, exposure, predictions, reward and underlying tokens, volume.",
            "default": false
          },
          "includeDexVolumes": {
            "title": "DEX volumes",
            "type": "boolean",
            "description": "Per-DEX trading volume for 24h, 7d, 30d, 1y and all time, with 1d/7d/30d change.",
            "default": false
          },
          "includeFees": {
            "title": "Fees and revenue",
            "type": "boolean",
            "description": "Protocol fees and revenue for 24h, 7d, 30d, 1y and all time, with 1d/7d/30d change. Revenue is the part kept by the protocol.",
            "default": false
          },
          "searchTerms": {
            "title": "Name contains (optional)",
            "type": "array",
            "description": "Keep only DeFi records whose name, project or symbol contains one of these terms, for example aave, uniswap or usdc. Leave empty to get the top records by TVL.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "chainFilter": {
            "title": "Blockchain (optional)",
            "type": "string",
            "description": "Keep only protocols, yield pools, DEXs and fee records deployed on this blockchain, for example Ethereum, Solana or Arbitrum. Exact chain name, case-insensitive. Leave empty for all chains.",
            "default": ""
          },
          "categoryFilter": {
            "title": "Categories (optional)",
            "type": "array",
            "description": "Keep only protocols, DEXs and fee records in these DefiLlama categories, for example Lending, Dexs, Liquid Staking, Bridge, Derivatives, Yield. Exact category name, case-insensitive. If nothing matches, the log lists the known categories. Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minTvlUsd": {
            "title": "Minimum TVL (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip protocols, yield pools and stablecoins whose TVL or market cap in USD is below this value. 0 disables the filter.",
            "default": 0
          },
          "minApy": {
            "title": "Minimum APY (%), yield pools only",
            "type": "number",
            "description": "Yield pools only: skip pools whose total APY is below this percentage, for example 5 for 5% APY. Leave empty to disable."
          },
          "stablecoinPoolsOnly": {
            "title": "Stablecoin yield pools only",
            "type": "boolean",
            "description": "Yield pools only: keep only pools that DefiLlama flags as stablecoin pools (no price risk on the deposited asset).",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "tvl",
              "change1d",
              "change7d",
              "apy",
              "volume"
            ],
            "type": "string",
            "description": "Order applied to every surface before the item limits, so the best records come first. TVL / size is the default (market cap for stablecoins, 24h volume for DEXs, 24h fees for fee records). A surface without the chosen column keeps its default order: APY only sorts yield pools, 24h volume only yield pools and DEXs.",
            "default": "tvl"
          },
          "includeTvlHistory": {
            "title": "Daily TVL history per protocol (extra cost)",
            "type": "boolean",
            "description": "Daily TVL time series for the top matched protocols (up to 365 most recent points, in one row; first 20 protocols). Billed per protocol.",
            "default": false
          },
          "includeRaises": {
            "title": "Funding rounds per protocol (extra cost)",
            "type": "boolean",
            "description": "Venture funding rounds of the matched protocols: round, date, amount, valuation, lead and other investors, source. Reads the first 200 matched protocols; one row per round.",
            "default": false
          },
          "includeProtocolDetails": {
            "title": "Peak TVL, total raised and GitHub (no extra charge)",
            "type": "boolean",
            "description": "Adds each protocol peak TVL and date, total raised and GitHub organisations. Needs Protocols (TVL) on. Slower: one or two extra page reads per protocol, first 100 protocol rows only. No extra charge.",
            "default": false
          },
          "maxItems": {
            "title": "Max records for the whole run",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Total records for the run; also caps what you pay. Free plan: 10 records (preview). Paid: up to 1,000,000.",
            "default": 100
          },
          "maxItemsPerSurface": {
            "title": "Max records per data set",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap per data set (protocols, chains, stablecoins, yields, DEXs, fees, funding), so one huge set such as 17,000 yield pools cannot use the whole run.",
            "default": 100
          },
          "onlyNew": {
            "title": "Only records new since the last run",
            "type": "boolean",
            "description": "Skip records an earlier run with the same search already delivered, and do not charge for them. The memory is kept in a named store of your account. Use it with a schedule to get alerts on new rows only.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Name for the seen-records memory. Leave empty to derive it from your filters. Use the same name to share memory between runs, or a different name to keep separate monitors.",
            "default": ""
          },
          "resetSeen": {
            "title": "Start the monitor over",
            "type": "boolean",
            "description": "Clear the seen-records memory for this monitor before the run, so every matching record counts as new again.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}