{"id":48459,"date":"2025-03-05T16:24:37","date_gmt":"2025-03-05T21:24:37","guid":{"rendered":"https:\/\/bitcoincounterflow.com\/?page_id=48459"},"modified":"2025-10-23T10:31:50","modified_gmt":"2025-10-23T14:31:50","slug":"api-access","status":"publish","type":"page","link":"https:\/\/bitcoincounterflow.com\/api-access\/","title":{"rendered":"API Access"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"48459\" class=\"elementor elementor-48459\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3c97c5e e-con-full e-flex wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no e-con e-parent\" data-id=\"3c97c5e\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ca2f11f elementor-widget__width-inherit elementor-widget elementor-widget-html\" data-id=\"ca2f11f\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;500;600&display=swap\" rel=\"stylesheet\">\r\n    <link href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.29.0\/themes\/prism-dark.min.css\" rel=\"stylesheet\" \/>\r\n    \r\n    <style>\r\n        .ct-container-full {\r\n            padding: 0;\r\n        }\r\n            \r\n        body {\r\n            background: #0a0a0a;\r\n            color: #ffffff;\r\n            font-family: 'Inter', sans-serif;\r\n            margin: 0;\r\n            padding: 0;\r\n        }\r\n\r\n        .api-key-container {\r\n            background: #080808;\r\n            display: flex;\r\n            gap: 30px;\r\n            width: 100%;\r\n            box-sizing: border-box;\r\n        }\r\n\r\n        h2 {\r\n            font-weight: 500;\r\n            font-size: 26px;\r\n            margin-bottom: 25px;\r\n            color: #ffffff;\r\n            line-height: 1.5;\r\n        }\r\n\r\n        h3 {\r\n            font-weight: 500;\r\n            font-size: 22px;\r\n            margin-bottom: 20px;\r\n            color: #ffffff;\r\n            line-height: 1.5;\r\n        }\r\n\r\n        .api-key-left {\r\n            flex: 1;\r\n            min-width: 350px;\r\n            background: #101010;\r\n            padding: 30px;\r\n            max-width: 482px;\r\n        }\r\n        \r\n        .api-key-left p {\r\n            font-size: 15px;\r\n        }\r\n\r\n        .api-key-input-container {\r\n            display: flex;\r\n            align-items: center;\r\n            gap: 12px;\r\n            margin-top: 20px;\r\n        }\r\n\r\n        .api-key-input {\r\n            flex: 1;\r\n            padding: 12px;\r\n            background: #222222;\r\n            border: 1px solid #444444;\r\n            color: #ffffff;\r\n            border-radius: 4px;\r\n            font-size: 14px;\r\n            text-align: center;\r\n            font-family: 'Inter', sans-serif;\r\n        }\r\n\r\n        .api-key-buttons {\r\n            display: flex;\r\n            gap: 12px;\r\n            justify-content: center;\r\n            margin-top: 20px;\r\n        }\r\n\r\n        button#toggleApiKey {\r\n            padding: 8px 10px;\r\n            font-size: 14px;\r\n            color: #ffffff;\r\n            background: #222222;\r\n            border: 1px solid #444444;\r\n            cursor: pointer;\r\n            border-radius: 4px;\r\n            transition: background 0.3s ease;\r\n        }\r\n\r\n        .api-key-buttons button {\r\n            flex: 1;\r\n            padding: 12px;\r\n            font-size: 14px;\r\n            color: #ffffff;\r\n            background: #222222;\r\n            border: 1px solid #444444;\r\n            cursor: pointer;\r\n            border-radius: 4px;\r\n            transition: background 0.3s ease;\r\n        }\r\n\r\n        .api-key-buttons button:hover {\r\n            background: #333333;\r\n        }\r\n\r\n        .hidden-key {\r\n            letter-spacing: 2px;\r\n        }\r\n\r\n        .error-message {\r\n            color: #ff5555;\r\n            margin-top: 15px;\r\n            font-size: 13px;\r\n            line-height: 1.6;\r\n        }\r\n\r\n        .api-container {\r\n            background: #080808;\r\n            border-radius: 8px;\r\n            padding: 30px;\r\n            flex: 2;\r\n            max-width: 1000px;\r\n        }\r\n        \r\n        .api-container {\r\n         font-size: 14px   \r\n        }    \r\n\r\n        .api-container h1 {\r\n            font-size: 30px;\r\n            margin-bottom: 25px;\r\n            color: #ffffff;\r\n            line-height: 1.5;\r\n        }\r\n\r\n        .api-container span {\r\n            display: block;\r\n            margin: 15px 0;\r\n            font-size: 14px;\r\n            line-height: 1.7;\r\n            color: #cccccc;\r\n        }\r\n\r\n        code {\r\n            background: #1a1a1a;\r\n            border: 1px solid #333333;\r\n            color: #cccccc;\r\n            padding: 4px 8px;\r\n            border-radius: 4px;\r\n            font-size: 13px;\r\n            font-family: 'Inter', sans-serif;\r\n        }\r\n\r\n        .api-links {\r\n            list-style: none;\r\n            padding: 0;\r\n            margin: 25px 0;\r\n        }\r\n\r\n        .api-links li {\r\n            margin: 12px 0;\r\n            font-size: 14px;\r\n            color: #cccccc;\r\n            line-height: 1.7;\r\n        }\r\n\r\n        .api-links .category {\r\n            font-weight: 600;\r\n            font-size: 16px;\r\n            margin: 25px 0 15px;\r\n            color: #ffffff;\r\n            line-height: 1.5;\r\n        }\r\n\r\n        .api-links a {\r\n            color: #aaaaaa;\r\n            text-decoration: none;\r\n            transition: color 0.3s ease;\r\n        }\r\n\r\n        .api-links a:hover {\r\n            color: #ffffff;\r\n            text-decoration: underline;\r\n        }\r\n\r\n        .note {\r\n            margin-top: 25px;\r\n            font-size: 13px;\r\n            color: #999999;\r\n            line-height: 1.7;\r\n        }\r\n\r\n        .api-test-form {\r\n            margin-top: 25px;\r\n            padding: 20px;\r\n            background: #101010;\r\n            border-radius: 8px;\r\n            display: flex;\r\n            flex-wrap: wrap;\r\n            gap: 12px;\r\n            align-items: center;\r\n        }\r\n\r\n        .api-test-form label {\r\n            font-size: 13px;\r\n            color: #cccccc;\r\n            margin-right: 10px;\r\n            line-height: 1.6;\r\n        }\r\n\r\n        .api-test-form input,\r\n        .api-test-form select {\r\n            padding: 10px;\r\n            background: #222222;\r\n            border: 1px solid #444444;\r\n            color: #ffffff;\r\n            border-radius: 4px;\r\n            font-size: 13px;\r\n            font-family: 'Inter', sans-serif;\r\n        }\r\n\r\n        .api-test-form input[type=\"number\"] {\r\n            width: 80px;\r\n        }\r\n\r\n        .api-test-form select {\r\n            width: 160px;\r\n        }\r\n\r\n        .api-test-form option {\r\n            color: #ffffff;\r\n        }\r\n\r\n        .api-test-form button {\r\n            padding: 10px 18px;\r\n            font-size: 13px;\r\n            color: #ffffff;\r\n            background: #222222;\r\n            border: 1px solid #444444;\r\n            cursor: pointer;\r\n            border-radius: 4px;\r\n            transition: background 0.3s ease;\r\n        }\r\n\r\n        .api-test-form button:hover {\r\n            background: #333333;\r\n        }\r\n\r\n        .api-test-form button:disabled {\r\n            background: #444444;\r\n            cursor: not-allowed;\r\n        }\r\n\r\n        .api-test-response {\r\n            margin-top: 20px;\r\n            padding: 15px;\r\n            background: #1a1a1a;\r\n            border: 1px solid #333333;\r\n            border-radius: 4px;\r\n            max-height: 350px;\r\n            overflow-y: auto;\r\n            font-family: 'Inter', sans-serif;\r\n            font-size: 13px;\r\n            color: #cccccc;\r\n        }\r\n\r\n        .api-test-error {\r\n            color: #ff5555;\r\n            font-size: 13px;\r\n            margin-top: 15px;\r\n            line-height: 1.6;\r\n        }\r\n\r\n        .api-test-response-header {\r\n            display: flex;\r\n            justify-content: space-between;\r\n            align-items: center;\r\n            margin-bottom: 15px;\r\n        }\r\n\r\n        .api-test-response-header span {\r\n            font-size: 13px;\r\n            color: #ffffff;\r\n            line-height: 1.6;\r\n        }\r\n\r\n        .api-test-response-header button {\r\n            padding: 6px 12px;\r\n            font-size: 12px;\r\n        }\r\n\r\n        .exclusive-banner {\r\n            background: #222222;\r\n            color: #ffffff;\r\n            padding: 12px;\r\n            border-radius: 4px;\r\n            margin-bottom: 25px;\r\n            font-size: 14px;\r\n            text-align: center;\r\n            line-height: 1.6;\r\n        }\r\n\r\n        .endpoint-details {\r\n            margin-top: 25px;\r\n            padding: 20px;\r\n            background: #101010;\r\n            border-radius: 8px;\r\n        }\r\n\r\n        .endpoint-details h4 {\r\n            font-size: 16px;\r\n            margin-bottom: 15px;\r\n            color: #ffffff;\r\n            line-height: 1.5;\r\n        }\r\n\r\n        .endpoint-details pre {\r\n            background: #1a1a1a;\r\n            border: 1px solid #333333;\r\n            padding: 15px;\r\n            border-radius: 4px;\r\n            font-size: 13px;\r\n            color: #cccccc;\r\n            overflow-x: auto;\r\n            line-height: 1.7;\r\n        }\r\n\r\n        .request-history {\r\n            margin-top: 25px;\r\n            padding: 20px;\r\n            background: #101010;\r\n            border-radius: 8px;\r\n        }\r\n\r\n        .request-history h4 {\r\n            font-size: 16px;\r\n            margin-bottom: 15px;\r\n            color: #ffffff;\r\n            line-height: 1.5;\r\n        }\r\n\r\n        .request-history ul {\r\n            list-style: none;\r\n            padding: 0;\r\n        }\r\n\r\n        .request-history li {\r\n            margin: 10px 0;\r\n            font-size: 13px;\r\n            color: #cccccc;\r\n            line-height: 1.7;\r\n        }\r\n\r\n        .sc-dtOqdk {\r\n            position: relative;\r\n            display: flex;\r\n            align-items: center;\r\n            width: 100%;\r\n            margin-bottom: 15px;\r\n            margin-top: 25px;\r\n        }\r\n\r\n        .sc-hPGoDJ {\r\n            width: 100%;\r\n            padding: 10px 35px 10px 12px;\r\n            border: 1px solid #444444;\r\n            border-radius: 4px;\r\n            background: #222222;\r\n            color: #ffffff;\r\n            font-size: 14px;\r\n            font-family: 'Inter', sans-serif;\r\n        }\r\n\r\n        .sc-kBpWFy {\r\n            position: absolute;\r\n            right: 12px;\r\n            width: 20px;\r\n            height: 20px;\r\n            fill: #ffffff;\r\n        }\r\n\r\n        .search-results {\r\n            width: 100%;\r\n            max-width: 320px;\r\n            padding: 10px;\r\n            border: 1px solid #444444;\r\n            border-radius: 4px;\r\n            background: #222222;\r\n            color: #ffffff;\r\n            font-size: 14px;\r\n            margin-top: 8px;\r\n            font-family: 'Inter', sans-serif;\r\n        }\r\n\r\n        @media (max-width: 768px) {\r\n            .api-key-container {\r\n                flex-direction: column;\r\n                padding: 20px;\r\n            }\r\n\r\n            .api-key-left {\r\n                min-width: 100%;\r\n                padding: 20px;\r\n            }\r\n\r\n            .api-container {\r\n                padding: 20px;\r\n            }\r\n\r\n            .api-links li {\r\n                font-size: 13px;\r\n                line-height: 1.6;\r\n            }\r\n\r\n            .api-links .category {\r\n                font-size: 15px;\r\n            }\r\n\r\n            .api-container h1 {\r\n                font-size: 26px;\r\n            }\r\n\r\n            .api-container span {\r\n                font-size: 13px;\r\n                line-height: 1.6;\r\n            }\r\n\r\n            .api-test-form {\r\n                flex-direction: column;\r\n                align-items: flex-start;\r\n            }\r\n\r\n            .api-test-form input,\r\n            .api-test-form select {\r\n                width: 100%;\r\n            }\r\n\r\n            .api-test-form button {\r\n                width: 100%;\r\n            }\r\n        }\r\n    <\/style>\r\n<\/head>\r\n<body>\r\n    <div class=\"api-key-container\">\r\n        <div class=\"api-key-left\">\r\n            <div class=\"exclusive-banner\">\r\n                <strong>Nakamoto Pro Exclusive:<\/strong> Full access to the API and premium BitcoinCounterFlow data\r\n            <\/div>\r\n            <div class=\"hidden-from-subscriber\">\r\n                <h3>Manage Your API Key<\/h3>\r\n                <p>Generate or delete your API key to access data endpoints.<\/p>\r\n                <div class=\"api-key-input-container\">\r\n                    <input type=\"text\" id=\"apiKeyInput\" class=\"api-key-input hidden-key\" value=\"************\" readonly>\r\n                    <button id=\"toggleApiKey\" onclick=\"toggleApiKey()\">\ud83d\udc41<\/button>\r\n                <\/div>\r\n                <div class=\"api-key-buttons\">\r\n                    <button id=\"generateApiKeyButton\" onclick=\"generateApiKey()\">Generate New Key<\/button>\r\n                    <button id=\"deleteApiKeyButton\" onclick=\"deleteApiKey()\">Delete Key<\/button>\r\n                <\/div>\r\n                <div id=\"errorMessage\" class=\"error-message\" style=\"display: none;\"><\/div>\r\n            <\/div>\r\n            <div role=\"search\" class=\"sc-dtOqdk cqdCbT\" style=\"display:none;\">\r\n                <svg class=\"sc-kBpWFy dFxKpJ search-icon\" version=\"1.1\" viewBox=\"0 0 1000 1000\" x=\"0px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" y=\"0px\">\r\n                    <path d=\"M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321.8,0C613.4,289.4,613.4,433.3,524.5,522z\"><\/path>\r\n                <\/svg>\r\n                <input placeholder=\"Search...\" aria-label=\"Search\" type=\"text\" class=\"sc-hPGoDJ cqNDQc search-input\" value=\"\">\r\n            <\/div>\r\n            <select class=\"search-results\" id=\"searchResults\" style=\"display: none;\">\r\n                <option value=\"\">Select a result...<\/option>\r\n            <\/select>\r\n            <div id=\"searchError\" class=\"error-message\" style=\"display: none;\"><\/div>\r\n<ul class=\"api-links\">\r\n    <li class=\"category\">Market Data<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/m2-global\" target=\"_blank\" rel=\"noreferrer\">M2 Global Growth<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-dominance\" target=\"_blank\" rel=\"noreferrer\">Bitcoin Dominance<\/a><\/li>\r\n\r\n    <li class=\"category\">Derivatives Data<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/open-interest\" target=\"_blank\" rel=\"noreferrer\">Open Interest<\/a> \r\n        <span>(Supports <code>days<\/code> and <code>interval<\/code>)<\/span>\r\n    <\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/volume\" target=\"_blank\" rel=\"noreferrer\">Exchanges Futures Volume (Latest)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/long-short\" target=\"_blank\" rel=\"noreferrer\">Long\/Short Ratio<\/a> \r\n        <span>(Supports <code>days<\/code> and <code>interval<\/code>)<\/span>\r\n    <\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/liquidations\" target=\"_blank\" rel=\"noreferrer\">Liquidations (Derivatives)<\/a> \r\n        <span>(Supports <code>days<\/code> and <code>interval<\/code>)<\/span>\r\n    <\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/liquidation-heatmap\" target=\"_blank\" rel=\"noreferrer\">Liquidation Map Levels<\/a> \r\n        <span class=\"new-tag\" style=\"background: #333333; color: #ffffff; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-left: 5px;\">NEW<\/span> \r\n        <span>(Supports <code>period<\/code>)<\/span>\r\n    <\/li>\r\n\r\n    <li class=\"category\">Funding Rates<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/list-global-funding-rate\" target=\"_blank\" rel=\"noreferrer\">Agg. Funding Rate <\/a> \r\n        <span>(Supports <code>days<\/code> and <code>interval<\/code>)<\/span>\r\n    <\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-stats\" target=\"_blank\" rel=\"noreferrer\">Agg. Funding Rate - Daily Data<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/last-global-funding-rate\" target=\"_blank\" rel=\"noreferrer\">Agg. Funding Rate - Latest Minute Value<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/exchanges-funding-rate\" target=\"_blank\" rel=\"noreferrer\">Funding Rate - Latest by Exchange<\/a><\/li>\r\n    \r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/exchanges-funding-history\" target=\"_blank\" rel=\"noreferrer\">Funding Rate - Historical by Exchange<\/a><\/li>\r\n\r\n    <li class=\"category\">Sentiment & Valuation Indicators<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/google-trends\" target=\"_blank\" rel=\"noreferrer\">Google Trends - Current Cycle<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/google-trends-10y\" target=\"_blank\" rel=\"noreferrer\">Google Trends - 10 Years<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/nupl\" target=\"_blank\" rel=\"noreferrer\">Net Unrealized Profit\/Loss (NUPL)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/mvrv\" target=\"_blank\" rel=\"noreferrer\">MVRV Ratio<\/a><\/li>\r\n\r\n    <li class=\"category\">Macro Indicators<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/dxy\" target=\"_blank\" rel=\"noreferrer\">DXY (US Dollar Index)<\/a><\/li>\r\n\r\n    <li class=\"category\">Price Data<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/btc-usdt\" target=\"_blank\" rel=\"noreferrer\">BTC\/USDT<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/btc-eur\" target=\"_blank\" rel=\"noreferrer\">BTC\/EUR<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/btc-brl\" target=\"_blank\" rel=\"noreferrer\">BTC\/BRL<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/btc-ibov\" target=\"_blank\" rel=\"noreferrer\">BTC\/BRL vs. IBOV<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/btc-spx\" target=\"_blank\" rel=\"noreferrer\">BTC vs. S&P 500<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/btc-gold\" target=\"_blank\" rel=\"noreferrer\">BTC vs. Gold<\/a><\/li>\r\n\r\n    <li class=\"category\">Performance Metrics<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-performance\" target=\"_blank\" rel=\"noreferrer\">All-Time High (ATH)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-performance\" target=\"_blank\" rel=\"noreferrer\">ATH Drawdown (%)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-performance\" target=\"_blank\" rel=\"noreferrer\">ATH Date<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-performance\" target=\"_blank\" rel=\"noreferrer\">Price Variation - 24h (%)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-performance\" target=\"_blank\" rel=\"noreferrer\">Price Variation - 7d (%)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-performance\" target=\"_blank\" rel=\"noreferrer\">Price Variation - 1M (%)<\/a><\/li>\r\n\r\n    <li class=\"category\">Investment Data<\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/dca-calculator\" target=\"_blank\" rel=\"noreferrer\">DCA Calculator (All Indices)<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/etf-data\" target=\"_blank\" rel=\"noreferrer\">Bitcoin ETFs Data<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/bitcoin-treasuries\" target=\"_blank\" rel=\"noreferrer\">Bitcoin Treasuries<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/strategy-history\" target=\"_blank\" rel=\"noreferrer\">MicroStrategy OHLC Price and Volume<\/a><\/li>\r\n    <li><a href=\"https:\/\/api.bitcoincounterflow.com\/api\/microstrategy-treasuries\" target=\"_blank\" rel=\"noreferrer\">MicroStrategy Treasuries<\/a><\/li>\r\n<\/ul>\r\n\r\n            <p class=\"note\"><strong>Note:<\/strong> Our API is continuously enhanced to provide robust data access. Comprehensive documentation is forthcoming to streamline integration.<\/p>\r\n        <\/div>\r\n        <div class=\"api-container\">\r\n            <h2>Bitcoin CounterFlow Data API<\/h1>\r\n            <p>\r\n                API Support: satoshi@bitcoincounterflow.com<br>\r\n                API Root Endpoint: <code>https:\/\/api.bitcoincounterflow.com\/<\/code>\r\n            <\/p>\r\n            <p>\r\n                The Bitcoin CounterFlow Data API provides access to price history, funding rates, open interest, liquidation data, and other macro Bitcoin metrics. Designed for traders, analysts, and developers requiring advanced data.\r\n            <\/p>\r\n            <h2>API Usage Instructions<\/h2>\r\n            <span>Nakamoto Pro subscribers have exclusive access to all API endpoints. Append your API key to the URL using the <code>apikey<\/code> parameter. Explore examples and tools below to get started.<\/span>\r\n            \r\n            <br><span><strong>Basic Usage:<\/strong> Add your API key to any endpoint. Example for M2 Global Growth:<\/span>\r\n            <code>https:\/\/api.bitcoincounterflow.com\/api\/m2-global?apikey=YOUR_API_KEY<\/code>\r\n            <br><br><span><strong>Data Filtering:<\/strong> The <code>open-interest<\/code>, <code>funding-rate<\/code>, <code>long-short<\/code>, <code>liquidations<\/code>, and <code>liquidation-heatmap<\/code> endpoints support parameters for filtering and aggregation:<\/span>\r\n            \r\n            \r\n            <span>Supported Intervals (open-interest, funding-rate, long-short-ratio, liquidations): <code>15m<\/code>, <code>30m<\/code>, <code>1h<\/code>, <code>2h<\/code>, <code>4h<\/code>, <code>1d<\/code>, <code>1w<\/code>, <code>1mo<\/code> (30 days).<\/span>\r\n            <span>Supported Periods (liquidation-heatmap): <code>12h<\/code>, <code>24h<\/code>, <code>48h<\/code>, <code>3day<\/code>, <code>1week<\/code>, <code>2week<\/code>, <code>1month<\/code>, <code>2month<\/code>, <code>3month<\/code>, <code>6month<\/code>.<\/span>\r\n            <br><span><strong>Example with Combined Parameters:<\/strong><\/span>\r\n            <code>https:\/\/api.bitcoincounterflow.com\/api\/liquidation-heatmap?period=1month&apikey=YOUR_API_KEY<\/code>\r\n            <div class=\"api-test-form\">\r\n                <label for=\"testEndpoint\">Endpoint:<\/label>\r\n                <select id=\"testEndpoint\" onchange=\"updateTestForm()\">\r\n                    <option value=\"m2-global\">M2 Global Growth<\/option>\r\n                    <option value=\"open-interest\">Open Interest<\/option>\r\n                    <option value=\"bitcoin-dominance\">Bitcoin Dominance<\/option>\r\n                    <option value=\"volume\">Exchanges Futures Volume<\/option>\r\n                    <option value=\"long-short-ratio\">Long\/Short Ratio<\/option>\r\n                    <option value=\"liquidations\">Liquidations (Derivatives)<\/option>\r\n                    <option value=\"liquidation-heatmap\">Liquidation Heatmap<\/option>\r\n                    <option value=\"list-global-funding-rate\" selected>Funding Rate - Complete Data<\/option>\r\n                    <option value=\"bitcoin-stats\">Funding Rate - Daily Data<\/option>\r\n                    <option value=\"last-global-funding-rate\">Funding Rate - Latest Value<\/option>\r\n                    <option value=\"exchanges-funding-rate\">Funding Rate - Latest by Exchange<\/option>\r\n                    <option value=\"google-trends\">Google Trends - Current Cycle<\/option>\r\n                    <option value=\"google-trends-10y\">Google Trends - 10 Years<\/option>\r\n                    <option value=\"nupl\">NUPL<\/option>\r\n                    <option value=\"mvrv\">MVRV Ratio<\/option>\r\n                    <option value=\"dxy\">DXY (US Dollar Index)<\/option>\r\n                    <option value=\"btc-usdt\">BTC\/USDT<\/option>\r\n                    <option value=\"btc-eur\">BTC\/EUR<\/option>\r\n                    <option value=\"btc-brl\">BTC\/BRL<\/option>\r\n                    <option value=\"btc-ibov\">BTC\/BRL vs. IBOV<\/option>\r\n                    <option value=\"btc-spx\">BTC vs. S&P 500<\/option>\r\n                    <option value=\"btc-gold\">BTC vs. Gold<\/option>\r\n                    <option value=\"bitcoin-performance\">Bitcoin Performance<\/option>\r\n                    <option value=\"dca-calculator\">DCA Calculator<\/option>\r\n                    <option value=\"etf-data\">Bitcoin ETFs Data<\/option>\r\n                    <option value=\"bitcoin-treasuries\">Bitcoin Treasuries<\/option>\r\n                    <option value=\"microstrategy-ohlc\">MicroStrategy OHLC<\/option>\r\n                    <option value=\"microstrategy-treasuries\">MicroStrategy Treasuries<\/option>\r\n                <\/select>\r\n                <label for=\"testApiKey\">API Key:<\/label>\r\n                <input type=\"text\" id=\"testApiKey\" placeholder=\"Generate an API key\" required>\r\n                <label for=\"testDays\" id=\"testDaysLabel\">Days:<\/label>\r\n                <input type=\"number\" id=\"testDays\" value=\"30\" min=\"1\">\r\n                <label for=\"testInterval\" id=\"testIntervalLabel\">Interval:<\/label>\r\n                <select id=\"testInterval\">\r\n                    <option value=\"15m\">15m<\/option>\r\n                    <option value=\"30m\">30m<\/option>\r\n                    <option value=\"1h\">1h<\/option>\r\n                    <option value=\"2h\">2h<\/option>\r\n                    <option value=\"4h\">4h<\/option>\r\n                    <option value=\"1d\" selected>1d<\/option>\r\n                    <option value=\"1w\">1w<\/option>\r\n                    <option value=\"1mo\">1mo<\/option>\r\n                <\/select>\r\n                <label for=\"testPeriod\" id=\"testPeriodLabel\" style=\"display: none;\">Period:<\/label>\r\n                <select id=\"testPeriod\" style=\"display: none;\">\r\n                    <option value=\"12h\">12h<\/option>\r\n                    <option value=\"24h\">24h<\/option>\r\n                    <option value=\"48h\">48h<\/option>\r\n                    <option value=\"3day\">3day<\/option>\r\n                    <option value=\"1week\">1week<\/option>\r\n                    <option value=\"2week\">2week<\/option>\r\n                    <option value=\"1month\" selected>1month<\/option>\r\n                    <option value=\"2month\">2month<\/option>\r\n                    <option value=\"3month\">3month<\/option>\r\n                    <option value=\"6month\">6month<\/option>\r\n                    <option value=\"1year\">1year<\/option>\r\n                <\/select>\r\n                <button id=\"testApiButton\" onclick=\"testApi()\">Test API<\/button>\r\n                <button id=\"downloadCsvButton\" onclick=\"downloadResponse('csv')\" style=\"display: none;\">Download CSV<\/button>\r\n                <button id=\"downloadJsonButton\" onclick=\"downloadResponse('json')\" style=\"display: none;\">Download JSON<\/button>\r\n            <\/div>\r\n            <div class=\"api-test-response\" id=\"apiTestResponse\" style=\"display: none;\">\r\n                <div class=\"api-test-response-header\">\r\n                    <span id=\"responseSummary\"><\/span>\r\n                    <button onclick=\"copyResponse()\">Copy Response<\/button>\r\n                <\/div>\r\n                <pre id=\"responseContent\"><\/pre>\r\n            <\/div>\r\n            <div id=\"apiTestError\" class=\"api-test-error\" style=\"display: none;\"><\/div>\r\n            <div class=\"request-history\">\r\n                <h4>Request History<\/h4>\r\n                <ul id=\"requestHistory\"><\/ul>\r\n            <\/div>\r\n            <div class=\"endpoint-details\">\r\n                <h4>Endpoint Details<\/h4>\r\n                <p><strong>M2 Global Growth (\/api\/m2-global):<\/strong> Returns historical M2 supply data, year-over-year growth, and Bitcoin price at each point.<\/p>\r\n                <pre>[{\r\n    \"date\": \"2013-05-20T00:00:00.000Z\",\r\n    \"btcPrice\": 117.8186364699,\r\n    \"yoyGrowth\": 5.5654014717,\r\n    \"m2Supply\": 59166686473105\r\n}]<\/pre>\r\n                <p><strong>Open Interest (\/api\/open-interest):<\/strong> Historical open interest data for Bitcoin futures, including BTC price. Supports <code>days<\/code> and <code>interval<\/code> parameters.<\/p>\r\n                <pre>[{\r\n    \"timestamp\": \"2024-10-30T08:00:00.000Z\",\r\n    \"openInterest\": 89828.522,\r\n    \"price\": 72475.88\r\n}]<\/pre>\r\n                <p><strong>Long\/Short Ratio (\/api\/long-short-ratio):<\/strong> Aggregated long\/short ratio from major exchanges. Supports <code>days<\/code> and <code>interval<\/code> parameters.<\/p>\r\n                <pre>[{\r\n    \"timestamp\": \"2025-06-08T23:18:41.856Z\",\r\n    \"longShortRatio\": 1.25,\r\n    \"price\": 72475.88\r\n}]<\/pre>\r\n                <p><strong>Liquidations (Derivatives) (\/api\/liquidations):<\/strong> Historical liquidation data for Bitcoin derivatives, including long\/short breakdowns. Supports <code>days<\/code> and <code>interval<\/code> parameters.<\/p>\r\n                <pre>[{\r\n    \"timestamp\": \"2025-06-08T23:18:41.856Z\",\r\n    \"longLiquidations\": 12345.67,\r\n    \"shortLiquidations\": 9876.54,\r\n    \"totalLiquidations\": 22222.21\r\n}]<\/pre>\r\n                <p><strong>Funding Rate - Complete Data (\/api\/list-global-funding-rate):<\/strong> Aggregated global funding rate from major exchanges. Supports <code>days<\/code> and <code>interval<\/code> parameters.<\/p>\r\n                <pre>[{\r\n    \"timestamp\": \"2025-06-08T23:18:41.856Z\",\r\n    \"globalFundingRate\": -0.0027\r\n}]<\/pre>\r\n                <p><strong>Liquidation Heatmap (\/api\/liquidation-heatmap):<\/strong> Returns price ranges and liquidity values, sorted by price range. Supports <code>period<\/code> parameter.<\/p>\r\n                <pre>[{\r\n    \"priceRange\": 50000,\r\n    \"liquidity\": 1234567.89\r\n}, {\r\n    \"priceRange\": 50200,\r\n    \"liquidity\": 987654.32\r\n}]<\/pre>\r\n                <p><strong>MVRV Ratio (\/api\/mvrv):<\/strong> Market Value to Realized Value ratio for Bitcoin, indicating over\/undervaluation.<\/p>\r\n                <pre>[{\r\n    \"timestamp\": \"2025-06-08T23:18:41.856Z\",\r\n    \"mvrv\": 2.15\r\n}]<\/pre>\r\n                <p><strong>DXY (US Dollar Index) (\/api\/dxy):<\/strong> Historical US Dollar Index data, correlated with Bitcoin performance.<\/p>\r\n                <pre>[{\r\n    \"date\": \"2025-06-08T00:00:00.000Z\",\r\n    \"dxy\": 105.23,\r\n    \"btcPrice\": 72475.88\r\n}]<\/pre>\r\n                <p><strong>Request Limits:<\/strong> 200 requests per hour per API key, 100 per IP. Common errors: <code>401 Unauthorized<\/code> (invalid key), <code>429 Too Many Requests<\/code> (rate limit exceeded).<\/p>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/3.6.0\/jquery.min.js\"><\/script>\r\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.29.0\/prism.min.js\"><\/script>\r\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.29.0\/components\/prism-json.min.js\"><\/script>\r\n    <script>\r\n        let isApiKeyVisible = false;\r\n        let lastResponse = null;\r\n\r\n        function toggleApiKey() {\r\n            const apiKeyInput = document.getElementById('apiKeyInput');\r\n            if (!apiKeyInput.dataset.key) {\r\n                apiKeyInput.value = \"No key\";\r\n                return;\r\n            }\r\n            if (isApiKeyVisible) {\r\n                apiKeyInput.value = \"************\";\r\n                apiKeyInput.classList.add(\"hidden-key\");\r\n            } else {\r\n                apiKeyInput.value = apiKeyInput.dataset.key;\r\n                apiKeyInput.classList.remove(\"hidden-key\");\r\n            }\r\n            isApiKeyVisible = !isApiKeyVisible;\r\n        }\r\n\r\n        function loadApiKey() {\r\n            const apiKeyInput = document.getElementById('apiKeyInput');\r\n            const toggleButton = document.getElementById('toggleApiKey');\r\n            const testApiKeyInput = document.getElementById('testApiKey');\r\n\r\n            apiKeyInput.style.transition = \"opacity 0.5s ease\";\r\n            apiKeyInput.style.opacity = 0;\r\n\r\n            jQuery.ajax({\r\n                url: ajaxurl,\r\n                type: 'POST',\r\n                data: { action: 'get_api_key' },\r\n                success: function(response) {\r\n                    if (response.success && response.data.api_key) {\r\n                        apiKeyInput.dataset.key = response.data.api_key;\r\n                        apiKeyInput.value = \"************\";\r\n                        testApiKeyInput.value = response.data.api_key;\r\n                        toggleButton.disabled = false;\r\n                    } else {\r\n                        apiKeyInput.dataset.key = \"\";\r\n                        apiKeyInput.value = \"No API key\";\r\n                        testApiKeyInput.placeholder = \"Generate an API key first\";\r\n                    }\r\n                    apiKeyInput.style.opacity = 1;\r\n                    updateTestForm();\r\n                }\r\n            });\r\n        }\r\n\r\n        function generateApiKey() {\r\n            const loggedIn = document.body.classList.contains('logged-in');\r\n            if (!loggedIn) {\r\n                document.getElementById('errorMessage').innerText = 'You must be logged in to generate an API key.';\r\n                document.getElementById('errorMessage').style.display = 'block';\r\n                return;\r\n            }\r\n\r\n            document.getElementById('errorMessage').style.display = 'none';\r\n\r\n            jQuery.ajax({\r\n                url: ajaxurl,\r\n                type: 'POST',\r\n                data: { action: 'generate_api_key' },\r\n                success: function(response) {\r\n                    if (response.success) {\r\n                        document.getElementById('apiKeyInput').dataset.key = response.data.api_key;\r\n                        document.getElementById('testApiKey').value = response.data.api_key;\r\n                        toggleApiKey();\r\n                    } else {\r\n                        document.getElementById('errorMessage').innerText = 'Error generating API key.';\r\n                        document.getElementById('errorMessage').style.display = 'block';\r\n                    }\r\n                },\r\n                error: function() {\r\n                    document.getElementById('errorMessage').innerText = 'Server communication error.';\r\n                    document.getElementById('errorMessage').style.display = 'block';\r\n                }\r\n            });\r\n        }\r\n\r\n        function deleteApiKey() {\r\n            const loggedIn = document.body.classList.contains('logged-in');\r\n            const apiKeyInput = document.getElementById('apiKeyInput');\r\n            const errorDiv = document.getElementById('errorMessage');\r\n            const toggleButton = document.getElementById('toggleApiKey');\r\n\r\n            if (!loggedIn) {\r\n                errorDiv.innerText = 'You must be logged in to delete the API key.';\r\n                errorDiv.style.display = 'block';\r\n                return;\r\n            }\r\n\r\n            if (!apiKeyInput.dataset.key) {\r\n                errorDiv.innerText = 'No active API key to delete.';\r\n                errorDiv.style.display = 'block';\r\n                return;\r\n            }\r\n\r\n            if (typeof ajaxurl === 'undefined' || typeof ajax_object === 'undefined' || !ajax_object.nonce) {\r\n                errorDiv.innerText = 'Error: Invalid AJAX configuration. Contact the administrator.';\r\n                errorDiv.style.display = 'block';\r\n                console.error('ajaxurl or nonce not defined.');\r\n                return;\r\n            }\r\n\r\n            errorDiv.style.display = 'none';\r\n\r\n            jQuery.ajax({\r\n                url: ajaxurl,\r\n                type: 'POST',\r\n                data: {\r\n                    action: 'delete_api_key',\r\n                    nonce: ajax_object.nonce\r\n                },\r\n                success: function(response) {\r\n                    if (response.success) {\r\n                        apiKeyInput.value = 'No API key';\r\n                        apiKeyInput.dataset.key = '';\r\n                        document.getElementById('testApiKey').value = '';\r\n                        toggleButton.disabled = true;\r\n                        loadApiKey();\r\n                    } else {\r\n                        const errorMessage = response.data?.message || 'Error deleting API key.';\r\n                        errorDiv.innerText = errorMessage;\r\n                        errorDiv.style.display = 'block';\r\n                        console.error('Server response error:', response);\r\n                    }\r\n                },\r\n                error: function(jqXHR, textStatus, errorThrown) {\r\n                    const statusCode = jqXHR.status || 'Unknown';\r\n                    const responseText = jqXHR.responseText || 'No server response';\r\n                    let errorMessage = `Server communication error: ${textStatus} (Code ${statusCode})`;\r\n                    try {\r\n                        const responseJson = JSON.parse(responseText);\r\n                        if (responseJson.data && responseJson.data.message) {\r\n                            errorMessage += ` - ${responseJson.data.message}`;\r\n                        }\r\n                    } catch (e) {}\r\n                    errorDiv.innerText = errorMessage;\r\n                    errorDiv.style.display = 'block';\r\n                    console.error('AJAX error:', {\r\n                        status: statusCode,\r\n                        statusText: textStatus,\r\n                        errorThrown: errorThrown,\r\n                        responseText: responseText\r\n                    });\r\n                },\r\n                complete: function() {\r\n                    loadApiKey();\r\n                }\r\n            });\r\n        }\r\n\r\n        function updateTestForm() {\r\n            const endpoint = document.getElementById('testEndpoint').value;\r\n            const testDaysLabel = document.getElementById('testDaysLabel');\r\n            const testDays = document.getElementById('testDays');\r\n            const testIntervalLabel = document.getElementById('testIntervalLabel');\r\n            const testInterval = document.getElementById('testInterval');\r\n            const testPeriodLabel = document.getElementById('testPeriodLabel');\r\n            const testPeriod = document.getElementById('testPeriod');\r\n            const supportsFilters = ['open-interest', 'list-global-funding-rate'].includes(endpoint);\r\n            const supportsPeriod = endpoint === 'liquidation-heatmap';\r\n\r\n            testDaysLabel.style.display = supportsFilters ? 'inline' : 'none';\r\n            testDays.style.display = supportsFilters ? 'inline' : 'none';\r\n            testIntervalLabel.style.display = supportsFilters ? 'inline' : 'none';\r\n            testInterval.style.display = supportsFilters ? 'inline' : 'none';\r\n            testPeriodLabel.style.display = supportsPeriod ? 'inline' : 'none';\r\n            testPeriod.style.display = supportsPeriod ? 'inline' : 'none';\r\n        }\r\n\r\n        async function testApi() {\r\n            const endpoint = document.getElementById('testEndpoint').value;\r\n            const apiKey = document.getElementById('testApiKey').value;\r\n            const days = document.getElementById('testDays').value;\r\n            const interval = document.getElementById('testInterval').value;\r\n            const period = document.getElementById('testPeriod').value;\r\n            const testButton = document.getElementById('testApiButton');\r\n            const responseDiv = document.getElementById('apiTestResponse');\r\n            const responseContent = document.getElementById('responseContent');\r\n            const responseSummary = document.getElementById('responseSummary');\r\n            const errorDiv = document.getElementById('apiTestError');\r\n            const downloadCsvButton = document.getElementById('downloadCsvButton');\r\n            const downloadJsonButton = document.getElementById('downloadJsonButton');\r\n\r\n            if (!apiKey) {\r\n                errorDiv.textContent = 'Please provide a valid API key.';\r\n                errorDiv.style.display = 'block';\r\n                responseDiv.style.display = 'none';\r\n                return;\r\n            }\r\n\r\n            testButton.disabled = true;\r\n            testButton.textContent = 'Testing...';\r\n            responseDiv.style.display = 'none';\r\n            errorDiv.style.display = 'none';\r\n\r\n            let url = `https:\/\/api.bitcoincounterflow.com\/api\/${endpoint}?apikey=${encodeURIComponent(apiKey)}`;\r\n            if (['open-interest', 'list-global-funding-rate'].includes(endpoint)) {\r\n                url += `&days=${days}&interval=${interval}`;\r\n            } else if (endpoint === 'liquidation-heatmap') {\r\n                url += `&period=${period}`;\r\n            }\r\n\r\n            try {\r\n                const response = await fetch(url);\r\n                if (!response.ok) {\r\n                    throw new Error(`HTTP ${response.status}: ${response.statusText}`);\r\n                }\r\n                const data = await response.json();\r\n                lastResponse = data;\r\n                responseContent.textContent = JSON.stringify(data, null, 2);\r\n                responseSummary.textContent = Array.isArray(data) ? `Received ${data.length} records` : 'Received 1 record';\r\n                responseDiv.style.display = 'block';\r\n                downloadCsvButton.style.display = 'inline-block';\r\n                downloadJsonButton.style.display = 'inline-block';\r\n                Prism.highlightElement(responseContent);\r\n                addToRequestHistory(endpoint, days, interval, period, response.status);\r\n            } catch (error) {\r\n                errorDiv.textContent = `Error: ${error.message}`;\r\n                errorDiv.style.display = 'block';\r\n                lastResponse = null;\r\n                downloadCsvButton.style.display = 'none';\r\n                downloadJsonButton.style.display = 'none';\r\n            } finally {\r\n                testButton.disabled = false;\r\n                testButton.textContent = 'Test API';\r\n            }\r\n        }\r\n\r\n        function copyResponse() {\r\n            const responseContent = document.getElementById('responseContent').textContent;\r\n            navigator.clipboard.writeText(responseContent).then(() => {\r\n                alert('Response copied to clipboard!');\r\n            });\r\n        }\r\n\r\n        function downloadResponse(format) {\r\n            if (!lastResponse) return;\r\n\r\n            const filename = `api_response_${new Date().toISOString()}.${format}`;\r\n            let content, contentType;\r\n\r\n            if (format === 'csv' && Array.isArray(lastResponse)) {\r\n                const headers = Object.keys(lastResponse[0]).join(',');\r\n                const rows = lastResponse.map(row => Object.values(row).join(',')).join('\\n');\r\n                content = `${headers}\\n${rows}`;\r\n                contentType = 'text\/csv';\r\n            } else {\r\n                content = JSON.stringify(lastResponse, null, 2);\r\n                contentType = 'application\/json';\r\n            }\r\n\r\n            const blob = new Blob([content], { type: contentType });\r\n            const url = URL.createObjectURL(blob);\r\n            const a = document.createElement('a');\r\n            a.href = url;\r\n            a.download = filename;\r\n            a.click();\r\n            URL.revokeObjectURL(url);\r\n        }\r\n\r\n        function addToRequestHistory(endpoint, days, interval, period, status) {\r\n            const historyList = document.getElementById('requestHistory');\r\n            const timestamp = new Date().toLocaleString('en-US');\r\n            let params = '';\r\n            if (['open-interest', 'list-global-funding-rate'].includes(endpoint)) {\r\n                params = `, days=${days}, interval=${interval}`;\r\n            } else if (endpoint === 'liquidation-heatmap') {\r\n                params = `, period=${period}`;\r\n            }\r\n            const li = document.createElement('li');\r\n            li.textContent = `${timestamp} - ${endpoint} (Status: ${status}${params})`;\r\n            historyList.prepend(li);\r\n            if (historyList.children.length > 10) {\r\n                historyList.removeChild(historyList.lastChild);\r\n            }\r\n            localStorage.setItem('apiRequestHistory', historyList.innerHTML);\r\n        }\r\n\r\n        document.addEventListener('DOMContentLoaded', function() {\r\n            const searchInput = document.querySelector('.search-input');\r\n            const searchResults = document.getElementById('searchResults');\r\n            const errorDiv = document.getElementById('searchError');\r\n\r\n            function performSearch() {\r\n                const query = searchInput.value.trim().toLowerCase();\r\n                errorDiv.style.display = 'none';\r\n                searchResults.style.display = 'none';\r\n                searchResults.innerHTML = '<option value=\"\">Select a result...<\/option>';\r\n\r\n                if (!query) {\r\n                    return;\r\n                }\r\n\r\n                const sections = document.querySelectorAll('[id]');\r\n                let resultsFound = false;\r\n\r\n                sections.forEach(section => {\r\n                    const textContent = section.textContent.toLowerCase();\r\n                    if (textContent.includes(query)) {\r\n                        const titleElement = section.querySelector('h2, h3, h4') || section;\r\n                        const title = titleElement.textContent.substring(0, 50) + (titleElement.textContent.length > 50 ? '...' : '');\r\n                        const option = document.createElement('option');\r\n                        option.value = `#${section.id}`;\r\n                        option.textContent = title;\r\n                        searchResults.appendChild(option);\r\n                        resultsFound = true;\r\n                    }\r\n                });\r\n\r\n                if (resultsFound) {\r\n                    searchResults.style.display = 'block';\r\n                } else {\r\n                    errorDiv.textContent = 'No results found for your search.';\r\n                    errorDiv.style.display = 'block';\r\n                }\r\n            }\r\n\r\n            searchInput.addEventListener('input', performSearch);\r\n            searchResults.addEventListener('change', function() {\r\n                const selectedValue = this.value;\r\n                if (selectedValue) {\r\n                    window.location.href = selectedValue;\r\n                }\r\n            });\r\n\r\n            loadApiKey();\r\n            const historyList = document.getElementById('requestHistory');\r\n            const savedHistory = localStorage.getItem('apiRequestHistory');\r\n            if (savedHistory) {\r\n                historyList.innerHTML = savedHistory;\r\n            }\r\n        });\r\n    <\/script>\r\n<\/body>\r\n<\/html> \t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Nakamoto Pro Exclusive: Full access to the API and premium BitcoinCounterFlow data Manage Your API Key Generate or delete your API key to access data endpoints. \ud83d\udc41 Generate New Key Delete Key Select a result&#8230; Market Data M2 Global Growth Bitcoin Dominance Derivatives Data Open Interest (Supports days and interval) Exchanges Futures Volume (Latest) Long\/Short Ratio (Supports days and interval) Liquidations (Derivatives) (Supports days and interval) Liquidation Map Levels NEW (Supports period) Funding Rates Agg. Funding Rate (Supports days and interval) Agg. Funding Rate &#8211; Daily Data Agg. Funding Rate &#8211; Latest Minute Value Funding Rate &#8211; Latest by Exchange Funding Rate &#8211; Historical by Exchange Sentiment &#038; Valuation Indicators Google Trends &#8211; Current Cycle Google Trends &#8211; 10 Years Net Unrealized Profit\/Loss (NUPL) MVRV Ratio Macro Indicators DXY (US Dollar Index) Price Data BTC\/USDT BTC\/EUR BTC\/BRL BTC\/BRL vs. IBOV BTC vs. S&#038;P 500 BTC vs. Gold Performance Metrics All-Time High (ATH) ATH Drawdown (%) ATH Date Price Variation &#8211; 24h (%) Price Variation &#8211; 7d (%) Price Variation &#8211; 1M (%) Investment Data DCA Calculator (All Indices) Bitcoin ETFs Data Bitcoin Treasuries MicroStrategy OHLC Price and Volume MicroStrategy Treasuries Note: Our API is continuously enhanced to provide robust data access. Comprehensive documentation is forthcoming to streamline integration. Bitcoin CounterFlow Data API API Support: satoshi@bitcoincounterflow.com API Root Endpoint: https:\/\/api.bitcoincounterflow.com\/ The Bitcoin CounterFlow Data API provides access to price history, funding rates, open interest, liquidation data, and other macro Bitcoin metrics. Designed for traders, analysts, and developers requiring advanced data. API Usage Instructions Nakamoto Pro subscribers have exclusive access to all API endpoints. Append your API key to the URL using the apikey parameter. Explore examples and tools below to get started. Basic Usage: Add your API key to any endpoint. Example for M2 Global Growth: https:\/\/api.bitcoincounterflow.com\/api\/m2-global?apikey=YOUR_API_KEY Data Filtering: The open-interest, funding-rate, long-short, liquidations, and liquidation-heatmap endpoints support parameters for filtering and aggregation: Supported Intervals (open-interest, funding-rate, long-short-ratio, liquidations): 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1mo (30 days). Supported Periods (liquidation-heatmap): 12h, 24h, 48h, 3day, 1week, 2week, 1month, 2month, 3month, 6month. Example with Combined Parameters: https:\/\/api.bitcoincounterflow.com\/api\/liquidation-heatmap?period=1month&#038;apikey=YOUR_API_KEY Endpoint: M2 Global GrowthOpen InterestBitcoin DominanceExchanges Futures VolumeLong\/Short RatioLiquidations (Derivatives)Liquidation HeatmapFunding Rate &#8211; Complete DataFunding Rate &#8211; Daily DataFunding Rate &#8211; Latest ValueFunding Rate &#8211; Latest by ExchangeGoogle Trends &#8211; Current CycleGoogle Trends &#8211; 10 YearsNUPLMVRV RatioDXY (US Dollar Index)BTC\/USDTBTC\/EURBTC\/BRLBTC\/BRL vs. IBOVBTC vs. S&#038;P 500BTC vs. GoldBitcoin PerformanceDCA CalculatorBitcoin ETFs DataBitcoin TreasuriesMicroStrategy OHLCMicroStrategy Treasuries API Key: Days: Interval: 15m30m1h2h4h1d1w1mo Period: 12h24h48h3day1week2week1month2month3month6month1year Test API Download CSV Download JSON Copy Response Request History Endpoint Details M2 Global Growth (\/api\/m2-global): Returns historical M2 supply data, year-over-year growth, and Bitcoin price at each point. [{ &#8220;date&#8221;: &#8220;2013-05-20T00:00:00.000Z&#8221;, &#8220;btcPrice&#8221;: 117.8186364699, &#8220;yoyGrowth&#8221;: 5.5654014717, &#8220;m2Supply&#8221;: 59166686473105 }] Open Interest (\/api\/open-interest): Historical open interest data for Bitcoin futures, including BTC price. Supports days and interval parameters. [{ &#8220;timestamp&#8221;: &#8220;2024-10-30T08:00:00.000Z&#8221;, &#8220;openInterest&#8221;: 89828.522, &#8220;price&#8221;: 72475.88 }] Long\/Short Ratio (\/api\/long-short-ratio): Aggregated long\/short ratio from major exchanges. Supports days and interval parameters. [{ &#8220;timestamp&#8221;: &#8220;2025-06-08T23:18:41.856Z&#8221;, &#8220;longShortRatio&#8221;: 1.25, &#8220;price&#8221;: 72475.88 }] Liquidations (Derivatives) (\/api\/liquidations): Historical liquidation data for Bitcoin derivatives, including long\/short breakdowns. Supports days and interval parameters. [{ &#8220;timestamp&#8221;: &#8220;2025-06-08T23:18:41.856Z&#8221;, &#8220;longLiquidations&#8221;: 12345.67, &#8220;shortLiquidations&#8221;: 9876.54, &#8220;totalLiquidations&#8221;: 22222.21 }] Funding Rate &#8211; Complete Data (\/api\/list-global-funding-rate): Aggregated global funding rate from major exchanges. Supports days and interval parameters. [{ &#8220;timestamp&#8221;: &#8220;2025-06-08T23:18:41.856Z&#8221;, &#8220;globalFundingRate&#8221;: -0.0027 }] Liquidation Heatmap (\/api\/liquidation-heatmap): Returns price ranges and liquidity values, sorted by price range. Supports period parameter. [{ &#8220;priceRange&#8221;: 50000, &#8220;liquidity&#8221;: 1234567.89 }, { &#8220;priceRange&#8221;: 50200, &#8220;liquidity&#8221;: 987654.32 }] MVRV Ratio (\/api\/mvrv): Market Value to Realized Value ratio for Bitcoin, indicating over\/undervaluation. [{ &#8220;timestamp&#8221;: &#8220;2025-06-08T23:18:41.856Z&#8221;, &#8220;mvrv&#8221;: 2.15 }] DXY (US Dollar Index) (\/api\/dxy): Historical US Dollar Index data, correlated with Bitcoin performance. [{ &#8220;date&#8221;: &#8220;2025-06-08T00:00:00.000Z&#8221;, &#8220;dxy&#8221;: 105.23, &#8220;btcPrice&#8221;: 72475.88 }] Request Limits: 200 requests per hour per API key, 100 per IP. Common errors: 401 Unauthorized (invalid key), 429 Too Many Requests (rate limit exceeded).<\/p>\n","protected":false},"author":1,"featured_media":46285,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-48459","page","type-page","status-publish","has-post-thumbnail","hentry"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/pages\/48459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/comments?post=48459"}],"version-history":[{"count":0,"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/pages\/48459\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/media\/46285"}],"wp:attachment":[{"href":"https:\/\/bitcoincounterflow.com\/wp-json\/wp\/v2\/media?parent=48459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}