{
 "openapi": "3.0.0",
 "info": {
  "version": "2.0.0-beta",
  "title": "CryptoQuant Data API v2",
  "description": "The CryptoQuant Data API v2 serves curated, research-grade indicators built on the v1 conventions — the `status`/`result` response envelope, Bearer token authentication, and the `window`/`from`/`to` time parameters. Each metric ships with an interpretation guide covering what it measures, key thresholds, and how to combine it with other metrics.",
  "termsOfService": "https://cryptoquant.com/terms-of-service",
  "contact": {
   "name": "API Support",
   "email": "contact@cryptoquant.com"
  }
 },
 "servers": [
  {
   "url": "https://api.cryptoquant.com/v2",
   "description": "Default server"
  }
 ],
 "tags": [
  {
   "name": "Community-built Indicators"
  }
 ],
 "paths": {
  "/community/bitcoin-apparent-demand": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "Apparent Demand Growth 30-days",
    "description": "The 30-day change in Bitcoin Spot Demand, The 1-year change in Bitcoin Spot Demand",
    "operationId": "V2getBitcoinApparentDemand",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Monitoring Bitcoin demand",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "apparent_demand": {
                "type": "number",
                "example": -261510.21
               },
               "apparent_demand_1y": {
                "type": "number",
                "example": -323215.7
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-apparent-demand?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-apparent-demand?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-apparent-demand?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-apparent-demand?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-apparent-demand?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-etf-demand": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "ETF Bitcoin Demand 30-days",
    "description": "The 30-day and 1-year Bitcoin purchase from US-based ETFs",
    "operationId": "V2getBitcoinEtfDemand",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Monitoring Bitcoin demand",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "etf_demand_30d": {
                "type": "number",
                "description": "Net BTC purchased or sold by US spot Bitcoin ETFs over a 30-day rolling window.",
                "example": -53782.96
               },
               "etf_demand_1y": {
                "type": "number",
                "description": "Net BTC purchased or sold by US spot Bitcoin ETFs over a 1-year rolling window.",
                "example": 1592.04
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-etf-demand?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-etf-demand?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-etf-demand?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-etf-demand?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-etf-demand?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-mvrv-z-score": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "MVRV Z-score",
    "description": "The Z-score of Bitcoin's MVRV Ratio",
    "operationId": "V2getBitcoinMvrvZScore",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Bitcoin price valuation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "mvrv_ratio_zscore": {
                "type": "number",
                "example": -0.4445148
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-mvrv-z-score?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-mvrv-z-score?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-mvrv-z-score?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-mvrv-z-score?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-mvrv-z-score?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-trader-realized-price": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "On-chain Trader Realized Price bands",
    "description": "The on-chain realized price of Bitcoin between 1 to 3 months old, including the max, upper, lower and min price bands.",
    "operationId": "V2getBitcoinTraderRealizedPrice",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Bitcoin price valuation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "realized_price_1m_3m": {
                "type": "number",
                "example": 75405.79
               },
               "realized_price_max_band": {
                "type": "number",
                "example": 128189.84
               },
               "realized_price_upper_band": {
                "type": "number",
                "example": 105568.11
               },
               "realized_price_lower_band": {
                "type": "number",
                "example": 66357.1
               },
               "realized_price_min_band": {
                "type": "number",
                "example": 47505.65
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-trader-realized-price?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-trader-realized-price?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-trader-realized-price?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-trader-realized-price?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-trader-realized-price?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-metcalfe-price": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "Bitcoin Metcalfe's Price",
    "description": "Bitcoin price valuation based on Metcalfe's model following the formula A*Active addresses^ 2. Each band represents a different value of A (3, 2, 1, 0.5, 0.25, 0.1 and 0.04)",
    "operationId": "V2getBitcoinMetcalfePrice",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Bitcoin price valuation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "active_addresses_squared_price_365ma": {
                "type": "number",
                "example": 23036.88
               },
               "active_addresses_squared_50_price_365ma": {
                "type": "number",
                "example": 11518.44
               },
               "active_addresses_squared_25_price_365ma": {
                "type": "number",
                "example": 5759.22
               },
               "active_addresses_squared_10_price_365ma": {
                "type": "number",
                "example": 2303.69
               },
               "active_addresses_squared_3x_price_365ma": {
                "type": "number",
                "example": 69110.65
               },
               "active_addresses_squared_2x_price_365ma": {
                "type": "number",
                "example": 46073.77
               },
               "active_addresses_squared_04_price_365ma": {
                "type": "number",
                "example": 921.48
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-metcalfe-price?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-metcalfe-price?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-metcalfe-price?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-metcalfe-price?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-metcalfe-price?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-trader-unrealized-profit-margin": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "On-chain Trader Unrealized Profit/Loss Margin",
    "description": "The unrealized profit/loss margin (%) of Bitcoin between 1 to 3 months old.",
    "operationId": "V2getBitcoinTraderUnrealizedProfitMargin",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Bitcoin price valuation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "nupl_1m_3m": {
                "type": "number",
                "example": -14.60751236
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-trader-unrealized-profit-margin?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-trader-unrealized-profit-margin?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-trader-unrealized-profit-margin?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-trader-unrealized-profit-margin?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-trader-unrealized-profit-margin?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-realized-profit-loss": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "Realized Net Profit and Loss",
    "description": "The net realized profit or loss of Bitcoin sellers in USD and BTC in daily, monthly and yearly windows.",
    "operationId": "V2getBitcoinRealizedProfitLoss",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "bitcoin spending behavior",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "positive_net_realized_profit": {
                "type": "number",
                "example": 37514484.39
               },
               "negative_net_realized_profit": {
                "type": "number",
                "example": 0
               },
               "yearly_realized_net_profit_btc": {
                "type": "number",
                "example": 713808.98
               },
               "yearly_realized_net_profit_usd": {
                "type": "number",
                "example": 115843247516.25
               },
               "monthly_realized_net_profit_btc": {
                "type": "number",
                "example": -230680.73
               },
               "monthly_realized_net_profit_usd": {
                "type": "number",
                "example": -15584313788.43
               },
               "positive_monthly_realized_net_profit_btc": {
                "type": "number",
                "example": 0
               },
               "negative_monthly_realized_net_profit_btc": {
                "type": "number",
                "example": -230680.73
               },
               "positive_net_realized_profit_btc": {
                "type": "number",
                "example": 581.22
               },
               "negative_net_realized_profit_btc": {
                "type": "number",
                "example": 0
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-realized-profit-loss?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-realized-profit-loss?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-realized-profit-loss?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-realized-profit-loss?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-realized-profit-loss?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-op-return-count": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "OP Return Count",
    "description": "The total amount of OP Return codes in Bitcoin transactions",
    "operationId": "V2getOpReturnCount",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "network activity",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "amount_null_data": {
                "type": "number",
                "example": 516648
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-op-return-count?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-op-return-count?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-op-return-count?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-op-return-count?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-op-return-count?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-satoshi-era-miner": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "Satoshi-era miner",
    "description": "The flow, reserves, and active addresses count of Satoshi-era miner addresses.\nFlow and reserve data in BTC and USD terms.",
    "operationId": "V2getSatoshiEraMiner",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "miners",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "netflow": {
                "type": "number",
                "example": 0.0004368
               },
               "netflow_usd": {
                "type": "number",
                "example": 28.71056604
               },
               "total_balance": {
                "type": "number",
                "example": 590769.77
               },
               "total_balance_usd": {
                "type": "number",
                "example": 38830894046.92
               },
               "active_addresses": {
                "type": "number",
                "example": 1
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-satoshi-era-miner?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-satoshi-era-miner?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-satoshi-era-miner?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-satoshi-era-miner?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-satoshi-era-miner?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-pnl-index": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "PnL Index",
    "description": "CryptoQuant's P&L Index uses the MVRV ratio, NUPL and LTH/STH SOPR to build a single bitcoin valuation indicator.",
    "operationId": "V2getBitcoinPnlIndex",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "market regime",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "pnl_index": {
                "type": "number",
                "example": -0.58300629
               },
               "pnl_index_365day_ma": {
                "type": "number",
                "example": 0.10380787
               },
               "buy": {
                "type": "number",
                "example": 0
               },
               "neutral": {
                "type": "number",
                "example": 1
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-pnl-index?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-pnl-index?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-pnl-index?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-pnl-index?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-pnl-index?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  },
  "/community/bitcoin-bull-bear-indicator": {
   "get": {
    "tags": [
     "Community-built Indicators"
    ],
    "summary": "Bull-Bear Market Indicator",
    "description": "The bull/bear market cycle indicator is a momentum metric. It measures the difference between the P&L Index and its 365-day moving average.",
    "operationId": "V2getBitcoinBullBearIndicator",
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "description": "Time interval for aggregation.",
      "schema": {
       "type": "string",
       "default": "day"
      },
      "example": "day"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Starting time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Ending time, formatted as YYYYMMDDTHHMMSS (UTC). If `window=day`, YYYYMMDD is also accepted.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Maximum number of data rows to return. Ranges from 1 to 10,000.",
      "schema": {
       "type": "integer",
       "default": 100,
       "minimum": 1,
       "maximum": 10000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "market regime",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "status",
          "result"
         ],
         "properties": {
          "status": {
           "$ref": "#/components/schemas/Status"
          },
          "result": {
           "type": "object",
           "properties": {
            "window": {
             "type": "string"
            },
            "data": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "datetime": {
                "type": "string",
                "description": "The datetime, formatted as YYYY-MM-DD HH:MM:SS (UTC).",
                "example": "2026-06-14 00:00:00"
               },
               "bull_bear_indicator": {
                "type": "number",
                "example": -0.69567171
               },
               "type": {
                "type": "string",
                "example": "bear"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "AccessToken": []
     }
    ],
    "x-codeSamples": [
     {
      "lang": "Shell",
      "source": "curl -X GET \"https://api.cryptoquant.com/v2/community/bitcoin-bull-bear-indicator?window=day\" \\\n-H \"Authorization: Bearer <YOUR_API_KEY>\""
     },
     {
      "lang": "JavaScript",
      "source": "fetch(\"https://api.cryptoquant.com/v2/community/bitcoin-bull-bear-indicator?window=day\", { headers: { \"Authorization\": \"Bearer <YOUR_API_KEY>\"} })\n  .then(response => response.json())\n  .then(data => console.log(data))"
     },
     {
      "lang": "NodeJS",
      "source": "require('axios')\n  .get(\"https://api.cryptoquant.com/v2/community/bitcoin-bull-bear-indicator?window=day\", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })\n  .then(response => console.log(response))"
     },
     {
      "lang": "Ruby",
      "source": "require 'net/http'\nuri = URI(\"https://api.cryptoquant.com/v2/community/bitcoin-bull-bear-indicator?window=day\")\nreq = Net::HTTP::Get.new(uri)\nreq[\"Authorization\"] = \"Bearer <YOUR_API_KEY>\"\nres = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }\nputs res.body"
     },
     {
      "lang": "Python",
      "source": "import requests\nheaders = {'Authorization': 'Bearer <YOUR_API_KEY>'}\nurl = \"https://api.cryptoquant.com/v2/community/bitcoin-bull-bear-indicator?window=day\"\nprint(requests.get(url, headers=headers).json())"
     }
    ]
   }
  }
 },
 "components": {
  "schemas": {
   "Status": {
    "type": "object",
    "description": "Returned with every response; indicates whether the request was successful.",
    "example": {
     "code": 200,
     "message": "success"
    },
    "required": [
     "code",
     "message"
    ],
    "properties": {
     "code": {
      "type": "integer",
      "format": "int32",
      "description": "HTTP status code.",
      "example": 200
     },
     "message": {
      "type": "string",
      "description": "Text description of the error or success.",
      "example": "success"
     }
    }
   }
  },
  "securitySchemes": {
   "AccessToken": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT",
    "x-default": "Bearer <YOUR_API_KEY>",
    "description": "For each API request, include the `Authorization` HTTP header with `Bearer <YOUR_API_KEY>`."
   }
  }
 }
}