#BIP-0171 - Current exchange rate ## HTTP://api.cerise.tech/ A common interface for requesting currency exchange rate information from a server - BIP171 implementation [**Contact the developer**](mailto:stephane.traumat@gmail.com) **Version** 0.2 [**Terms of Service**](https://github.com/straumat/cerise/blob/master/LICENSE) [**BSD 2-Clause &quot;Simplified&quot; License**](https://github.com/straumat/cerise/blob/master/LICENSE) # APIs ## / ### GET <a id="getCurrencyPairInformation">Currency-pair information</a> #### Request ##### Parameters <table border="1"> <tr> <th>Name</th> <th>Located in</th> <th>Required</th> <th>Description</th> <th>Default</th> <th>Schema</th> </tr> <tr> <th>mode</th> <td>query</td> <td>yes</td> <td>Always &quot;rate&quot; for this request.</td> <td> - </td> <td>string </td> </tr> <tr> <th>cp</th> <td>query</td> <td>yes</td> <td>Currency pair(s) for which information is requested.</td> <td> - </td> <td>Array[string] (multi)</td> </tr> <tr> <th>type</th> <td>query</td> <td>no</td> <td>Type of exchange rate data being requested. May be &quot;high&quot;, &quot;low&quot;, &quot;average&quot;, &quot;typical&quot;, or any other arbitrary name. If omitted, the server may provide any rates it deems appropriate.</td> <td> - </td> <td>Array[string] (multi)</td> </tr> <tr> <th>minrate</th> <td>query</td> <td>no</td> <td>If specified, indicates this request is a long poll. The server should not send a response until the rate(s) fall below or above (respectively) the provided value.</td> <td> - </td> <td>number (double)</td> </tr> <tr> <th>maxrate</th> <td>query</td> <td>no</td> <td>If specified, indicates this request is a long poll. The server should not send a response until the rate(s) fall below or above (respectively) the provided value.</td> <td> - </td> <td>number (double)</td> </tr> <tr> <th>nonce</th> <td>query</td> <td>no</td> <td>If specified, the server SHOULD return it in each result.</td> <td> - </td> <td>string </td> </tr> </table> #### Response | Status Code | Reason | Response Model | |-------------|-------------|----------------| | 200 | successful operation | Array[<a href="#/definitions/CurrentExchangeRateResult">CurrentExchangeRateResult</a>]| # Definitions ## <a name="/definitions/CurrentExchangeRateResult">CurrentExchangeRateResult</a> <table border="1"> <tr> <th>name</th> <th>type</th> <th>required</th> <th>description</th> <th>example</th> </tr> <tr> <td>cp</td> <td> string </td> <td>required</td> <td>The currency-pair token. Currency-pair tokens are arbitrary Strings no longer than 255 characters, which may include any ASCII RFC 3986 unreserved characters (ie, alphanumerics and the hyphen, underscore, period, and tilde symbols)</td> <td>XBTUSD-ver4</td> </tr> <tr> <td>time</td> <td> number (double) </td> <td>required</td> <td>The time (as a POSIX timestamp) the rate information is applicable to (should be approximately the request time).</td> <td>1.4887674105463133E9</td> </tr> <tr> <td>rates</td> <td> object </td> <td>required</td> <td>A JSON Object with each rate type provided as a key, and a Number as the value specifying the rate.).</td> <td>{&quot;typical&quot;: 1349.332215, &quot;high&quot;: 1351.2}</td> </tr> <tr> <td>nonce</td> <td> string </td> <td>required</td> <td>Only if the request specified a nonce, the server SHOULD include it here as a JSON String.</td> <td>ERAGDYEJAGD</td> </tr> <tr> <td>signature</td> <td> string </td> <td>optional</td> <td>May be used for Linked Data Signatures</td> <td></td> </tr> </table>