{
  "openapi": "3.0.1",
  "info": {
    "title": "DefiLlama Data Export – TVL, Stablecoins, DEX, Fees, Yields",
    "description": "Export DefiLlama DeFi data as flat tables: protocol & chain TVL, TVL history, stablecoin supply, DEX volumes, fees & revenue and yield pool APYs. Filter by chain, category, TVL. No API key. Pay per row.",
    "version": "1.0",
    "x-build-id": "dCLO5wRFd5XezZ6rB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fast_data_asap~defillama-defi-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fast_data_asap-defillama-defi-data",
        "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/fast_data_asap~defillama-defi-data/runs": {
      "post": {
        "operationId": "runs-sync-fast_data_asap-defillama-defi-data",
        "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/fast_data_asap~defillama-defi-data/run-sync": {
      "post": {
        "operationId": "run-sync-fast_data_asap-defillama-defi-data",
        "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": [
          "dataset"
        ],
        "properties": {
          "dataset": {
            "title": "Dataset",
            "enum": [
              "protocols",
              "chains_tvl",
              "protocol_history",
              "stablecoins",
              "stablecoin_chains",
              "dex_volumes",
              "fees_revenue",
              "yields"
            ],
            "type": "string",
            "description": "Which DefiLlama table to export.",
            "default": "protocols"
          },
          "topN": {
            "title": "Top N",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Return only the N largest entries (by TVL, supply or 24h volume/fees) after filtering. 0 = no limit (maxRows still applies).",
            "default": 20
          },
          "maxRows": {
            "title": "Max rows (cost cap)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on output rows. Every row is one billable event.",
            "default": 100
          },
          "chains": {
            "title": "Chains",
            "type": "array",
            "description": "Optional chain names, e.g. Ethereum, Solana, Arbitrum, Base (case-insensitive). Filters protocols, chains, stablecoins, DEXs, fees and yield pools to these chains.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Optional DefiLlama categories, e.g. Lending, Dexs, Liquid Staking, Bridge, CDP, Yield, Derivatives (case-insensitive). Applies to protocols, DEX volumes and fees.",
            "items": {
              "type": "string"
            }
          },
          "protocols": {
            "title": "Protocol slugs",
            "type": "array",
            "description": "DefiLlama protocol slugs, e.g. aave, lido, uniswap, curve-dex. Used by 'Protocol TVL history' (max 25; defaults to aave and lido). For other datasets it filters by slug / yield project name.",
            "items": {
              "type": "string"
            }
          },
          "stablecoinSymbols": {
            "title": "Stablecoin symbols",
            "type": "array",
            "description": "Optional stablecoin symbols, e.g. USDT, USDC, DAI, USDe. Applies to the stablecoins dataset and yield pools (symbol contains).",
            "items": {
              "type": "string"
            }
          },
          "minTvlUsd": {
            "title": "Minimum TVL / supply (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop entries below this TVL (protocols, chains, yield pools) or circulating supply (stablecoins). 0 = off.",
            "default": 0
          },
          "excludeCex": {
            "title": "Exclude centralized exchanges",
            "type": "boolean",
            "description": "DefiLlama also tracks CEX reserves in the protocols list. On by default so the protocols table is DeFi only.",
            "default": true
          },
          "days": {
            "title": "Days of history",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Protocol TVL history: how many most recent daily data points per protocol.",
            "default": 30
          },
          "includeChainBreakdown": {
            "title": "History per chain",
            "type": "boolean",
            "description": "Protocol TVL history: also output one row per chain and day (more rows).",
            "default": false
          },
          "stablecoinPoolsOnly": {
            "title": "Stablecoin pools only",
            "type": "boolean",
            "description": "Yield pools: keep only pools flagged as stablecoin pools.",
            "default": false
          },
          "minApy": {
            "title": "Minimum APY %",
            "minimum": 0,
            "type": "integer",
            "description": "Yield pools: drop pools below this total APY. 0 = off.",
            "default": 0
          },
          "yieldsSortBy": {
            "title": "Sort yield pools by",
            "enum": [
              "tvlUsd",
              "apy"
            ],
            "type": "string",
            "description": "Yield pools: ranking used for Top N.",
            "default": "tvlUsd"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}