#BIP-0171 - Current exchange rate [**Contact the developer**](mailto:contact@cerise.tech) **Version** 0.4 ## / ### 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 | Everything worked as expected. | Array[<a href="#/definitions/CurrentExchangeRateResult">CurrentExchangeRateResult</a>]| | 400 | The request was unacceptable, often due to missing a required parameter. | <a href="#/definitions/CeriseError">CeriseError</a>| | 401 | No valid authorization was provided. | <a href="#/definitions/CeriseError">CeriseError</a>| | 402 | The parameters were valid but the request failed. | <a href="#/definitions/CeriseError">CeriseError</a>| | 404 | The requested resource doesn&#x27;t exist. | <a href="#/definitions/CeriseError">CeriseError</a>| | 500 | Something went wrong on the server. | <a href="#/definitions/CeriseError">CeriseError</a>| # Definitions ## <a name="/definitions/CeriseError">CeriseError</a> <table border="1"> <tr> <th>name</th> <th>type</th> <th>required</th> <th>description</th> <th>example</th> </tr> <tr> <td>type</td> <td> string </td> <td>required</td> <td>The type of error returned. One of api_connection_error, api_error, authentication_error, invalid_request_error or rate_limit_error.</td> <td>invalid_request_error</td> </tr> <tr> <td>message</td> <td> string </td> <td>required</td> <td>A human-readable message providing more details about the error.</td> <td>Invalid request to currency-pair information</td> </tr> <tr> <td>errors</td> <td> array[<a href="#/definitions/CeriseErrorDetail">CeriseErrorDetail</a>] </td> <td>optional</td> <td>List of errors.</td> <td></td> </tr> </table> ## <a name="/definitions/CeriseErrorDetail">CeriseErrorDetail</a> <table border="1"> <tr> <th>name</th> <th>type</th> <th>required</th> <th>description</th> <th>example</th> </tr> <tr> <td>code</td> <td> string </td> <td>required</td> <td>Error code.</td> <td>currency_code_invalid</td> </tr> <tr> <td>message</td> <td> string </td> <td>required</td> <td>A human-readable message providing more details about the error.</td> <td>Invalid currency code : AAA</td> </tr> </table> ## <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>optional</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>