AutomationFlowsAI & RAG › Get Real-time Crypto Market Data From Bybit with Gpt-4.1-mini in Telegram

Get Real-time Crypto Market Data From Bybit with Gpt-4.1-mini in Telegram

ByDon Jayamaha Jr @don-the-gem-dealer on n8n.io

Instantly access live Bybit Spot Market data in Telegram!

Event trigger★★★★★ complexityAI-powered35 nodesOpenAI ChatTelegram TriggerTelegramMemory Buffer WindowTool CalculatorTool ThinkAgentHTTP Request Tool
AI & RAG Trigger: Event Nodes: 35 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #8610 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request Tool recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "INW3Qtj4GuhFO6L2",
  "name": "Bybit AI Agent v1.02",
  "tags": [],
  "nodes": [
    {
      "id": "e32639ff-0e71-4c35-8c73-79248687fc4f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1264,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5796edc7-641b-4a99-8620-3c547270d812",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1008,
        240
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f9886889-fb69-4af0-80b5-df3af4f1642d",
      "name": "User Authentication (Replace Telegram ID)",
      "type": "n8n-nodes-base.code",
      "position": [
        -688,
        240
      ],
      "parameters": {
        "jsCode": "if ($input.first().json.message.from.id !== <<Replace>>) { // Replace with your actual ID\n  return {unauthorized: true};\n} else {\n  // Return the original data when authorized\n  return $input.all();\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "0233f87d-57bf-4c05-9cd0-a1ffec8ba86d",
      "name": "Adds \"SessionId\"",
      "type": "n8n-nodes-base.set",
      "position": [
        -416,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "47598bf1-e55f-4cc0-ae75-272085e7ce02",
              "name": "=sessionId",
              "type": "string",
              "value": "={{ $json.message.chat.id }}"
            },
            {
              "id": "daa49d74-e55e-47bc-ac52-8686d591ab83",
              "name": "message",
              "type": "string",
              "value": "={{ $json.message.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "27aed875-b9f5-4957-be94-9d46fca3a256",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        896,
        240
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7a47dd07-a50c-4dec-a42d-6e4c89b6cb8d",
      "name": "Splits message is more than 4000 characters",
      "type": "n8n-nodes-base.code",
      "position": [
        464,
        240
      ],
      "parameters": {
        "jsCode": "// Input: assumes incoming message in `item.json.message`\nconst input = $json.output;\nconst chunkSize = 4000;\n\n// Function to split text\nfunction splitMessage(text, size) {\n  const result = [];\n  for (let i = 0; i < text.length; i += size) {\n    result.push(text.substring(i, i + size));\n  }\n  return result;\n}\n\n// Logic\nif (input.length <= chunkSize) {\n  return [{ json: { message: input } }];\n} else {\n  const chunks = splitMessage(input, chunkSize);\n  return chunks.map(chunk => ({ json: { message: chunk } }));\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "0889b0f3-3b16-4646-844b-878523afe513",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -32
      ],
      "parameters": {
        "color": 4,
        "height": 460,
        "content": "## Trigger Incoming Telegram Command\nNode: Telegram Trigger\n**Listens for new Telegram messages** from users.\nTriggers the full agent process and passes raw user input downstream."
      },
      "typeVersion": 1
    },
    {
      "id": "84f4f69f-6008-476e-b05f-4425d255c90d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -32
      ],
      "parameters": {
        "color": 2,
        "height": 460,
        "content": "## Validate User Access\nNode: User **Authentication\nChecks incoming Telegram ID** against the approved user list."
      },
      "typeVersion": 1
    },
    {
      "id": "6b8248f1-97fe-4543-a7c4-61dd61adf9c8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -32
      ],
      "parameters": {
        "color": 5,
        "height": 460,
        "content": "## Generate Session Metadata\nNode: Add S**essionId\nCreates a sessionId using the Telegram chat_id**.\nThis is passed into all downstream tools for memory and workflow routing."
      },
      "typeVersion": 1
    },
    {
      "id": "d47c30da-9fa6-4b32-be89-403dccfc0c18",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 756,
        "content": "## Main AI Agent: Data Fetcher\n\n**Node: Bybit Data Agent**\nThis is the **core orchestrator**. It uses OpenAI only to **format and present raw Bybit Spot market data**, not to analyze or generate strategies.\n\nIt has direct **HTTP request access** to the Bybit REST **v5 Spot API** and retrieves:\n\n* **Latest price & 24h stats** (`/v5/market/tickers`)\n* **Order book depth** (`/v5/market/orderbook`)\n* **Best bid/ask** (`/v5/market/orderbook?limit=1`)\n* **Klines/candlesticks** (`/v5/market/kline`)\n* **Recent public trades** (`/v5/market/recent-trade`)\n\nThe agent calls these endpoints in parallel for the requested symbol, validates results, and then **presents the data in clean Telegram HTML format**.\n\nIt does **not**:\n\n* Perform technical analysis\n* Generate strategies or predictions\n* Fetch sentiment or news\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "88706b84-fa2b-4744-9789-ca4f684fe6c4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -32
      ],
      "parameters": {
        "color": 5,
        "width": 260,
        "height": 460,
        "content": "## Handle Telegram Message Limits\nNode: Code (split logic)\nChecks if the **GPT output exceeds 4000 characters**.\nIf so, it splits the message into safe chunks and passes them on sequentially."
      },
      "typeVersion": 1
    },
    {
      "id": "88257edc-46d3-4308-97c1-d3994c77ef21",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -32
      ],
      "parameters": {
        "color": 4,
        "height": 460,
        "content": "## Send Final Report to Telegram\nNode: Telegram sendMessage\nSends **formatted HTML report (or split chunks)** directly to the authenticated user via Telegram bot."
      },
      "typeVersion": 1
    },
    {
      "id": "4822fbae-1d0d-4c5c-8e7d-de9c6d6a7fe4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        640
      ],
      "parameters": {
        "height": 540,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## GPT Model for Reasoning\nNode: OpenAI Chat Model\nModel: **gpt-4o-mini**\nUsed to:\n\nInterpret signal values\n\nGenerate structured HTML\n\n**Recommend spot and leverage trades**\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9f342b49-a4c5-4e69-843b-b5441cb63c4c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 884,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Order Book Depth**\n\n**Endpoint:** `GET /v5/market/orderbook`\n**What it does:** Returns order book bids/asks up to `limit` for a symbol.\n\n**Params:**\n\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `limit` (INT, optional; default 25; max 5000)\n\n**Returns:** bid/ask arrays with price and size.\n\n**n8n query mapping:**\n\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\nlimit    = $fromAI('limit', 100, 'number')\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "c8140a94-2d1b-4a85-8a7f-f8213394e0f9",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 868,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Best Bid/Ask (Book Ticker)**\n\n**Endpoint:** `GET /v5/market/orderbook`\n**What it does:** Returns the current order book. Using `limit=1` gives the **best bid/ask** (top of book).\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `limit` (INT, optional, default 1)\n\n**Returns:** top of book with bid/ask price and size arrays.\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\nlimit    = 1\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "79749296-1b46-4e5e-abb7-6aadc72f4897",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        640
      ],
      "parameters": {
        "color": 3,
        "height": 540,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Short-Term Memory Module\nNode: **Simple Memory\nStores the sessionId**, symbol, and other state data.\nUseful for:\n\nMulti-turn Telegram interactions\n\nTracking indicator agreement across timeframes\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a3a95f1c-1fbb-4319-b4c8-2558258179b9",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -992,
        736
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "844d30b6-13c0-4578-ba56-d7b7509e3de9",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 948,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **24h Stats (Ticker)**\n\n**Endpoint:** `GET /v5/market/tickers`\n**What it does:** Returns latest price and 24h stats for a Spot symbol: last price, best bid/ask, 24h high/low, 24h change %, turnover and volume.\n\n**Params:**\n\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, optional but recommended) \u2192 e.g., BTCUSDT\n\n**Returns:** Bybit ticker fields such as `lastPrice`, `bid1Price`, `ask1Price`, `highPrice24h`, `lowPrice24h`, `price24hPcnt`, `turnover24h`, `volume24h`.\n\n**n8n query mapping:**\n\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "7622838f-8e7a-4e82-82df-da0ea7474de6",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 772,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Price (Latest)**\n\n**Endpoint:** `GET /v5/market/tickers`\n**What it does:** Returns the latest price and 24h stats for a symbol.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n\n**Returns:** includes lastPrice, bid1Price, ask1Price, highPrice24h, lowPrice24h, volume24h, etc.\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "0fc5427f-394a-4faf-b76f-f0bf4cbfc493",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 1060,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Klines (Candles)**\n\n**Endpoint:** `GET /v5/market/kline`\n**What it does:** Returns candlestick (OHLCV) bars for a spot symbol and interval.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `interval` (STRING, required) \u2192 supported: `1,3,5,15,30,60,120,240,360,720,D,W,M`\n* `limit` (INT, optional, default 20)\n* `start` (LONG, optional, ms timestamp)\n* `end` (LONG, optional, ms timestamp)\n\n**Returns (array per candle):** `[ startTime, open, high, low, close, volume, turnover ]`\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\ninterval = $fromAI('interval', '15', 'string')\nlimit    = $fromAI('limit', 20, 'number')\nstart    = $fromAI('start', '', 'number')\nend      = $fromAI('end', '', 'number')\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "403afddb-0349-4949-8597-919a7569ed11",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 964,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Ticker (Latest & Stats)**\n\n**Endpoint:** `GET /v5/market/tickers`\n**What it does:** Returns the latest price, best bid/ask, 24h high/low, % change, and volume for a symbol.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n\n**Returns:** `{symbol, lastPrice, bid1Price, bid1Size, ask1Price, ask1Size, highPrice24h, lowPrice24h, volume24h, turnover24h}`\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\n```\n\n**Notes:** Bybit has no `/avgPrice`; derive midpoint `(bid1Price + ask1Price) / 2` in the Calculator node if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "e891654a-fd49-439e-acf5-ded1cca0cb96",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 836,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Recent Trades**\n\n**Endpoint:** `GET /v5/market/recent-trade`\n**What it does:** Returns the most recent public trades for a given symbol.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `limit` (INT, optional, default 100, max 1000)\n\n**Returns:** array of trades `{execId, price, size, side, time}`.\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('parameters0_Value', '', 'string')\nlimit    = $fromAI('parameters1_Value', 100, 'number')\n```"
      },
      "typeVersion": 1
    },
    {
      "id": "2c225033-748b-442c-b674-3116a1457081",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        1520,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ee219272-a31f-4556-9ad1-5537b48d2cd6",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1808,
        592
      ],
      "parameters": {
        "description": "### \ud83c\udff7 Tool: **Think**\n\n**Purpose:**\n\n* Lightweight **reasoning helper**.\n* Lets the AI Agent process intermediate logic, format outputs, or decide how to combine multiple API results before sending the final report.\n* Does not fetch data itself.\n\n**Use cases:**\n\n* Clean/reshape JSON from Binance endpoints\n* Extract only the needed fields (e.g., `lastPrice`, `volume`)\n* Help prepare data for Telegram message formatting\n\n**n8n setup notes:**\n\n* No API call, just an **AI Tool** node.\n* Connect upstream API results \u2192 Think \u2192 Report Agent."
      },
      "typeVersion": 1.1
    },
    {
      "id": "acda52e9-0932-4ba0-839e-393ea9e5e445",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 836,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Calculator**\n\n**Purpose:**\n\n* Perform **math operations** inside the workflow.\n* Supports add/subtract/multiply/divide, percentages, rounding, etc.\n\n**Use cases:**\n\n* Calculate spreads (ask \u2013 bid)\n* Compute % changes from open vs. last price\n* Normalize volumes or confidence scores\n\n**n8n setup notes:**\n\n* Node: `Calculator` (n8n built-in)\n* Input fields can come from Binance API JSON\n* Output can be chained into Think \u2192 Final Report\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6de0d578-222b-4e31-8601-94c127bf7fbe",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        512
      ],
      "parameters": {
        "color": 6,
        "height": 932,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### **Think**\n\n**Purpose:**\n\n* Lightweight **reasoning helper**.\n* Lets the AI Agent process intermediate logic, format outputs, or decide how to combine multiple API results before sending the final report.\n* Does not fetch data itself.\n\n**Use cases:**\n\n* Clean/reshape JSON from Binance endpoints\n* Extract only the needed fields (e.g., `lastPrice`, `volume`)\n* Help prepare data for Telegram message formatting\n\n**n8n setup notes:**\n\n* No API call, just an **AI Tool** node.\n* Connect upstream API results \u2192 Think \u2192 Report Agent."
      },
      "typeVersion": 1
    },
    {
      "id": "4b1a57e5-d6e8-4399-b67b-a0ff74d8aff4",
      "name": "Bybit  AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -96,
        240
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "You are the **Bybit Spot Market Data Agent**.\nYou have **HTTP GET** access to the official Bybit REST **v5** API to retrieve market data for any requested **Spot** trading pair.\nYour job is to **fetch and present data only** \u2014 no analysis, predictions, or advice.\n\n## API Access\n\n* Base URL: `https://api.bybit.com/v5`\n* Pair format: `BASEQUOTE` (uppercase, no separator), e.g. `BTCUSDT`.\n* Always include `category=spot` on market endpoints.\n* If a field or call fails, output `N/A` and continue.\n\n## Market Data Endpoints (Spot)\n\n1. **Latest price & 24h stats**\n   `GET /market/tickers?category=spot&symbol=BTCUSDT`\n   Returns last price, best bid/ask, 24h high/low, % change, turnover/volume.&#x20;\n\n2. **Order book depth**\n   `GET /market/orderbook?category=spot&symbol=BTCUSDT&limit=100`\n   Snapshot of bids/asks (Spot supports 1\u2013200; default 1). Use `limit=1` to emulate Best Bid/Ask.&#x20;\n\n3. **Recent public trades**\n   `GET /market/recent-trade?category=spot&symbol=BTCUSDT&limit=60`\n   Most recent trades (Spot limit 1\u201360; default 60).&#x20;\n\n4. **Candlesticks (klines)**\n   `GET /market/kline?category=spot&symbol=BTCUSDT&interval=15&limit=200`\n   OHLCV candles. Use only these intervals to match other agents: **1, 15, 60, 240, D** (1min, 15min, 1h, 4h, 1day).&#x20;\n\n## Optional Utility Endpoints\n\n* **Server time**: `GET /market/time` \u2192 Bybit server timestamps (sec/nano).&#x20;\n* **Order price limit**: `GET /market/price-limit?category=spot&symbol=BTCUSDT` \u2192 current buy/sell limit prices (spot/derivatives).&#x20;\n\n## Output Format (Telegram text)\n\nStart with:\n\n```\nBTCUSDT \u2014 Bybit Spot Data\n```\n\nThen:\n\n```\nPrice\n\u2022 Last: {{lastPrice}}\n\u2022 Best Bid / Ask: {{bid1Price}} / {{ask1Price}}\n\u2022 Change (24h): {{price24hPcnt}}%\n\n24h Stats\n\u2022 High: {{highPrice24h}} \u2022 Low: {{lowPrice24h}}\n\u2022 Volume(24h): {{volume24h}} \u2022 Turnover(24h): {{turnover24h}}\n\nOrder Book (Top 5)\n\u2022 Bids: [price x size] \u2026\n\u2022 Asks: [price x size] \u2026\n\nCandles (latest N)\n\u2022 Interval: {{interval}} (O/H/L/C per candle)\n```\n\n## Rules\n\n* Call the correct **Bybit v5 Spot** endpoint for each request.\n* Do not fabricate values or provide analysis/sentiment.\n* Do not dump raw JSON; present clean, readable values.\n* On error or missing fields, show `N/A` and continue.\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "41e95ef0-7957-44c5-ae8f-faebc894b28b",
      "name": "24h Stats1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -704,
        608
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/tickers",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('symbol', `BTCUSDT`, 'string') }}"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **24h Stats (Ticker)**\n\n**Endpoint:** `GET /v5/market/tickers`\n**What it does:** Returns latest price and 24h stats for a Spot symbol: last price, best bid/ask, 24h high/low, 24h change %, turnover and volume.\n\n**Params:**\n\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, optional but recommended) \u2192 e.g., BTCUSDT\n\n**Returns:** Bybit ticker fields such as `lastPrice`, `bid1Price`, `ask1Price`, `highPrice24h`, `lowPrice24h`, `price24hPcnt`, `turnover24h`, `volume24h`.\n\n**n8n query mapping:**\n\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\n```"
      },
      "typeVersion": 4.2
    },
    {
      "id": "dbb8ad4d-0e57-4abf-809e-c759457a06a9",
      "name": "Order Book Depth1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -416,
        608
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/orderbook",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('symbol', `BTCUSDT`, 'string') }}"
            },
            {
              "name": "limit",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('limit', `100`, 'number') }}"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **Order Book Depth**\n\n**Endpoint:** `GET /v5/market/orderbook`\n**What it does:** Returns order book bids/asks up to `limit` for a symbol.\n\n**Params:**\n\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `limit` (INT, optional; default 25; max 5000)\n\n**Returns:** bid/ask arrays with price and size.\n\n**n8n query mapping:**\n\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\nlimit    = $fromAI('limit', 100, 'number')\n```"
      },
      "typeVersion": 4.2
    },
    {
      "id": "e6fcff06-babc-4167-ad9a-13a07b66723b",
      "name": "Price (Latest)1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -128,
        608
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/tickers",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('symbol', `BTCUSDT`, 'string') }}"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **Price (Latest)**\n\n**Endpoint:** `GET /v5/market/tickers`\n**What it does:** Returns the latest price and 24h stats for a symbol.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n\n**Returns:** includes lastPrice, bid1Price, ask1Price, highPrice24h, lowPrice24h, volume24h, etc.\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\n```"
      },
      "typeVersion": 4.2
    },
    {
      "id": "850c7e5a-b61b-4618-a158-7c505086252c",
      "name": "Best Bid/Ask1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        208,
        592
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/orderbook",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('symbol', `BTCUSDT`, 'string') }}"
            },
            {
              "name": "limit",
              "value": "1"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **Best Bid/Ask (Book Ticker)**\n\n**Endpoint:** `GET /v5/market/orderbook`\n**What it does:** Returns the current order book. Using `limit=1` gives the **best bid/ask** (top of book).\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `limit` (INT, optional, default 1)\n\n**Returns:** top of book with bid/ask price and size arrays.\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\nlimit    = 1\n```"
      },
      "typeVersion": 4.2
    },
    {
      "id": "a60a8ec4-3aca-4958-b87b-f68fc522e3e7",
      "name": "Klines (Candles)1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        544,
        592
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/kline",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('symbol', `BTCUSDT`, 'string') }}"
            },
            {
              "name": "interval",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('interval', `15`, 'string') }}"
            },
            {
              "name": "limit",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('limit', `20`, 'number') }}"
            },
            {
              "name": "start",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('start', ``, 'number') }}"
            },
            {
              "name": "end",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('end', ``, 'number') }}"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **Klines (Candles)**\n\n**Endpoint:** `GET /v5/market/kline`\n**What it does:** Returns candlestick (OHLCV) bars for a spot symbol and interval.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `interval` (STRING, required) \u2192 supported: `1,3,5,15,30,60,120,240,360,720,D,W,M`\n* `limit` (INT, optional, default 20)\n* `start` (LONG, optional, ms timestamp)\n* `end` (LONG, optional, ms timestamp)\n\n**Returns (array per candle):** `[ startTime, open, high, low, close, volume, turnover ]`\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\ninterval = $fromAI('interval', '15', 'string')\nlimit    = $fromAI('limit', 20, 'number')\nstart    = $fromAI('start', '', 'number')\nend      = $fromAI('end', '', 'number')\n```"
      },
      "typeVersion": 4.2
    },
    {
      "id": "d128abbd-cac6-4c17-bc95-3fc4e3ba2651",
      "name": "Ticker (Latest & Stats)",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        880,
        592
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/tickers",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('symbol', `BTCUSDT`, 'string') }}"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **Ticker (Latest & Stats)**\n\n**Endpoint:** `GET /v5/market/tickers`\n**What it does:** Returns the latest price, best bid/ask, 24h high/low, % change, and volume for a symbol.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n\n**Returns:** `{symbol, lastPrice, bid1Price, bid1Size, ask1Price, ask1Size, highPrice24h, lowPrice24h, volume24h, turnover24h}`\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('symbol', 'BTCUSDT', 'string')\n```\n\n**Notes:** Bybit has no `/avgPrice`; derive midpoint `(bid1Price + ask1Price) / 2` in the Calculator node if needed."
      },
      "typeVersion": 4.2
    },
    {
      "id": "b97f8b36-a8c5-449d-9df7-279daa00ae50",
      "name": "Recent Trades1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1200,
        608
      ],
      "parameters": {
        "url": "https://api.bybit.com/v5/market/recent-trade",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "category",
              "value": "spot"
            },
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            },
            {
              "name": "limit",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters1_Value', `100`, 'number') }}"
            }
          ]
        },
        "toolDescription": "### \ud83c\udff7 Tool: **Recent Trades**\n\n**Endpoint:** `GET /v5/market/recent-trade`\n**What it does:** Returns the most recent public trades for a given symbol.\n\n**Params:**\n* `category` (STRING, required) \u2192 `spot`\n* `symbol` (STRING, required) \u2192 e.g., BTCUSDT\n* `limit` (INT, optional, default 100, max 1000)\n\n**Returns:** array of trades `{execId, price, size, side, time}`.\n\n**n8n query mapping:**\n```txt\ncategory = 'spot'\nsymbol   = $fromAI('parameters0_Value', '', 'string')\nlimit    = $fromAI('parameters1_Value', 100, 'number')\n```"
      },
      "typeVersion": 4.2
    },
    {
      "id": "b91c3be7-60e1-4309-a195-14cc2cb35a8a",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        -1408
      ],
      "parameters": {
        "width": 1168,
        "height": 3920,
        "content": "# \ud83d\udcd8 Bybit AI Agent v1.02 Documentation\n\n## Overview\n\nThis workflow connects **Telegram \u2192 Bybit Spot REST API (v5)** \u2192 **OpenAI Formatter**, returning **clean market data** to a user.\nIt does **not** provide predictions, advice, or strategy \u2014 only structured data fetch + formatting.\n\n---\n\n## \ud83d\udd39 Telegram Layer\n\n* **Telegram Trigger**\n  Listens for incoming user messages. Starts the workflow.\n\n* **User Authentication (Code node)**\n  Ensures only the approved Telegram user ID can access the bot.\n  If ID \u2260 allowed, workflow halts.\n\n* **Adds SessionId (Set node)**\n  Stores:\n\n  * `sessionId = chat.id`\n  * `message = user input text`\n    Used for memory + message routing.\n\n---\n\n## \ud83d\udd39 Memory Layer\n\n* **Simple Memory (Buffer Window)**\n  Keeps session context (symbol, interval, etc.) across multiple turns.\n  Useful for multi-turn conversations.\n\n---\n\n## \ud83d\udd39 AI Layer\n\n* **OpenAI Chat Model (gpt-4.1-mini)**\n  Interprets user queries and coordinates tool calls.\n\n* **Bybit AI Agent (Agent node)**\n\n  * Attached tools:\n\n    * 24h Stats\n    * Price (Latest)\n    * Order Book Depth\n    * Best Bid/Ask\n    * Klines (Candles)\n    * Ticker (Latest & Stats)\n    * Recent Trades\n    * Calculator\n    * Think\n  * Uses system prompt to enforce **fetch-only rules**.\n  * Formats output into Telegram-ready HTML text.\n\n* **Think Tool**\n  Reshapes JSON, extracts fields, preps data for reporting.\n  Does not fetch data.\n\n* **Calculator Tool**\n  Runs inline math: spreads, % changes, midpoints, etc.\n\n---\n\n## \ud83d\udd39 Bybit Spot API Tools\n\n### 1. \ud83d\udcca 24h Stats (Ticker)\n\n`GET /v5/market/tickers`\n\n* Params: `category=spot`, `symbol=BTCUSDT`\n* Returns: `lastPrice`, `bid1Price`, `ask1Price`, `highPrice24h`, `lowPrice24h`, `price24hPcnt`, `turnover24h`, `volume24h`\n\n---\n\n### 2. \ud83d\udcb0 Price (Latest)\n\n`GET /v5/market/tickers`\n\n* Params: `category=spot`, `symbol=BTCUSDT`\n* Returns: same as above, focused on latest price.\n\n---\n\n### 3. \ud83d\udcda Order Book Depth\n\n`GET /v5/market/orderbook`\n\n* Params: `category=spot`, `symbol=BTCUSDT`, `limit=100`\n* Returns: full bid/ask arrays with price + size.\n\n---\n\n### 4. \ud83c\udfaf Best Bid/Ask (Book Ticker)\n\n`GET /v5/market/orderbook?limit=1`\n\n* Returns: top of book bid/ask.\n\n---\n\n### 5. \ud83d\udd6f Klines (Candles)\n\n`GET /v5/market/kline`\n\n* Params:\n\n  * `category=spot`\n  * `symbol=BTCUSDT`\n  * `interval=1,15,60,240,D`\n  * `limit=20`\n* Returns: OHLCV bars `[time, open, high, low, close, volume, turnover]`.\n\n---\n\n### 6. \ud83d\udccc Ticker (Latest & Stats)\n\n`GET /v5/market/tickers`\n\n* Params: `category=spot`, `symbol=BTCUSDT`\n* Returns: `{lastPrice, bid1Price, ask1Price, highPrice24h, lowPrice24h, volume24h}`\n* \u26a0\ufe0f No `/avgPrice` \u2192 derive midpoint with Calculator.\n\n---\n\n### 7. \ud83d\udd04 Recent Trades\n\n`GET /v5/market/recent-trade`\n\n* Params: `category=spot`, `symbol=BTCUSDT`, `limit=100`\n* Returns: `{execId, price, size, side, time}` array.\n\n---\n\n## \ud83d\udd39 Message Handling\n\n* **Split Message (Code node)**\n  Telegram limit = 4096 chars. Splits output into chunks if longer than 4000.\n\n* **Telegram SendMessage**\n  Sends final formatted HTML report (or split chunks) to authenticated user.\n\n---\n\n## \ud83d\udd39 Output Format (Telegram)\n\n```\nBTCUSDT \u2014 Bybit Spot Data\n\nPrice\n\u2022 Last: 63,212.50\n\u2022 Best Bid / Ask: 63,210.80 / 63,214.20\n\u2022 Change (24h): +1.2%\n\n24h Stats\n\u2022 High: 64,000.00 \u2022 Low: 61,500.00\n\u2022 Volume(24h): 12,345 \u2022 Turnover(24h): 789M\n\nOrder Book (Top 5)\n\u2022 Bids: [63210.8 x 0.5], \u2026\n\u2022 Asks: [63214.2 x 0.3], \u2026\n\nCandles (15m, latest 5)\n\u2022 O: 63200 H: 63220 L: 63150 C: 63212\n```\n\n\n---\n\n## \ud83d\ude80 Support & Licensing\n\n\ud83d\udd17 **Don Jayamaha \u2013 LinkedIn**\n[linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n\u00a9 2025 Treasurium Capital Limited Company.\nAll rights reserved. This system architecture, prompts, and workflow structure are proprietary and protected by **U.S. copyright law**.\nReuse or resale prohibited without license."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f2c0d0c4-cb82-42ed-abab-e92908715c43",
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "24h Stats1": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Best Bid/Ask1": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Recent Trades1": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Bybit  AI Agent": {
      "main": [
        [
          {
            "node": "Splits message is more than 4000 characters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Price (Latest)1": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Adds \"SessionId\"": {
      "main": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "User Authentication (Replace Telegram ID)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Klines (Candles)1": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Order Book Depth1": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Ticker (Latest & Stats)": {
      "ai_tool": [
        [
          {
            "node": "Bybit  AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "User Authentication (Replace Telegram ID)": {
      "main": [
        [
          {
            "node": "Adds \"SessionId\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Splits message is more than 4000 characters": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Instantly access live Bybit Spot Market data in Telegram!

Source: https://n8n.io/workflows/8610/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Jarvis is a powerful multi-agent productivity assistant built in n8n. It works directly from Telegram and can understand both text messages and voice notes.

Telegram Trigger, Telegram, OpenAI +10
AI & RAG

This multi-agent n8n workflow delivers an automated, intelligent trading analysis system for the WEEX Spot Market. It uses GPT-4o to interpret user prompts, route them to the correct sub-agent tools,

OpenAI Chat, Telegram Trigger, Agent +7
AI & RAG

AI-powered Telegram bot for effortless expense tracking. Send receipts, voice messages, or text - the bot automatically extracts and categorizes your expenses. 📸 Receipt & Invoice OCR - Send photos of

Telegram Trigger, Mcp Client Tool, Tool Calculator +7
AI & RAG

This template is designed for anyone who wants to use Telegram as a personal AI assistant hub. If you often juggle tasks, emails, calendars, and expenses across multiple tools, this workflow consolida

OpenAI Chat, Memory Buffer Window, Mcp Client Tool +11
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Output Parser Structured, Telegram, N8N Nodes Tesseractjs +14