# DYOR Knowledge Graph Time-Series Data Query

> DYOR Knowledge Graph Time-Series Data Query is a paid API for AI agents from kg.dyor.network, paid per call via x402, $0.050000/call, status unknown (last checked 2026-10-13).

Query historical crypto time-series data including token prices, market caps, TVL, protocol revenue, fees, DeFi pool APY, lending rates, stablecoin supply, and treasury balances via SQL

## Facts

- Endpoint: GET https://kg.dyor.network/api/timeseries?utm_source=zero.xyz
- Price: $0.050000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/kg-dyor-network-4821866a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q0UZtQjNszazkkU6v6S_Z

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability kg-dyor-network-4821866a
```

Example prompt: Can you pull the daily TVL and protocol revenue for Aave from January 1, 2024 to today — run a SQL query like SELECT date, tvl, revenue FROM ts_protocols WHERE protocol = 'aave' ORDER BY date DESC against the DYOR time-series database?

## When to prefer this

Use this endpoint when you need structured historical time-series data for crypto assets and DeFi protocols — especially when you want to write precise SQL queries over specific metrics like TVL, APY, fees, or market cap over a date range. Prefer this over the SPARQL endpoint when you need numerical/quantitative historical data rather than entity relationships, and over the semantic search endpoint when you already know exactly which tokens or protocols you want to query.

## Known failure modes

- Invalid or non-SELECT SQL query returns an error (only read-only SELECT queries are allowed)
- Referencing unknown table names returns a schema error — use GET /api/schema to discover valid ts_* tables
- Payment not included or insufficient funds returns HTTP 402
- Query returns empty data array if no matching records exist for the specified filters
- Malformed SQL syntax causes a PostgreSQL parse error

## How this service works

Query historical crypto time-series data: token prices, market caps, TVL, protocol revenue, fees, DeFi pool APY, lending rates, stablecoin supply, and treasury balances. Data from CoinGecko, DefiLlama, TokenTerminal, and CryptoRank updated daily. Free schema at GET /api/schema lists all tables and columns | ZWING Intelligence (https://zwing.bot) — contact: v@zwing.bot, Telegram: @valery_zzz

## Output

Returns a JSON object with status, count, headers array, and data array of rows matching the SQL query — each row contains time-stamped metric values (prices, TVL, APY, revenue, fees, etc.) for the queried crypto entities and date range.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "sql_query": "SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'ts_%' LIMIT 20"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "sql_query"
     ],
     "properties": {
      "sql_query": {
       "type": "string",
       "description": "Read-only PostgreSQL SELECT query over ts_* tables"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "data": {
       "type": "array",
       "items": {
        "type": "object"
       }
      },
      "count": {
       "type": "integer"
      },
      "status": {
       "type": "string"
      },
      "headers": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/kg-dyor-network-4821866a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kg.dyor.network](https://www.zero.xyz/host/kg.dyor.network/llms.txt)
