Defilama

Defilama supports CSV downloads and endpoint-specific API access

Defilama provides CSV downloads for spreadsheet work and APIs for retrieving data through software requests. Choose an export when you need a saved dataset for a particular analysis. Choose an API when a recurring task needs structured responses that software can process. A downloaded file preserves its contents; new figures require another download or a separate data connection. API results depend on the selected endpoint, its parameters, and its access requirements. Neither format makes unlike measurements interchangeable. Start with the required metric, chain coverage, and reporting period, then choose how to retrieve that dataset.

Charts, ranking tables, and API endpoints carry different views

The homepage separates a DeFi TVL chart from a protocol-ranking table, and both areas expose CSV controls. TVL means total value locked. The chart organizes a measurement across time, while the ranking organizes protocol entries and their associated metrics. That difference determines the shape of the material you take away. The file's headers identify its fields; any date values identify the observations that it contains. The appropriate export starts with the view that contains the information you need.

An endpoint is a defined interface for requesting particular data. Its response can contain a single value, a collection of entries, or a historical series, depending on the operation. This makes the returned structure part of the choice. A dataset name provides context, yet the actual fields determine whether the response can answer the question.

Saved exports preserve the downloaded contents

A CSV is a comma-separated values file, which stores tabular records as text. Once saved, its contents don't change merely because the dashboard updates. That stability makes a download useful for preserving the inputs behind an analysis or sharing a fixed worksheet. Keep the unedited export alongside any calculations that you add. Record the download time separately from the dates inside the dataset: they describe different things. A file retrieved today can contain earlier observations. Its filename alone can't establish the reporting period, included chains, or measurement units.

Illustration: Saved exports preserve the downloaded contents (Defilama)

View image file

What should an API request retrieve?

An API request should retrieve the dataset and fields that the analysis needs, including the required historical depth. The free TVL interfaces distinguish a protocol list, a simplified current protocol value, and protocol history with chain and token breakdowns. Choosing a broad response just because it contains more fields adds processing work and can obscure which value the calculation uses.

The request's inputs also determine what the response describes. A protocol selector and a chain selector serve different purposes. Use the identifier accepted by the particular operation. A display name helps someone read a report, while software needs the corresponding request value. Retain that value with the response so later work doesn't depend on remembering which selection produced it.

A current value cannot supply a historical trend by itself. Historical analysis needs dated observations from a suitable history response.

Reporting periods and aggregation define comparable data

Keep the measurement's time window attached to its value when moving data between formats. The dashboard displays TVL changes over different periods, as well as daily fee and revenue figures. Those labels belong to the data's meaning. A weekly change and a daily amount cannot substitute for one another simply because both appear beside the same protocol. The same principle applies to chain coverage: an all-chain total answers a broader question than a record restricted to one network.

The v2 historical chain TVL endpoints exclude liquid staking and double-counted TVL. That inclusion rule matters when comparing those series with another total. A shared TVL label doesn't guarantee matching coverage, and adding rows together can change the accounting basis. Preserve the definition that belongs to the selected series. A discrepancy deserves an explanation of scope before a calculation attributes it to a market move.

Reconciling a saved ranking with a current API value

In this hypothetical comparison, a reader saves a protocol-ranking CSV, then requests current TVL for the same protocol. The two figures differ.

Visual summary: Defilama: Reconciling a saved ranking with a current API value

View image file

The reader expected agreement because both records name the same protocol. The CSV preserves the exported record, while the simplified endpoint returns current protocol TVL. A later request doesn't recreate the data available when the file was downloaded. Differences in observation time or inclusion rules can therefore explain a mismatch, even when both outputs come from the same service.

The reader saves the later API response alongside the CSV, preserving both inputs for comparison. Comparing them across time requires matching definitions and units, with observation times that fit the intended comparison.

Free and Pro differ by access requirements

The free API doesn't require authentication, while Pro endpoints require a paid API key. Pro also provides access to free datasets through its corresponding request mappings, with higher rate limits. Choose access around the required operation and request pattern. Keep data-access requirements separate from the fees measured within a dataset. Protocol fee figures describe the tracked protocol's activity. They aren't a quote for downloading that data or calling an endpoint, and they don't establish the price of an API plan.

File structure and response structure need separate handling

CSV and API data can enter the same analysis even when their layouts differ. CSV rows and headers support a flat table. An API response can organize records within nested collections, so its structure needs a deliberate mapping into columns. Preserve the connection between each identifier and its associated measurements during that conversion. Copying a visible total into a column is simpler than retaining a breakdown, yet those outputs answer different questions. The required level of detail determines which structure to keep.

Rounding belongs to presentation. Keep the original numerical values for calculations and round the displayed result separately. Date handling deserves the same care: a spreadsheet's automatic formatting can alter how an imported timestamp appears. Retain the original value alongside any converted display date when timing affects the comparison. These choices keep formatting changes from masquerading as changes in the dataset.

What changes for yield integrations on November 13, 2026?

The yields API has a scheduled move to new endpoints on November 13, 2026, requiring affected integrations to update. Update any affected yield integration before that date. Its calculations still need the appropriate pool metric and observation period.

Defilama - What changes for yield integrations on November 13, 2026? - diagram

View image file

Repeatable retrieval needs an update policy

A recurring report needs an explicit update policy alongside its data-access method. An API makes repeated retrieval possible, while your software determines when requests run and how it stores responses. A CSV-based report can also change when someone replaces its input file. In either case, decide whether new data should overwrite the previous record or form a separate version. That storage choice determines whether an older report remains reproducible after the input changes.

Request frequency alone cannot establish the age of the underlying observations. For the next report, decide whether to preserve past inputs for reproducibility, refresh the dataset for newer observations, or do both.

What to know about Defilama

Will a PNG chart provide the data needed for spreadsheet calculations?

A PNG preserves an image of the chart, so spreadsheet calculations need the underlying numeric data. Choose the CSV control associated with the required view when available. Reading a rounded chart label back into a worksheet can discard precision that the data file may retain.

Can a spreadsheet change identifier fields during CSV import?

Spreadsheet import settings can reinterpret text-like values as numbers or dates. Preserve identifiers as text, and retain the original export when preparing a worksheet. A field that names a record shouldn't gain digit grouping or lose meaningful characters during formatting. Numeric formatting belongs to quantities, not identifiers.

Does a successful free API request confirm that my Pro key works?

A successful request to a free endpoint doesn't validate a Pro API key because that endpoint doesn't authenticate it. Credential checks must concern the keyed Pro service.

Where should a Pro API key stay when the output is a public report?

A Pro API key should remain in private integration settings, outside published reports and exported metadata. Pro authentication includes the key in the request path, so copied request addresses and logs can expose it. Keep request logs private, and redact the credential from any diagnostic material that leaves the integration.

Should a spreadsheet format every numeric field as a currency?

A spreadsheet should preserve each field's unit instead of formatting every numeric value as currency. TVL amounts and percentage changes represent different quantities. Apply currency formatting only to monetary fields, and retain the scale used by each percentage field. Number formatting can't substitute for identifying what the field measures.

What happens if a DEX volume request excludes chart data?

A DEX volume response can omit aggregated or broken-down chart data when the request selects those exclusions. That omission doesn't establish that history is unavailable. Retain the request settings when comparing responses so an intentionally smaller payload doesn't become a false missing-data conclusion.

Last updated: