Bitshares HUG API - Updates!
<p dir="auto"><img src="https://images.hive.blog/768x0/https://i.imgur.com/secsyPh.png" alt="BTS HUG API Banner" srcset="https://images.hive.blog/768x0/https://i.imgur.com/secsyPh.png 1x, https://images.hive.blog/1536x0/https://i.imgur.com/secsyPh.png 2x" />
<h1>Updates
<ul>
<li>Added new functions: get_bts_object, get_committee_member, get_committee_members, get_worker_proposals, get_worker.
<li>Changed formatting of readme & added more example json snippets.
<li>Refactored several functions, reducing code line count.
<li>Removed tx_limit references due to incorrect use.
<li>Reduced occurrence of internal server errors.
<p dir="auto">Please do try the commands, and provide complains/feedback, thanks :)
<p dir="auto">I'll be talking about this deliverable during the <a href="https://steemit.com/eos-project/@officialfuzzy/bitshares-hangout-52-or-2017-12-30-or-sat-200pm-utc-or-opensource-agenda-beyondbit-payouts-powered-by-sp" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">52nd Bitshares Hangout on 30th December 2017.
<h2>About
<p dir="auto">The intention of this Bitshares HUG REST API repo is to provide the Bitshares network an open-source high performance interface to the Bitshares network through simple GET requests.
<p dir="auto">By following the readme, you can easily recreate the API in your own control. Do remember to change the API key and the Bitshares FULL/API node you're connecting to. If you're creating a service which will produce a large amount of traffic, alert the node operator or consider running your own Bitshares node.
<p dir="auto">This HUG REST API makes heavy use of the <a href="https://github.com/xeroc/python-bitshares" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares
<h2>TODO
<pre><code>Improve the NGINX & Gunicorn configurations
Implement additional HUG functions using websockets to access data inaccessible via python-bitshares.
Work on date range input for iterable objects like market_history, trade_history and asset_holder data. (See: [Issue #30](https://github.com/xeroc/python-bitshares/issues/30)).
Investigate functions for dumping large amounts of data (years of data).
<h2>License
<p dir="auto">The contents of this entire repo should be considered MIT licenced.
<h2>How to contribute
<p dir="auto">It's difficult to debug development issues whilst running behind Gunicorn & NGINX, you're best running the HUG REST API directly with HUG during development "hug -f bts_api.py". Note that running HUG directly in this manner should only be performed during development, it is not suitable for exposing directly to the public as a production ready API.
<h3>About : Python-Bitshares
<p dir="auto"><span><a href="https://github.com/xeroc/python-bitshares/tree/develop" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/xeroc/python-bitshares/tree/develop
<p dir="auto">Created by xeroc, it's a thorough Bitshares python library which will be extensively used throughout this API. We won't be using it for any serious wallet control, purely the read-only blockchain/account/asset monitoring functionality.
<p dir="auto"><span>Web Docs: <a href="http://docs.pybitshares.com/en/latest/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://docs.pybitshares.com/en/latest/
<p dir="auto"><span>PDF Docs: <a href="https://media.readthedocs.org/pdf/python-bitshares/latest/python-bitshares.pdf" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://media.readthedocs.org/pdf/python-bitshares/latest/python-bitshares.pdf
<h3>About: HUG
<blockquote>
<h5>Embrace the APIs of the future
<p dir="auto">Drastically simplify API development over multiple interfaces. With hug, design and develop your API once, then expose it however your clients need to consume it. Be it locally, over HTTP, or through the command line - hug is the fastest and most modern way to create APIs on Python3.
<h5>Unparalleled performance
<p dir="auto">hug has been built from the ground up with performance in mind. It is built to consume resources only when necessary and is then compiled with Cython to achieve amazing performance. As a result, hug consistently benchmarks as one of the fastest Python frameworks and without question takes the crown as the fastest high-level framework for Python 3.
<p dir="auto">Source: <a href="http://www.hug.rest/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Official website.
<h3>About: Extensibility
<p dir="auto">If your HUG functions takes a long time to compute, then you must account for NGINX & Gunicorn worker timeouts (both the systemctl service file & the 'default' NGINX sites-available file). If you fail to account for this, the user will experience unhandled timeouts.
<p dir="auto">Since HUG utilizes Python, any Python library can be used to process/manipulate Bitshares data.
<p dir="auto">Ideally, rather than over-scraping data we should cache it or limit scraping functions to large batches (1000 instead of 500k etc).
<hr />
<h2>Install guide
<p dir="auto">This is an install guide for Ubuntu 17.10, it uses Python3+, HUG, Gunicorn & NGINX. If you change the OS or server components then the following guide will be less applicable, if you succeed please do provide a separate readme for alternative implementation solutions.
<h3>Setup dependencies & Python environment
<p dir="auto">NOTE: We use the develop branch of python-bitshares because it uses the pycryptodome package (required since pycrypto is depreciated).
<p dir="auto">We create the 'btsapi' user, however you could rename this to whatever you want, just remember to change the NGINX & Gunicorn configuration files.
<h4>Setup a dedicated user
<pre><code>adduser btsapi
<ENTER NEW PASSWORD>
<CONFIRM NEW PASSWORD>
usermod -aG sudo btsapi
sudo usermod -a -G www-data btsapi
su - btsapi
<h4>Install required applications
<pre><code>sudo apt-get install libffi-dev libssl-dev python3-pip python3-dev build-essential git nginx python3-setuptools virtualenv libcurl4-openssl-dev
<h4>Create Python virtual environment
<pre><code>mkdir HUG
virtualenv -p python3 HUG
echo "source ./HUG/bin/activate" > access_env.sh
chmod +x access_env.sh
source access_env.sh
<h4>Install Python packages
<pre><code>pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade wheel
pip3 install requests
pip3 install lomond
pip3 install hug
pip3 install gunicorn
git clone https://github.com/xeroc/python-bitshares.git -b develop
pip3 install -e python-bitshares/
<h3>Configure NGINX
<p dir="auto">NGINX serves as a reverse web proxy to Gunicorn & uses an UNIX socket instead of an IP address for referencing Gunicorn.
<pre><code>Copy the nginx.conf file to /etc/nginx/
Reset nginx (sudo service nginx restart)
sudo mv default /etc/nginx/sites-available/default
<h3>Implement SSL Cert
<p dir="auto">You aught to implement a free LetsEncrypt SSL certificate, this requires a domain name (they don't sign IP addresses) and it needs to be renewed every few months by running certbot again.
<p dir="auto"><span><a href="https://certbot.eff.org/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://certbot.eff.org/
<pre><code>sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --nginx -d api.domain.tld
<h3>Configure Gunicorn
<p dir="auto"><span>Official website: <a href="http://gunicorn.org/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://gunicorn.org/
<p dir="auto"><span>Documentation: <a href="http://docs.gunicorn.org/en/stable/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://docs.gunicorn.org/en/stable/
<p dir="auto">Gunicorn is used to provide scalable worker process management and task buffering for the HUG REST API. Gunicorn's documentation states that each CPU can provide roughly 2-3+ Gunicorn workers, however it may be able to achieve a higher quantity (worth testing).
<pre><code>cp gunicorn.service /etc/systemd/system/gunicorn.service
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
<h3>MISC
<p dir="auto">If you make changes to the service or the hug script:
<pre><code>sudo systemctl daemon-reload
sudo systemctl restart gunicorn
<p dir="auto">If you want to monitor Gunicorn:
<pre><code>tail -f gunicorn_access_log
tail -f gunicorn_error_log
sudo systemctl status gunicorn
<hr />
<h1>Available HUG REST API functionality
<p dir="auto">This section will detail the functionality which will be available to the public through GET requests.
<p dir="auto">The functions are currently all read-only functions, enabling the public to request data from the network without the risk of exposing critical wallet controls.
<h2>Asset functions
<p dir="auto">More info: <a href="https://python-bitshares.readthedocs.io/en/latest/asset.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares docs
<h3>get_asset
<p dir="auto">Retrieve basic information about an individual asset & return in JSON!
<h5>Parameters
<ul>
<li>asset_name <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_asset?asset_name=USD&api_key=123abc
<h4><a href="https://btsapi.grcnode.co.uk/get_asset?asset_name=USD&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_asset.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h2>MISC functions
<h3>get_bts_oject
<p dir="auto">Request any Bitshares object's high level overview. Does not provide in depth details (ie asset/account/witness/.. details).
<p dir="auto"><a href="http://docs.bitshares.org/development/blockchain/objects.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">List of possible objects
<h5>Parameters
<ul>
<li>object_id <code>2.0.0 (<code>string)
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_bts_oject?object_id=2.0.0&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_bts_oject?object_id=2.13.1&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h2>Blockchain functions
<p dir="auto">More info: <a href="http://docs.pybitshares.com/en/latest/blockchain.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares docs
<h3>chain_info
<p dir="auto">A high level overview of the Bitshares chain information.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/chain_info?&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/chain_info?&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/chain_info.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>get_chain_properties
<p dir="auto">Get chain properties, return in JSON.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_chain_properties?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_chain_properties?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4>Example JSON output
<pre><code>{
"chain_properties": {
"id": "2.11.0",
"chain_id": "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8",
"immutable_parameters": {
"min_committee_member_count": 11,
"min_witness_count": 11,
"num_special_accounts": 100,
"num_special_assets": 100
}
},
"valid_key": true,
"took": 0.01954
}
<h3>get_network
<p dir="auto">Return BTS network information in JSON.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_network?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_network?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4>Example JSON output
<pre><code>{
"get_network": {
"chain_id": "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8",
"core_symbol": "BTS",
"prefix": "BTS"
},
"valid_key": true,
"took": 0.12271
}
<h3>get_info
<p dir="auto">This call returns the dynamic global properties in JSON.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_info?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_info?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_info.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>get_config
<p dir="auto">Returns object 2.0.0 in JSON.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_config?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_config?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_config.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>get_block_details
<p dir="auto">Retrieve the specified block's date/time details, return in JSON.
<h5>Parameters
<ul>
<li>block_number <code>number
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_block_details?block_number=10&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_block_details?block_number=10&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4>Example JSON output
<pre><code>{
"previous": "0000003157e4849fe0d04e1f60462764d2a1f3d1",
"timestamp": "2015-10-13T14:15:00",
"witness": "1.6.5",
"transaction_merkle_root": "0000000000000000000000000000000000000000",
"extensions": [],
"witness_signature": "1f0441febc1a8ce32287749ba5ec2797be8202eab82e6275340c508e16238cd7af21aba15a1c09bbeca03751fd4abb10580e1fea69a4f4dde17b9b54b4beeb654b",
"transactions": [],
"id": "50",
"date": "2015-10-13T14:15:00",
"block_number": 50,
"valid_block_number": true,
"valid_key": true,
"took": 0.04568
}
<h3>get_latest_block
<p dir="auto">Retrieve the details of the latest block, return in JSON.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_latest_block?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_latest_block?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_latest_block.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>get_all_accounts
<p dir="auto">Retrieve all Bitshares account names. Takes a while!
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_all_accounts?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_all_accounts?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4>Example JSON output
<pre><code>{
'accounts': [{acc1, acc2, ...}],
'num_accounts': 500000,
'valid_key': True,
'took': 20.5
}
<h2>Account information functions
<p dir="auto">More info: <a href="http://docs.pybitshares.com/en/latest/account.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares docs
<h3>account_balances
<p dir="auto">Given a valid account name, output the user's balances in JSON.
<h5>Parameters
<ul>
<li>account <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/account_balances?account=example_usera&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/account_balances?account_name=xeroc&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/account_balances.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>account_open_orders
<p dir="auto">Given a valid account name, output the user's open orders in JSON.
<h5>Parameters
<ul>
<li>account_name <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/account_open_orders?account_name=example_usera&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/account_open_orders?account_name=abit&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/account_open_orders.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>account_callpositions
<p dir="auto">Given a valid account name, output the user's call positions in JSON.
<p dir="auto">Note: Highly verbose! Example contains 26k lines of JSON!
<h5>Parameters
<ul>
<li>account <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/account_callpositions?account=example_usera&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/account_callpositions?account_name=abit&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/account_callposition.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>account_history
<p dir="auto">Given a valid account name and transaction history limit (int), output the user's transaction history in JSON.
<h5>Parameters
<ul>
<li>account_name <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/account_history?account_name=example_user&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/account_history?account_name=xeroc&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/account_history.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>account_is_ltm
<p dir="auto">Given a valid account name, check if the user has LTM.
<h5>Parameters
<ul>
<li>account_name <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/account_is_ltm?account_name=example_user&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/account_is_ltm?account_name=xeroc&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4>Example JSON output
<pre><code>{
"account_is_ltm": true,
"account": "xeroc",
"valid_account": true,
"valid_key": true,
"took": 0.14034
}
<h2>DEX functions
<p dir="auto">More info: <a href="http://docs.pybitshares.com/en/latest/dex.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares docs
<h3>list_fees
<p dir="auto">Retrieve the currently implemented fees in JSON format.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/list_fees?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/list_fees?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/list_fees.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h2>Market information functions
<p dir="auto">More info: <a href="http://docs.pybitshares.com/en/latest/market.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares docs
<h3>market_ticker
<p dir="auto">Given a valid market pair (e.g. USD:BTS), output the market pair's ticker information in JSON.
<h5>Parameters
<ul>
<li>market_pair <code>base:quote (<code>string)
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/market_ticker?market_pair=USD:BTS&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/market_ticker?market_pair=USD:BTS&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/market_ticker.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>market_orderbook
<p dir="auto">Given a valid market pair (e.g. USD:BTS) and your desired orderbook size limit, output the market pair's orderbook (buy/sell order) information in JSON.
<h5>Parameters
<ul>
<li>market_pair <code>base:quote (<code>string)
<li>orderbook_limit <code>number
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/market_orderbook?market_pair=USD:BTS&orderbook_limit=25&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/market_orderbook?market_pair=USD:BTS&orderbook_limit=25&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/market_orderbook.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>market_24hr_vol
<p dir="auto">Given a valid market_pair (e.g. USD:BTS), output their 24hr market volume in JSON.
<h5>Parameters
<ul>
<li>market_pair <code>base:quote (<code>string)
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/market_24hr_vol?market_pair=USD:BTS&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/market_24hr_vol?market_pair=USD:BTS&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/market_24hr_vol.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>market_trade_history
<p dir="auto">Given a valid market_pair (e.g. USD:BTS) & a TX limit, output the market's trade history in JSON.
<h5>Parameters
<ul>
<li>market_pair <code>base:quote (<code>string)
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/market_trade_history?market_pair=USD:BTS&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/market_trade_history?market_pair=USD:BTS&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/market_trade_history.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h2>Witness functions
<p dir="auto">More info: <a href="http://docs.pybitshares.com/en/latest/witness.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">python-bitshares docs
<h3>find_witness
<p dir="auto">Find details about a specific witness.
<h5>Parameters
<ul>
<li>witness_name <code>string
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/find_witness?witness_name=sc-ol&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/find_witness?witness_name=sc-ol&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/find_witness.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>list_of_witnesses
<p dir="auto">Retrieve a list of available witnesses.
<h5>Parameters
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/list_of_witnesses?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/list_of_witnesses?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/list_of_witnesses.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h2>Committee functions
<p dir="auto">To implement this, we need to use the '<a href="http://docs.python-requests.org/en/master/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Requests' python library to access functionality currently not present in the python-bitshares library (AFAIK).
<h3>get_committee_member
<p dir="auto">Retrieve a single committee member's full account (and role) information.
<h5>Parameters
<ul>
<li>committee_id <code>1.5.0 (<code>string)
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_committee_member?committee_id=1.5.10&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_committee_member?committee_id=1.5.10&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_committee_member.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>get_committee_members
<p dir="auto">Get a list of all committee members, and their Bitshares account details.
<h4><a href="https://btsapi.grcnode.co.uk/get_committee_members?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_committee_members?api_key=API_KEY
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_committee_members.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h2>Worker functions
<p dir="auto">Similar to the committee function, we need to use the '<a href="http://docs.python-requests.org/en/master/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Requests' python library to access functionality currently not present in the python-bitshares library (AFAIK).
<h3>get_worker
<p dir="auto">Retrieve an individual worker proposal & its associated proposer account details.
<h5>Parameters:
<ul>
<li>worker_id <code>1.14.x (<code>string)
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_worker?worker_id=1.14.x&api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_worker?worker_id=1.14.50&api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_worker.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
<h3>get_worker_proposals
<p dir="auto">Retrieve a list of all worker proposals (including past/inactive) and the worker account details.
<h5>Parameters:
<ul>
<li>api_key <code>string
<h5>Usage
<p dir="auto"><code>https://subdomain.domain.tld/get_worker_proposals?api_key=API_KEY
<h4><a href="https://btsapi.grcnode.co.uk/get_worker_proposals?api_key=123abc" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Run Command
<h4><a href="https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/example_json/get_worker_proposals.json" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Example JSON output
i am appriciat about this post
thank for sharing like that post
@cm-steem
wow bitshares @ogochukwu @harrywill @stanleephenom, have been disturbing me to invest in it but i haven't even dream t of investing , i guess is high time i give it a try ..
good work @cm-steem
Oh helpful post thank you dear for sharing this great post
Great content,i love your post
Thank you for keeping us up to date!
Any reason you didn't post on utopian? The bot could've upvoted you :)
Not really, I probably should have posted to #beyondbitcoin too but I forgot.