# Generated by Scrape::ApiDefinitionsJob: 2018-09-25 01:15:43 UTC
# See: https://git.io/vx5CY
---
- name: Market history API
  description: Used to lookup market history information. **These AppBase API methods
    are still under development and subject to change.**
  methods:
  - api_method: market_history_api.get_market_history
    purpose: Returns the market history for the internal HBD:HIVE market.
    parameter_json: '{"bucket_seconds":0,"start":"1970-01-01T00:00:00","end":"1970-01-01T00:00:00"}'
    expected_response_json: |
      {
        "buckets": [
          {
            "id": 0,
            "open": "2019-12-18T01:51:15",
            "seconds": 15,
            "hive": {
              "high": 100000,
              "low": 100000,
              "open": 100000,
              "close": 100000,
              "volume": 100000
            },
            "symbol": {
              "nai": "@@000000013",
              "precision": 3
            },
            "non_hive": {
              "high": 100000,
              "low": 100000,
              "open": 100000,
              "close": 100000,
              "volume": 100000
            }
          }
        ]
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_market_history", "params":{"bucket_seconds":15,"start":"2018-01-01T00:00:00","end":"2018-01-02T00:00:00"},
      "id":1}'
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_market_history", "params":{"bucket_seconds":60,"start":"2018-01-01T00:00:00","end":"2018-01-02T00:00:00"},
      "id":1}'
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_market_history", "params":{"bucket_seconds":300,"start":"2018-01-01T00:00:00","end":"2018-01-02T00:00:00"},
      "id":1}'
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_market_history", "params":{"bucket_seconds":3600,"start":"2018-01-01T00:00:00","end":"2018-01-02T00:00:00"},
      "id":1}'
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_market_history", "params":{"bucket_seconds":86400,"start":"2018-01-01T00:00:00","end":"2018-01-02T00:00:00"},
      "id":1}'
    client_docs:
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-market-history)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
  - api_method: market_history_api.get_market_history_buckets
    purpose: Returns the bucket seconds being tracked by the plugin.
    parameter_json: "{}"
    expected_response_json: |
      {
        "bucket_sizes": [
          15,
          60,
          300,
          3600,
          86400
        ]
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_market_history_buckets",
      "id":1}'
    client_docs:
      - '[hive-js](https://gitlab.syncad.com/hive/hive-js/tree/master/doc#get-market-history-buckets)'
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-market-history-buckets)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
  - api_method: market_history_api.get_order_book
    purpose: Returns the internal market order book.
    parameter_json: '{"limit":500}'
    expected_response_json: |
      {
        "bids": [],
        "asks": [
          {
            "order_price": {
              "base": {
                "amount": "1000",
                "precision": 3,
                "nai": "@@000000021"
              },
              "quote": {
                "amount": "100",
                "precision": 6,
                "nai": "@@100042205"
              }
            },
            "real_price": "0.10000000000000001",
            "hive": 100000,
            "hbd": 10000,
            "created": "2019-12-18T01:24:42"
          },
          {
            "order_price": {
              "base": {
                "amount": "1000",
                "precision": 3,
                "nai": "@@000000021"
              },
              "quote": {
                "amount": "1000",
                "precision": 6,
                "nai": "@@100041380"
              }
            },
            "real_price": "1.00000000000000000",
            "hive": 1000,
            "hbd": 1000,
            "created": "2019-12-18T01:22:12"
          },
          {
            "order_price": {
              "base": {
                "amount": "1000",
                "precision": 3,
                "nai": "@@000000021"
              },
              "quote": {
                "amount": "100000000000",
                "precision": 11,
                "nai": "@@100037284"
              }
            },
            "real_price": "100000000.00000000000000000",
            "hive": 1000,
            "hbd": "100000000000",
            "created": "2019-12-18T01:20:21"
          }
        ]
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_order_book", "params":{"limit":10},
      "id":1}'
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_order_book", "params":{"limit":50},
      "id":1}'
    client_docs:
      - '[hive-js](https://gitlab.syncad.com/hive/hive-js/tree/master/doc#get-order-book)'
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-order-book)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
  - api_method: market_history_api.get_recent_trades
    purpose: Returns the most recent trades for the internal HBD:HIVE market.
    parameter_json: '{"limit":1000}'
    expected_response_json: |
      {
        "trades": [
          {
            "date": "2019-12-18T01:51:24",
            "current_pays": {
              "amount": "100000",
              "precision": 3,
              "nai": "@@000000013"
            },
            "open_pays": {
              "amount": "100000",
              "precision": 3,
              "nai": "@@000000021"
            }
          }
        ]
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_recent_trades", "params":{"limit":10},
      "id":1}'
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_recent_trades", "params":{"limit":500},
      "id":1}'
    client_docs:
      - '[hive-js](https://gitlab.syncad.com/hive/hive-js/tree/master/doc#get-recent-trades)'
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-recent-trades)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
  - api_method: market_history_api.get_ticker
    purpose: Returns the market ticker for the internal HBD:HIVE market.
    parameter_json: "{}"
    expected_response_json: |
      {
        "latest": "1.00000000000000000",
        "lowest_ask": "0.10000000000000001",
        "highest_bid": "0.00000000000000000",
        "percent_change": "0.00000000000000000",
        "hive_volume": {
          "amount": "100000",
          "precision": 3,
          "nai": "@@000000021"
        },
        "hbd_volume": {
          "amount": "100000",
          "precision": 3,
          "nai": "@@000000013"
        }
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_ticker", "id":1}'
    client_docs:
      - '[hive-js](https://gitlab.syncad.com/hive/hive-js/tree/master/doc#get-ticker)'
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-ticker)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
  - api_method: market_history_api.get_trade_history
    purpose: Returns the trade history for the internal HBD:HIVE market.
    parameter_json: '{"start":"1970-01-01T00:00:00","end":"1970-01-01T00:00:00","limit":1000}'
    expected_response_json: |
      {
        "trades": [
          {
            "date": "2019-12-18T01:51:24",
            "current_pays": {
              "amount": "100000",
              "precision": 3,
              "nai": "@@000000013"
            },
            "open_pays": {
              "amount": "100000",
              "precision": 3,
              "nai": "@@000000021"
            }
          }
        ]
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_trade_history", "params":{"start":"2018-01-01T00:00:00","end":"2018-01-02T00:00:00","limit":10},
      "id":1}'
    client_docs:
      - '[hive-js](https://gitlab.syncad.com/hive/hive-js/tree/master/doc#get-trade-history)'
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-trade-history)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
  - api_method: market_history_api.get_volume
    purpose: Returns the market volume for the past 24 hours.
    parameter_json: "{}"
    expected_response_json: |
      {
        "hive_volume": {
          "amount": "0",
          "precision": 3,
          "nai": "@@000000021"
        },
        "hbd_volume": {
          "amount": "0",
          "precision": 3,
          "nai": "@@000000013"
        }
      }
    curl_examples:
    - '{"jsonrpc":"2.0", "method":"market_history_api.get_volume", "id":1}'
    client_docs:
      - '[hive-js](https://gitlab.syncad.com/hive/hive-js/tree/master/doc#get-volume)'
      - '[beem](https://beem.readthedocs.io/en/latest/apidefinitions.html#get-volume)'
      - '[hive-ruby](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)'
