{
  "openapi": "3.0.1",
  "info": {
    "title": "DefiLlama Scraper",
    "description": "[💰 $40.25 / 1K] Extract DeFi market data from DefiLlama — 7,900+ protocols with TVL, 450+ chains, 16,000+ yield pools with APY, 400+ stablecoins, plus DEX volumes, fees and revenue. Filter by chain, category, TVL or APY, with optional daily history.",
    "version": "1.0",
    "x-build-id": "npeYOPTRAKBjqMDM3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/solidcode~defillama-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-solidcode-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/solidcode~defillama-scraper/runs": {
      "post": {
        "operationId": "runs-sync-solidcode-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/solidcode~defillama-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-solidcode-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",
        "properties": {
          "dataTypes": {
            "title": "Datasets to collect",
            "type": "array",
            "description": "Pick one or more DefiLlama datasets. Each one is collected separately and the results are merged into a single table, with every row tagged by its type so you can filter or split them afterwards.",
            "items": {
              "type": "string",
              "enum": [
                "protocols",
                "chains",
                "yields",
                "stablecoins",
                "dexVolumes",
                "fees",
                "revenue",
                "optionsVolumes",
                "dexAggregators"
              ],
              "enumTitles": [
                "Protocols & TVL (7,900+ DeFi protocols)",
                "Blockchains & TVL (450+ chains)",
                "Yield pools & APY (16,000+ pools)",
                "Stablecoins (400+ coins, supply & peg)",
                "DEX trading volumes (1,200+ exchanges)",
                "Protocol fees (2,400+ protocols)",
                "Protocol revenue (2,100+ protocols)",
                "Options trading volumes",
                "DEX aggregator volumes"
              ]
            }
          },
          "searchTerm": {
            "title": "Search by name",
            "type": "string",
            "description": "Keep only entries whose name, ticker symbol or project matches this text. Not case sensitive, and partial words work — 'aave' matches 'Aave V3'. Leave empty to keep everything."
          },
          "chains": {
            "title": "Blockchains",
            "type": "array",
            "description": "Keep only entries on these blockchains, for example Ethereum, Base, Solana, Arbitrum, BSC, Polygon. Capitalisation does not matter, and common alternative names are understood — BSC also matches Binance, Gnosis also matches xDai, and Optimism also matches OP Mainnet. Leave empty to include every chain. Applies to protocols, yield pools, stablecoins, volumes, fees and revenue — and picks out those chains themselves in the Blockchains dataset.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Keep only entries in these DefiLlama categories, for example Lending, Dexs, Liquid Staking, Restaking, CDP, Bridge, RWA, Yield, Derivatives. DefiLlama uses 101 categories in total. Leave empty to include every category. Applies to protocols, DEX volumes, fees, revenue, options and aggregators. Blockchains, stablecoins and yield pools have no category attached to them, so this filter is skipped for those three datasets and they come back unfiltered.",
            "items": {
              "type": "string"
            }
          },
          "minTvlUsd": {
            "title": "Minimum value locked (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include entries holding at least this much value, in US dollars. A good way to cut out dead or tiny projects — try 1000000 for $1M. Applies to protocol value locked, blockchain value locked, yield pool size and stablecoin circulating supply (converted to US dollars for coins pegged to other currencies, using DefiLlama's price; a coin pegged to another currency with no published price has no dollar figure to test, so it is left out when you set a minimum). DEX volume, fee, revenue, options and aggregator datasets measure turnover rather than a balance, so they have no value-locked figure and this filter is skipped for them — those datasets come back unfiltered. Leave empty for no minimum."
          },
          "minApy": {
            "title": "Minimum APY (%)",
            "minimum": 0,
            "type": "number",
            "description": "Only include yield pools paying at least this annual percentage yield — enter 5 for 5%. Applies to the Yield pools dataset only; other datasets are unaffected. Leave empty for no minimum."
          },
          "sortBy": {
            "title": "Rank results by",
            "enum": [
              "default",
              "tvl",
              "apy",
              "volume24h",
              "fees24h",
              "change24h",
              "change7d",
              "name"
            ],
            "type": "string",
            "description": "How results are ranked before the per-dataset limit below is applied — this is what decides which entries make it into your 'top N'. 'Headline metric' uses value locked for protocols, blockchains, yield pools and stablecoins, and 24-hour totals for volume, fee and revenue datasets. If a dataset does not have the metric you pick, it falls back to its headline metric — blockchains, for example, only carry value locked, so every other choice ranks them by that. Entries that are missing the metric you chose are ranked last rather than mixed in. Yield pools have no single name, so A to Z sorts them by project and pool symbol."
          },
          "maxResultsPerDataset": {
            "title": "Maximum results per dataset",
            "minimum": 0,
            "type": "integer",
            "description": "The most entries to return from each dataset you selected. Picking two datasets with a limit of 250 gives you up to 500 entries. Set to 0 for no limit — be aware the full yield pool list alone is over 16,000 entries. This limit counts entries only. The two optional add-ons below — the blockchain breakdown and the daily history — add extra rows on top of it rather than taking room away from it, and every extra row is charged. Before it collects them, the run tells you exactly how many extra rows each add-on will produce."
          },
          "includeHistory": {
            "title": "Include daily history",
            "type": "boolean",
            "description": "Add daily historical rows for everything you collect: value-locked history for protocols and blockchains, and APY plus value-locked history for yield pools. Each entry gets its own set of dated rows. Not available for stablecoins, volumes, fees, revenue, options or aggregators. These dated rows are extras added on top of 'Maximum results per dataset' — you still get the full number of entries you asked for — and every one of them is charged, as a daily history row rather than as a result, which is much cheaper. There can be a great many of them: the total is roughly your entry count multiplied by the days setting below, the run announces the exact worst case before it starts collecting them, and the run's own maximum cost setting is what caps the spend. History for yield pools is served slowly by DefiLlama (a few seconds per pool), so the history stage stops after 30 minutes and finishes with whatever it has — every main result is already saved by then, and the run reports if history came back incomplete."
          },
          "historyDays": {
            "title": "Days of history",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "How many of the most recent days of history to include for each entry, when history is turned on. Together with your entry limit this is what decides how many extra rows you get, and every extra row is charged as a daily history row. DefiLlama holds up to about 3,200 days, going back to 2017. Please keep this modest: 250 protocols with 365 days each produces over 91,000 extra rows on top of the 250 protocol rows. At the default of 90 days, the same 250 protocols add about 22,500 rows."
          },
          "includeChainBreakdown": {
            "title": "Break protocol TVL down by blockchain",
            "type": "boolean",
            "description": "For protocols, add one extra row for every blockchain the protocol runs on, showing how much of its value sits on that chain and what share of the total it represents. These rows are extras added on top of 'Maximum results per dataset' — you still get the full number of protocols you asked for — and each one is charged as a result, so turning this on adds to your bill rather than replacing protocols. Most protocols run on a single chain, so this usually adds few rows, but the largest multi-chain protocols run on over 100. The run announces the exact number of extra rows before it collects them. If you filled in the Blockchains filter above, only those blockchains get a breakdown row, which keeps the extra count down. Each protocol is listed first and its breakdown follows it, largest chain first."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}