{"id":20399701,"url":"https://github.com/ohld/python-viabtc-api","last_synced_at":"2025-08-11T20:11:48.073Z","repository":{"id":49327733,"uuid":"142933707","full_name":"ohld/python-viabtc-api","owner":"ohld","description":"API Wrapper for ViaBTC exchange server ","archived":false,"fork":false,"pushed_at":"2019-03-14T23:43:03.000Z","size":31,"stargazers_count":41,"open_issues_count":4,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T13:51:29.230Z","etag":null,"topics":["cryptocurrency","exchange","python","viabtc"],"latest_commit_sha":null,"homepage":"https://okhlopkov.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ohld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-30T22:18:04.000Z","updated_at":"2024-12-05T19:05:20.000Z","dependencies_parsed_at":"2022-08-25T18:10:30.284Z","dependency_job_id":null,"html_url":"https://github.com/ohld/python-viabtc-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ohld/python-viabtc-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohld%2Fpython-viabtc-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohld%2Fpython-viabtc-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohld%2Fpython-viabtc-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohld%2Fpython-viabtc-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohld","download_url":"https://codeload.github.com/ohld/python-viabtc-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohld%2Fpython-viabtc-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269948861,"owners_count":24501821,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"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":["cryptocurrency","exchange","python","viabtc"],"created_at":"2024-11-15T04:31:33.993Z","updated_at":"2025-08-11T20:11:47.879Z","avatar_url":"https://github.com/ohld.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-viabtc-api\nAPI Wrapper for [ViaBTC exchange server](https://github.com/testnet-exchange/viabtc_exchange_server) - open source cryptocurrency exchange engine. Also works with the [original exchange server](http://github.com/viabtc/viabtc_exchange_server).\n\n[\u003cimg src=\"https://raw.githubusercontent.com/morejust/foundation/master/madebymorejust.png\" width=\"100\"\u003e](https://morejust.foundation/?from=python-viabtc-api)\n\n## Installation\n\nThis API is very simple. The installation is just the downloading sources from github\n\n``` bash\ngit clone https://github.com/testnet-exchange/python-viabtc-api\ncd python-viabtc-api\npip3 install -r requirements.txt\n```\n\n## Usage\n\nThe basic usage:\n\n``` python\nfrom ViaBTCAPI.ViaBTCAPI import ViaBTCAPI\n\nexchange_url = \"http://localhost:8080/\"  # choose to your exchange url\napi = ViaBTCAPI(exchange_url)\n\nresp = api.market_list()\nmarket_names = [m[\"name\"] for m in resp[\"result\"]]\nprint(\"Exchange markets: \", market_names)\n\nprint()\nprint(\"Orderbooks:\")\nfor market in market_names:\n    ob = api.order_depth(market=market)\n    print(market, ob[\"result\"])\n```\n\nMore usage code examples you can find in [examples](https://github.com/testnet-exchange/python-viabtc-api/blob/master/examples) folder. Read the code first, it may contain some hardcoded constants that should be changed.\n\n---\n\n# Working with the exchange server\n\nSince [I](https://github.com/ohld) have had a lot of troubles with the original exchange server by ViaBTC, I've decided to write this tutorial for beginners. I hope that helps.\n\n## Install exchange\n\nFor me the easiest way to install the exchange was found in [bitlum](https://github.com/bitlum)'s fork of the original [ViaBTC](https://github.com/viabtc/viabtc_exchange_server) repository. You need `docker` and `docker-compose` (up-to-date) to launch this installation script. \n\n``` bash\ngit clone https://github.com/testnet-exchange/viabtc_exchange_server\ncd viabtc_exchange_server/docker\nsudo docker-compose up\n```\n\nThat's it! It successfully run on Ubuntu and Debian servers, but failed on macOS (there were some disk path errors that I balieve can be easily fixed if you are familiar with docker or stackoverflow).\n\n## Connect to exchange local network\n\n`Docker-compose` creates the local net for all dockers images. Take a look at [docker-compose file](https://github.com/bitlum/viabtc_exchange_server/blob/master/docker/docker-compose.yml): you may notice the local ip addresses near every docker container. We will use the address of `accesshttp` container to make API requests. \n\nAs all of that stuff is happening on the remote server's local network, we need to make some port forwarding from it to out development machine (in my case this is my macbook laptop):\n\n``` bash\nssh user@\u003cyour-server-id-address-\u003e -L 8080:192.168.18.45:8080 -N -f\n```\n\nwhere `192.168.18.45` is the ip address of `accesshttp` container and `8080` is its port. \n\nAnd now you can send API requests to `exchange_url = \"http://localhost:8080\"`\n\n----\n\nI spent a few hours to figure out how to run the exchange and make requests to it. If this tutorial helped you, smash the star button at the top of the page. And fell free to make Pull Requests with some additional functionallity. \n\n*Happy Coding!*\n\n[\u003cimg src=\"https://raw.githubusercontent.com/morejust/foundation/master/madebymorejust.png\" width=\"100\"\u003e](https://morejust.foundation/?from=python-viabtc-api)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohld%2Fpython-viabtc-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohld%2Fpython-viabtc-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohld%2Fpython-viabtc-api/lists"}