{"id":19269023,"url":"https://github.com/borgoat/ex_twelve_data","last_synced_at":"2026-06-13T06:32:24.331Z","repository":{"id":61047324,"uuid":"495513980","full_name":"borgoat/ex_twelve_data","owner":"borgoat","description":"Elixir client for Twelve Data","archived":false,"fork":false,"pushed_at":"2023-11-22T16:50:58.000Z","size":53,"stargazers_count":1,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-21T14:58:24.971Z","etag":null,"topics":["elixir","twelve-data","twelvedata","websocket"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/borgoat.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}},"created_at":"2022-05-23T17:42:54.000Z","updated_at":"2022-12-11T19:49:59.000Z","dependencies_parsed_at":"2023-11-22T17:51:28.745Z","dependency_job_id":null,"html_url":"https://github.com/borgoat/ex_twelve_data","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"17d2142018c483b76dabb6454e2bf06ab47ff1bc"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/borgoat/ex_twelve_data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borgoat%2Fex_twelve_data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borgoat%2Fex_twelve_data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borgoat%2Fex_twelve_data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borgoat%2Fex_twelve_data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borgoat","download_url":"https://codeload.github.com/borgoat/ex_twelve_data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borgoat%2Fex_twelve_data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34275066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["elixir","twelve-data","twelvedata","websocket"],"created_at":"2024-11-09T20:18:10.159Z","updated_at":"2026-06-13T06:32:24.316Z","avatar_url":"https://github.com/borgoat.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExTwelveData\n\nUnofficial Elixir client for [Twelve Data](https://twelvedata.com/).\n\nCurrently, it only covers the real-time prices WebSocket API.\n\nHappy to accept contributions to support the other endpoints.\n\n## Usage\n\n### Real-time prices client\n\nTwelve Data offers a WebSocket based API for real-time prices[^1].\nExTwelveData uses the [WebSockex](https://github.com/Azolo/websockex)\nlibrary to access this endpoint.\nBecause of this, the WebSocket client runs as a supervised process.\n\nThe `ExTwelveData.RealTimePrices.Handler` behaviour requires a single callback,\ninvoked whenever the client receives a price update from Twelve Data.\n\n```elixir\ndefmodule Your.Handler do\n  @behaviour ExTwelveData.RealTimePrices.Handler\n  \n  @impl true\n  def handle_price_update(price) do\n    # Here you can process inbound price updates\n    :ok\n  end  \nend\n\ndefmodule Your.Application do\n  use Application\n  alias ExTwelveData.RealTimePrices\n  \n  def start(_type, _args) do\n    children = [\n      {RealTimePrices, name: Your.Name, api_key: \"abc\", handler: Your.Handler},\n    ]\n    \n    Supervisor.start_link(children, strategy: :one_for_one)\n  end\nend\n```\n\nWith the process running, you can now subscribe, unsubscribe, and reset the subscriptions.\n\n```elixir\n# Send a list of Twelve Data symbols to subscribe to\nExTwelveData.RealTimePrices.subscribe(Your.Name, [\"BTC/USD\", \"AAPL\"])\n\n# Use the PID or process name to address the messages\nExTwelveData.RealTimePrices.unsubscribe(Your.Name, [\"AAPL\"])\n\n# This stops listening for all updates, while keeping the client running\nExTwelveData.RealTimePrices.reset(Your.Name)\n```\n\nThe client currently takes care of reconnecting, and sending the heartbeat every 10 seconds.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `ex_twelve_data` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_twelve_data, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/ex_twelve_data\u003e.\n\n## Reference\n\n[^1]: https://twelvedata.com/docs#real-time-price-websocket\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgoat%2Fex_twelve_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborgoat%2Fex_twelve_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgoat%2Fex_twelve_data/lists"}