{
  "openapi": "3.0.1",
  "info": {
    "title": "DeFiLlama Scraper - DeFi TVL, Yields, Fees & Protocols",
    "description": "Scrape DeFiLlama DeFi analytics: protocol TVL rankings & full profiles (per-chain TVL, funding rounds, GitHub/Twitter/website), yield-farming pools & APY, chain TVL, stablecoins, DEX volume and protocol fees & revenue. Monitoring mode for new launches. Export JSON, CSV, Excel.",
    "version": "0.1",
    "x-build-id": "D5vUcTrJLn8Y0VooV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~defillama-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~defillama-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~defillama-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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 — what to scrape",
            "enum": [
              "protocols",
              "protocolDetail",
              "yields",
              "chains",
              "stablecoins",
              "dexs",
              "fees"
            ],
            "type": "string",
            "description": "protocols = DeFi protocols ranked by TVL (+ optional full profile). protocolDetail = deep dive on specific protocols. yields = yield-farming pools & APY. chains = TVL per blockchain. stablecoins = stablecoin supply. dexs = DEX trading volume. fees = protocol fees & revenue.",
            "default": "protocols"
          },
          "searchQueries": {
            "title": "Search queries (protocol names)",
            "type": "array",
            "description": "Protocol names or symbols to match (e.g. \"Aave\", \"Uniswap\", \"Lido\"). Used by the protocols / protocolDetail / dexs / fees modes to filter to specific protocols. Matched against protocol name, slug and symbol.",
            "items": {
              "type": "string"
            }
          },
          "protocolSlugs": {
            "title": "Protocol slugs",
            "type": "array",
            "description": "Exact DeFiLlama protocol slugs for protocolDetail mode, e.g. \"aave-v3\", \"uniswap-v3\", \"lido\". Find a slug in the protocol page URL: defillama.com/protocol/<slug>. Faster and more precise than search queries.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Paste DeFiLlama URLs to auto-route: defillama.com/protocol/<slug>, /chain/<name>, /stablecoin/<name>. Protocol URLs feed protocolDetail; the type is detected automatically.",
            "items": {
              "type": "string"
            }
          },
          "chainFilter": {
            "title": "Chain filter",
            "type": "string",
            "description": "Only include protocols / yield pools deployed on this chain, e.g. \"Ethereum\", \"Arbitrum\", \"Solana\", \"Base\". Leave empty for all chains. Applies to protocols, yields, dexs and fees modes."
          },
          "categoryFilter": {
            "title": "Category filter",
            "type": "string",
            "description": "Only include protocols in this category, e.g. \"Lending\", \"Dexs\", \"Liquid Staking\", \"Yield\", \"CDP\", \"Bridge\", \"Derivatives\". Leave empty for all categories. Applies to protocols / fees modes."
          },
          "minTvlUsd": {
            "title": "Minimum TVL (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include protocols / yield pools / chains with at least this much total value locked, in USD. Use to skip dust. 0 = no minimum.",
            "default": 0
          },
          "minApy": {
            "title": "Minimum APY (%) — yields mode",
            "minimum": 0,
            "type": "integer",
            "description": "yields mode only: only include pools with a total APY at or above this percentage (e.g. 5 = 5%). 0 = no minimum.",
            "default": 0
          },
          "stablecoinPoolsOnly": {
            "title": "Stablecoin pools only — yields mode",
            "type": "boolean",
            "description": "yields mode only: keep only pools made up of stablecoins (lower impermanent-loss risk).",
            "default": false
          },
          "yieldProject": {
            "title": "Yield project filter — yields mode",
            "type": "string",
            "description": "yields mode only: only include pools from this project, e.g. \"aave-v3\", \"lido\", \"curve-dex\", \"compound-v3\". Leave empty for all projects."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "tvl",
              "apy",
              "volume",
              "fees",
              "change24h"
            ],
            "type": "string",
            "description": "Ranking field. protocols/chains: tvl. yields: apy or tvl. dexs/fees: volume / fees. Records are ranked highest-first before the result cap is applied.",
            "default": "tvl"
          },
          "enrichProtocolDetails": {
            "title": "Enrich protocol profiles",
            "type": "boolean",
            "description": "protocols mode: open each protocol's full profile for per-chain TVL, market cap, GitHub/Twitter/website, audits, methodology, treasury and funding rounds (investors, amounts, valuations). One extra request per protocol. Always on for protocolDetail.",
            "default": false
          },
          "enrichContacts": {
            "title": "Enrich contacts (lead wedge)",
            "type": "boolean",
            "description": "Crawl each protocol's own website (home + contact/about, max 3 pages) for contact emails and extra social links, and compute a 0-100 lead score. Requires a protocol website (most have one). Adds a few requests per protocol.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum number of records to output for this run. Records are ranked by the chosen sort field first, so you keep the top N.",
            "default": 100
          },
          "monitorMode": {
            "title": "Monitor mode — only new",
            "type": "boolean",
            "description": "Remember records seen in previous runs (in a named key-value store) and output ONLY newly-appearing protocols / pools / chains / stablecoins. Ideal on a schedule to catch new DeFi launches and new yield pools. Works alongside Apify Schedules.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Label that groups a monitor watchlist across runs. Use a distinct key per saved search (e.g. \"arbitrum-lending\", \"high-apy-stables\") so each tracks its own seen-set.",
            "default": "default"
          },
          "deduplicateResults": {
            "title": "Deduplicate within a run",
            "type": "boolean",
            "description": "Drop duplicate records within a single run (by stable id). Recommended.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel detail/enrichment requests. Lower this if you hit rate limits.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. DeFiLlama's API is public; Apify datacenter proxy (default) works well. The actor rotates the proxy session and retries on rate limits.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}