mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
[DOC] added Charts API (incomplete draft)
This commit is contained in:
174
charts_api.html
Normal file
174
charts_api.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>Ripple Charts API - Ripple Developer Portal</title>
|
||||
|
||||
<!-- favicon -->
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="vendor/jquery-1.11.1.min.js"></script>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<!-- Flatdoc theme -->
|
||||
<link href='vendor/flatdoc/v/0.8.0/theme-white/style.css' rel='stylesheet'>
|
||||
<script src="vendor/flatdoc/v/0.8.0/theme-white/script.js"></script>
|
||||
|
||||
<!-- syntax highlighting -->
|
||||
<link rel="stylesheet" href="vendor/docco.min.css">
|
||||
<script src="vendor/highlight.min.js"></script>
|
||||
|
||||
<!-- syntax selection js -->
|
||||
<script src="js/multicodetab.js"></script>
|
||||
<!-- Code to load contents via Flatdoc -->
|
||||
<script src="vendor/flatdoc/v/0.8.0/legacy.js"></script>
|
||||
<script src="vendor/flatdoc/v/0.8.0/flatdoc.js"></script>
|
||||
<script>
|
||||
$(".flatdoc-content").empty();
|
||||
$(".content-root .menubar .menu").empty();
|
||||
Flatdoc.run({
|
||||
fetcher: Flatdoc.file('content/charts_api.md')
|
||||
});
|
||||
$(document).on('flatdoc:ready', function() {
|
||||
$().multicode_tabs();
|
||||
hljs.initHighlighting();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="js/expandcode.js"></script>
|
||||
<script src="js/fixsidebarscroll.js"></script>
|
||||
|
||||
<!-- Custom Stylesheets -->
|
||||
<link href="font/fonts.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/main.css" rel="stylesheet" />
|
||||
<link href="css/custom.css" rel="stylesheet" />
|
||||
|
||||
<link rel="shortcut icon" href="favicon.ico?v=2" type="image/x-icon" />
|
||||
<link rel="icon" href="favicon.ico?v=2" type="image/x-icon" />
|
||||
|
||||
|
||||
</head>
|
||||
<body role='flatdoc' class='no-literate'>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="./"><img class="small_logo" src="assets/img/ripple_logo_small.png"></a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown">
|
||||
<a href="./" class="dropdown-toggle" data-toggle="dropdown">Documentation <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="rippled-apis.html">rippled</a></li>
|
||||
<li><a href="ripple-rest.html">Ripple-REST</a></li>
|
||||
<li><a href="gatewayd.html">Gatewayd</a></li>
|
||||
<li><a href="transactions.html">Transactions</a></li>
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">API Tools <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="ripple-api-tool.html">WebSocket Tool</a></li>
|
||||
<li><a href="rest-api-tool.html">REST Tool</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Resources <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="https://forum.ripple.com/viewforum.php?f=2">Forums</a></li>
|
||||
<li><a href="https://www.bountysource.com/teams/ripple/bounties">Bounties</a></li>
|
||||
<li><a href="https://ripplelabs.atlassian.net/">Bug Tracking</a></li>
|
||||
<li><a href="https://ripple.com/category/dev-blog/">Dev Blog</a></li>
|
||||
<li><a href="https://ripple.com/press-releases/">Press Center</a></li>
|
||||
<li><a href="https://ripple.com/brand-guidelines/">Brand Guidelines</a></li>
|
||||
</ul>
|
||||
<li><a href="https://github.com/ripple/ripple-dev-portal" title="GitHub">Site Source</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
<div class='wrapper'>
|
||||
<div class='content-root'>
|
||||
<div class='menubar'>
|
||||
<div class='menu section' role='flatdoc-menu'>
|
||||
</div>
|
||||
</div>
|
||||
<div role='flatdoc-content' class='content'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h4>Documentation</h4>
|
||||
<ul class="footer_links">
|
||||
<li><a href="rippled-apis.html">rippled</a></li>
|
||||
<li><a href="ripple-rest.html">Ripple-REST</a></li>
|
||||
<li><a href="gatewayd.html">Gatewayd</a></li>
|
||||
<li><a href="transactions.html">Transactions</a></li>
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h4>Resources</h4>
|
||||
<ul class="footer_links">
|
||||
<li><a href="https://ripple.com/press-releases/">Press Center</a></li>
|
||||
<li><a href="https://ripple.com/brand-guidelines/">Brand Use and Guidelines</a></li>
|
||||
<li><a href="https://forum.ripple.com/viewforum.php?f=2">Forums</a></li>
|
||||
<li><a href="https://ripple.com/category/dev-blog/">Dev Blog</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h4>Ripple Projects</h4>
|
||||
<ul class="footer_links">
|
||||
<li><a href="https://www.rippletrade.com">Ripple Trade</a>
|
||||
<li><a href="https://www.ripplecharts.com">Ripple Charts</a>
|
||||
<li><a href="https://ripple.com/graph">Ripple Graph</a>
|
||||
<li><a href="http://codius.org/">Codius</a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h4>Ripple Labs</h4>
|
||||
<ul class="footer_links">
|
||||
<li><a href="https://www.ripplelabs.com/wp-content/uploads/2014/10/ripple_labs_bylaws.pdf">Corporate Bylaws</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/wp-content/uploads/2014/09/ripple_labs_code_of_conduct1.pdf">Code of Conduct</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/team/">Team</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/careers/">Careers</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/investors/">Investors</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/advisors/">Advisors</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/xrp-distribution/">XRP Distribution</a></li>
|
||||
<li><a href="https://www.ripplelabs.com/contact/">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
381
content/charts_api.md
Normal file
381
content/charts_api.md
Normal file
@@ -0,0 +1,381 @@
|
||||
# Ripple Charts API #
|
||||
|
||||
The Ripple Charts API, also known as the **Data API**, provides past and present information about the state of the Ripple Network through a REST-like API, with additional information calculated for analysis purposes. The Ripple Charts API is used as a data source by applications such as [Ripple Charts](https://www.ripplecharts.com/) and [ripple.com](https://www.ripple.com/).
|
||||
|
||||
* [Architecture](#architecture)
|
||||
* [Setup](#setup)
|
||||
* [API Method Reference](#api-method-reference)
|
||||
|
||||
|
||||
|
||||
# Architecture #
|
||||
|
||||
The Ripple Charts API is a [Node.js](https://nodejs.org/) application that uses [CouchDB](https://couchdb.apache.org/) and [Redis](http://redis.io/) as its datastore. The Charts API continually monitors rippled for new ledgers and imports them.
|
||||
|
||||
## Components ##
|
||||
|
||||
### Ledger Importer ###
|
||||
The ledger importer imports ledgers from the Ripple Network into the data store. The process is set up to import continously in real time as ledgers are validated, and also import historical ledgers.
|
||||
|
||||
### Data Store ###
|
||||
The data store uses CouchDB to store ledgers as a JSON document. To retrieve structured data from the ledgers, the Charts API uses "views" that index specific elements from the ledger into a format that can be queried efficiently. For example, one view collects all successful transactions that exercise offers and indexes them according to the currencies, issuers, and date, and returns the amounts and prices of the exercised offers. We can then query this view and group the indexed results by time increments to get an array of offers excercised over time for a given pair of currencies.
|
||||
|
||||
### API Server ###
|
||||
Accessing the historical data is not done by querying the database directly but through a node.js API server. The server takes requests in the form of JSON data, interprets it into one or several couchDB queries, processes the data as necessary and returns the results.
|
||||
|
||||
### Memory Cache ###
|
||||
To reduce the load on CouchDB, the Charts API uses Redis as a caching layer. The cache expects the data stored in CouchDB to be accurate and up to date, so the API automatically disables the cache if the importer is unable to keep up. When the importer catches up, the API restarts the cache again.
|
||||
|
||||
|
||||
# Setup #
|
||||
|
||||
Basic setup of the Ripple Charts API involves the following steps:
|
||||
|
||||
1. Install Node.js
|
||||
2. Install CouchDB, or get access to a hosted CouchDB.
|
||||
3. Install Redis. (This step is optional, but strong recommended.)
|
||||
4. Clone the Ripple Charts repository:<br/>
|
||||
`git clone https://github.com/ripple/ripple-data-api.git`
|
||||
5. Install dependencies using [npm](https://www.npmjs.com/):<br/>
|
||||
`npm install`
|
||||
6. Copy the example configuration files to their expected locations:<br/>
|
||||
In the `ripple-data-api` top folder:<br/>
|
||||
`cp db.config.json.example db.config.json`<br/>
|
||||
`cp deployment.environments.json.example deployment.environments.json`
|
||||
7. Modify the configuration files, providing the addresses and credentials of your CouchDB and Redis databases.
|
||||
8. Push design documents to CouchDB:<br/>
|
||||
`grunt updateViews`<br/>
|
||||
(This requires write permissions to the CouchDB instance.)
|
||||
|
||||
At this point, the Ripple Charts API is installed, but not running, and has no data imported. You can [start the API service](#start-api-service) or [start the ledger importer](#start-ledger-importer) in any order.
|
||||
|
||||
## Start API Service ##
|
||||
|
||||
The following command starts the API service:
|
||||
|
||||
`grunt watch`
|
||||
|
||||
(This requires read permissions to CouchDB. Write permissions are not necessary.)
|
||||
|
||||
## Start Ledger Importer ##
|
||||
|
||||
The following command starts the ledger importer service:
|
||||
|
||||
`node db/importer`
|
||||
|
||||
Alternatively, you can use the experimental websocket-based importer:
|
||||
|
||||
`node db/import`
|
||||
|
||||
(Either way, you need write permission to the CouchDB database.)
|
||||
|
||||
|
||||
|
||||
# API Objects #
|
||||
|
||||
## Dates and Times ##
|
||||
[Date-Time]: #dates-and-times
|
||||
|
||||
The Ripple Charts API uses Moment.js to parse strings, and therefore accepts [any date-time string that Moment.js recognizes](http://momentjs.com/docs/#supported-iso-8601-strings) as input.
|
||||
|
||||
The Ripple Charts API always outputs dates in UTC, in the following format:
|
||||
|
||||
YYYY-MM-DDThh-mm-ss+00:00
|
||||
|
||||
For example:
|
||||
`2015-03-01T00:00:00+00:00`
|
||||
(midnight exactly on March 3, 2015 UTC)
|
||||
|
||||
|
||||
## Currency Objects ##
|
||||
[Currency Object]: #currency-objects
|
||||
|
||||
Many methods define a currency as an object with the following fields:
|
||||
|
||||
| Field | Value | Description |
|
||||
|-------|-------|-------------|
|
||||
| currency | String | Three-letter [ISO 4217 Currency Code](http://www.xe.com/iso4217.php) string, or a 160-bit hex string according to Ripple's internal [Currency format](https://wiki.ripple.com/Currency_format). |
|
||||
| issuer | String | Account address of the counterparty holding the currency. Usually an issuing gateway in the Ripple network. Omitted for XRP. |
|
||||
|
||||
|
||||
## Response Formats ##
|
||||
[Response Formats]: #response-formats
|
||||
|
||||
Several methods provide a `format` parameter, which lets you request results in one of three formats:
|
||||
|
||||
* `csv` - [Comma-separated-values](http://en.wikipedia.org/wiki/Comma-separated_values) table. Each line represents one result or interval, with its attributes in columns.
|
||||
* `json` - The request contains some top-level information at the top level, and a `results` array. Each member of the `results` array is a JSON object with attributes and values that represent one result or interval.
|
||||
* **Two-dimensional array format** - If neither `csv` nor `json` is specified, the API returns an array of JSON arrays, in a format that resembles CSV. The first member of the top-level array is an array of table headers, and each subsequent member is a nested array representing one result or interval, with its members corresponding to the attribute names in the header row.
|
||||
|
||||
|
||||
# API Method Reference #
|
||||
|
||||
Ripple Labs runs a public instance of the Ripple Charts API with full data, available at:
|
||||
|
||||
**https://api.ripplecharts.com/api**
|
||||
|
||||
The API provides the following methods:
|
||||
|
||||
* [Account Offers Exercised - `POST /account_offers_exercised`](#account-offers-exercised)
|
||||
* [Account Transaction Stats - `POST /account_transaction_stats`](#account-transaction-stats)
|
||||
* [Account Transactions - `POST /account_transactions`](#account-transactions)
|
||||
* [Accounts Created - `POST /accounts_created`](#accounts-created)
|
||||
* [Exchange Rates - `POST /exchange_rates`](#exchange-rates)
|
||||
* [Issuer Capitalization - `POST /issuer_capitalization`](#issuer-capitalization)
|
||||
* [Ledgers Closed - `POST /ledgers_closed`](#ledgers-closed)
|
||||
* [Market Traders - `POST /market_traders`](#market-traders)
|
||||
* [Offers - `POST /offers`](#offers)
|
||||
* [Offers Exercised - `POST /offers_exercised`](#offers-exercised)
|
||||
* [Top Markets - `POST /top_markets`](#top-markets)
|
||||
* [Total Network Value - `POST /total_network_value`](#total-network-value)
|
||||
* [Total Value Sent - `POST /total_value_sent`](#total-value-sent)
|
||||
* [Transaction Stats - `POST /transaction_stats`](#transaction-stats)
|
||||
* [Value Sent - `POST /value_sent`](#value-sent)
|
||||
|
||||
## offers_exercised ##
|
||||
[[Source]<br>](https://github.com/ripple/ripple-data-api/blob/master/api/routes/offersExercised.js "Source")
|
||||
|
||||
Retrieve information about currency-exchange orders being exercised on the network, for a specific pair of currencies and timeframe.
|
||||
|
||||
<div class='multicode'>
|
||||
|
||||
*15-minute increments*
|
||||
|
||||
```
|
||||
POST /offers_exercised
|
||||
{
|
||||
"base": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"counter": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"endTime": "2015-03-01T00:00Z",
|
||||
"startTime": "2015-03-01T12:00Z",
|
||||
"timeIncrement": "minute",
|
||||
"timeMultiple": 15,
|
||||
"format": "json"
|
||||
}
|
||||
```
|
||||
|
||||
*Expanded*
|
||||
|
||||
```
|
||||
POST /offers_exercised
|
||||
{
|
||||
"base": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"counter": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"endTime": "2015-03-01T00:00Z",
|
||||
"startTime": "2015-03-01T23:59Z",
|
||||
"reduce": false,
|
||||
"limit": 5,
|
||||
"offset": 0,
|
||||
"format": "json"
|
||||
}
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
The request includes the following body parameters:
|
||||
|
||||
| Field | Value | Description |
|
||||
|-------|-------|-------------|
|
||||
| base | Object ([Currency Object][]) | One of the currencies being exchanged. |
|
||||
| counter | Object ([Currency Object][]) | The other of the currencies being exchanged. |
|
||||
| startTime | String ([Date-Time][]) | Retrieve information starting at this time. |
|
||||
| endTime | String ([Date-Time][]) | Retrieve information ending at this time. |
|
||||
| timeIncrement | String | (Optional) Divide results into intervals of the specified length: `year`, `month`, `day`, `hour`, `minute`, or `second`. The value `all` collapses the results into just one interval. Defaults to `all`. |
|
||||
| timeMultiple | Number | (Optional) Create larger intervals that are this many times the size of the `timeIncrement` (for example, 15-minute intervals). Defaults to 1. |
|
||||
| descending | Boolean | (Optional) If true, return results in descending order. Defaults to false. |
|
||||
| reduce | Boolean | (Optional) If `false`, include transactions individually instead of collapsing them into results over time. Defaults to `true`. Ignored if `timeIncrement` is provided. |
|
||||
| limit | Number | (Optional) If reduce is `false`, this value defines the maximum number of transactions to return in one response. Use with `offset` to paginate results. Defaults to 500. |
|
||||
| offset | Number | (Optional) If reduce is `false`, this value defines a number of transactions to skip before returning results. Use with `limit` to paginate results. Defaults to 0. |
|
||||
| format | String | (Optional) The format to return results in. Use `csv` to return results in CSV format or `json` to return results as JSON. If omitted, defaults to a CSV-like JSON array format. |
|
||||
|
||||
#### Response Format ####
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
|
||||
<div class='multicode'>
|
||||
|
||||
*15-minute increments*
|
||||
|
||||
```
|
||||
{
|
||||
"startTime": "2015-03-01T00:00:00+00:00",
|
||||
"endTime": "2015-03-01T12:00:00+00:00",
|
||||
"base": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"counter": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"timeIncrement": "minutes",
|
||||
"timeMultiple": 15,
|
||||
"results": [
|
||||
{
|
||||
"startTime": "2015-03-01T00:45:00+00:00",
|
||||
"openTime": "2015-03-01T00:52:20+00:00",
|
||||
"closeTime": "2015-03-01T00:52:20+00:00",
|
||||
"baseVolume": 683.2001467024601,
|
||||
"counterVolume": 2.679229505167318,
|
||||
"count": 1,
|
||||
"open": 0.0039215880120912015,
|
||||
"high": 0.0039215880120912015,
|
||||
"low": 0.0039215880120912015,
|
||||
"close": 0.0039215880120912015,
|
||||
"vwap": 0.003921588012091202,
|
||||
"partial": false
|
||||
},
|
||||
{
|
||||
"startTime": "2015-03-01T09:45:00+00:00",
|
||||
"openTime": "2015-03-01T09:45:30+00:00",
|
||||
"closeTime": "2015-03-01T09:48:40+00:00",
|
||||
"baseVolume": 6025.771839536825,
|
||||
"counterVolume": 23.67880093810258,
|
||||
"count": 43,
|
||||
"open": "0.00391389432485323",
|
||||
"high": 0.003945508916212113,
|
||||
"low": "0.003912889366625167",
|
||||
"close": 0.003921642784865358,
|
||||
"vwap": 0.003929588037625179,
|
||||
"partial": false
|
||||
},
|
||||
{
|
||||
"startTime": "2015-03-01T11:45:00+00:00",
|
||||
"openTime": "2015-03-01T11:59:40+00:00",
|
||||
"closeTime": "2015-03-01T11:59:40+00:00",
|
||||
"baseVolume": 30.990503463384982,
|
||||
"counterVolume": 0.12348600141122801,
|
||||
"count": 1,
|
||||
"open": "0.003984640054561433",
|
||||
"high": "0.003984640054561433",
|
||||
"low": "0.003984640054561433",
|
||||
"close": "0.003984640054561433",
|
||||
"vwap": 0.003984640054561414,
|
||||
"partial": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Expanded*
|
||||
|
||||
```
|
||||
{
|
||||
"startTime": "2015-03-01T00:00:00+00:00",
|
||||
"endTime": "2015-03-01T23:59:00+00:00",
|
||||
"base": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"counter": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
|
||||
},
|
||||
"timeIncrement": "all",
|
||||
"results": [
|
||||
{
|
||||
"time": "2015-03-01T00:16:20+00:00",
|
||||
"price": "0.003926827277291318",
|
||||
"baseAmount": 128.95156374260318,
|
||||
"counterAmount": 0.506370517953824,
|
||||
"account": "rUBLCjWdsPPMkppdFXVJWhHnr3FNqCzgG3",
|
||||
"counterparty": "r4rCiFc9jpMeCpKioVJUMbT1hU4kj3XiSt",
|
||||
"tx_hash": "7257EC2FB029E76003B771755448334B650E376312B99AEF7F6B8DC85BF50C48",
|
||||
"ledgerIndex": 11991162
|
||||
},
|
||||
{
|
||||
"time": "2015-03-01T00:16:50+00:00",
|
||||
"price": "0.003928013992378335",
|
||||
"baseAmount": 271.64872683,
|
||||
"counterAmount": 1.06704,
|
||||
"account": "rUBLCjWdsPPMkppdFXVJWhHnr3FNqCzgG3",
|
||||
"counterparty": "rBxy23n7ZFbUpS699rFVj1V9ZVhAq6EGwC",
|
||||
"tx_hash": "57996435CAF193F427408187F4DE72879E76015E446D78C7C5702D8F193B478F",
|
||||
"ledgerIndex": 11991168
|
||||
},
|
||||
{
|
||||
"time": "2015-03-01T00:18:00+00:00",
|
||||
"price": "0.003958567143537345",
|
||||
"baseAmount": 12.608369653599198,
|
||||
"counterAmount": 0.04991107784431131,
|
||||
"account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"counterparty": "r9bf8V4ae5xReYnKPXgnwERDFPoW34FhGy",
|
||||
"tx_hash": "5B1AEFDC4AF56843854CACEE885B856273F260F9DA5990600651F06B913136AB",
|
||||
"ledgerIndex": 11991181
|
||||
},
|
||||
{
|
||||
"time": "2015-03-01T00:18:00+00:00",
|
||||
"price": "0.003958567143537345",
|
||||
"baseAmount": 54.95776227293271,
|
||||
"counterAmount": 0.21755399201596803,
|
||||
"account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"counterparty": "rfZ4YjC4CyaKFx9cgzYNKk4E2zTXRJif26",
|
||||
"tx_hash": "139159A556F7F240078D378F3FCF556D01EF2C99DB79DD84338E7AD71419EEA6",
|
||||
"ledgerIndex": 11991181
|
||||
},
|
||||
{
|
||||
"time": "2015-03-01T00:18:00+00:00",
|
||||
"price": "0.003958567143537345",
|
||||
"baseAmount": 91.90007712981681,
|
||||
"counterAmount": 0.3637926258146406,
|
||||
"account": "rDVBvAQScXrGRGnzrxRrcJPeNLeLeUTAqE",
|
||||
"counterparty": "rEiUs9rEiGHmpaprkYDNyXnJYg4ANxWLy9",
|
||||
"tx_hash": "10E7823DFE7B2F4EAD204A5FA212DCE9624FD87AA5B45E29AE21C2BFCC797CD8",
|
||||
"ledgerIndex": 11991181
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
The format of the response depends on the `format` and `reduce` parameters from the request. See [Response Formats][] for details.
|
||||
|
||||
**If results are reduced** (the default), then each result represents an interval of time, with the following attributes, in order:
|
||||
|
||||
| Field | Value | Description |
|
||||
|-------|-------|-------------|
|
||||
| startTime | String ([Date-Time][]) | The start time of this interval. |
|
||||
| baseVolume | Number | Total amount of the base currency traded in this interval. |
|
||||
| counterVolume | Number | Total amount of the counter currency traded in this interval. |
|
||||
| count | Number | Number of trades in this interval. |
|
||||
| open | Number | Price of the first trade in this interval. |
|
||||
| high | Number | Highest price traded in this interval. (Most counter currency received per unit of base currency spent.) |
|
||||
| low | Number | Lowest price traded in this interval. (Least counter currency received per unit of base currency spent.) |
|
||||
| close | Number | Price of the last trade in this interval. |
|
||||
| vwap | Number | [Volume weighted average price](http://en.wikipedia.org/wiki/Volume-weighted_average_price) of trades in this interval. |
|
||||
| openTime | String ([Date-Time][]) | The time at which the first trade in this interval occurred. |
|
||||
| closeTime | String ([Date-Time][]) | The time at which the last trade in this interval occurred. |
|
||||
| partial | Boolean | If true, this row may not include all trades in the interval due to the alignment of the requested time period. For example, a time interval of 1 minute was requested, but the end time for the range was 3:45:30. |
|
||||
|
||||
All prices are represented as the amount of the counter currency received for each unit of the base-currency spent.
|
||||
|
||||
The time of an exchange is defined as the close time of the ledger that contained the transaction exercising the exchange.
|
||||
|
||||
Note: The API omits intervals during which no exchanges occurred. This means that the rows may not be sequential. (They _are_ in order, but with gaps for empty intervals.)
|
||||
|
||||
**If the results are not reduced** (the request used `"reduce":false`), then each result represents an individual transaction that caused a currency exchange, with the following attributes:
|
||||
|
||||
| Field | Value | Description |
|
||||
|-------|-------|-------------|
|
||||
| time | String ([Date-Time][]) | The time this transaction occurred, as defined by the close time of the ledger that included it. |
|
||||
| price | Number | The amount of the counter currency received for each unit of the base-currency spent in this trade. |
|
||||
| baseAmount | Number | Total amount of the base currency spent in this trade. |
|
||||
| counterAmount | Number | Total amount of the counter currency received in this trade. |
|
||||
| account | String | The Ripple address of the account providing the base currency. |
|
||||
| counterparty | String | The Ripple address of the account providing the counter currency. |
|
||||
| tx_hash | String | The identifying hash of the transaction where this transaction occurred. |
|
||||
| ledgerIndex | Number | The sequence number of the ledger that included this transaction. |
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -225,6 +226,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -99,7 +100,6 @@
|
||||
<li>Place Order</li>
|
||||
<li>Cancel Order</li>
|
||||
<li>Get Account Orders</li>
|
||||
<li>Get Order Transaction</li>
|
||||
<li>Get Order Book</li>
|
||||
<br/>
|
||||
<li>Get Trustlines</li>
|
||||
@@ -162,6 +162,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -167,6 +168,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
"md": "historical_data.md",
|
||||
"html": "historical_data.html"
|
||||
},
|
||||
{
|
||||
"name": "Ripple Charts API",
|
||||
"md": "charts_api.md",
|
||||
"html": "charts_api.html"
|
||||
},
|
||||
{
|
||||
"name": "Gateway Services",
|
||||
"md":"gateway_services_spec.md",
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
@@ -130,6 +131,7 @@
|
||||
<li><a href="reliable_tx.html">Reliable Transaction Submission</a></li>
|
||||
<li><a href="gateway_guide.html">Gateway Guide</a></li>
|
||||
<li><a href="historical_data.html">Historical Data API</a></li>
|
||||
<li><a href="charts_api.html">Ripple Charts API</a></li>
|
||||
<li><a href="gateway_services.html">Gateway Services</a></li>
|
||||
<li><a href="whitepapers.html">Whitepapers</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user