{"id":21711430,"url":"https://github.com/endenwer/tradingview-ws","last_synced_at":"2026-03-16T09:39:41.466Z","repository":{"id":37340241,"uuid":"454852268","full_name":"endenwer/tradingview-ws","owner":"endenwer","description":"TradingView data fetcher through websockets.","archived":false,"fork":false,"pushed_at":"2023-02-09T15:59:44.000Z","size":25,"stargazers_count":56,"open_issues_count":5,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-13T19:02:41.621Z","etag":null,"topics":["scrapper","trading","tradingview","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/endenwer.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-02T16:33:16.000Z","updated_at":"2025-04-03T19:49:46.000Z","dependencies_parsed_at":"2024-11-26T00:18:12.068Z","dependency_job_id":null,"html_url":"https://github.com/endenwer/tradingview-ws","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"97c743c8230f732e5a49646dd8f0f44c5981a458"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/endenwer/tradingview-ws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endenwer%2Ftradingview-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endenwer%2Ftradingview-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endenwer%2Ftradingview-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endenwer%2Ftradingview-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endenwer","download_url":"https://codeload.github.com/endenwer/tradingview-ws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endenwer%2Ftradingview-ws/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259320552,"owners_count":22840005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scrapper","trading","tradingview","websocket"],"created_at":"2024-11-25T23:22:35.451Z","updated_at":"2026-03-16T09:39:36.407Z","avatar_url":"https://github.com/endenwer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Tradingview websockets integration\nUnofficial library to interact with websockets on Tradingview.\n\nP.S. Check out this awesome trading journal app https://tradinglog.app.\n\n## Features\n- Realtime data from Tradingview\n- Authorization with session id from cookies\n- Fetching candlesticks for any symbol with any available timeframe\n\n## Example\n```ts\nimport { connect, getCandles } from 'tradingview-ws'\n\n(async function() {\n  const connection = await connect()\n  const candles = await getCandles({\n    connection,\n    symbols: ['FX:AUDCAD', 'FX:AUDCHF'],\n    amount: 10_000,\n    timeframe: 60\n  })\n  await connection.close()\n  console.log(`Candles for AUDCAD:`, candles[0])\n  console.log(`Candles for AUDCHF:`, candles[1])\n}());\n```\n\n## API\n\n### `connect(options: ConnectionOptions = {}): Promise\u003cTradingviewConnection\u003e`\n\nCreates new connection to tradingview websockets. Returns `TradingviewConnection`.\n\nOptions:\n\n* `sessionId?: string` - authorize connection if present. Can be received from cookies.\n\n### `getCandles({ connection, symbols, amount, timeframe = 60 }: GetCandlesParams)`\n\nFetches all available candles for symbols. The maximum amount is around 13_000 candles for the hourly timeframe. Returns an array where each element is an array of candles for one symbol in the order it passed to the function.\n\nOptions:\n\n* `connection: TradingviewConnection` - connection object\n* `symbols: string[]` - array of symbols. Symbol name can be found on Symbol info modal(click three dots after symbol name on the top left corner of the chart).\n* `timeframe?: number | '1D' | '1W' | '1M'` - candlestick timeframe, default is `60`\n* `amount?: number` - amount of candles to fetch. If not present, it will try to fetch as much as possible.\n\n### `TradingviewConnection`\n\nConnection object. Can be used directly to receive and send data to websockets.\n\nMethods:\n\n* `subscribe: (handler: Subscriber) =\u003e Unsubscriber` - subscribe to websockets events\n* `send: (name: string, params: any[]) =\u003e void` - send command to websockets\n* `close: () =\u003e Promise\u003cvoid\u003e` - close the connection\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendenwer%2Ftradingview-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendenwer%2Ftradingview-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendenwer%2Ftradingview-ws/lists"}