{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Formatting Parameters","type":"basic","slug":"formatting-parameters","excerpt":"Formatting API response data","body":"We have a few URL parameters to help format the API response data. URL parameters are appended to the URL where the first parameter is preceded with \"?\" and subsequent parameters are preceded with \"&\". Here is an example:\n\nhttps://api.sendwyre.com/v3/rates?pretty&as=priced\n\nYou can see `?pretty` is the first parameter, and `&as=` is the second with a value of `priced`. If you remove the URL parameters the formatting reverts to a less structured state.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"URL Parameter\",\n    \"h-1\": \"Values\",\n    \"0-0\": \"`pretty`\",\n    \"0-1\": \"no value\\nReturns an easily readable JSON format\",\n    \"1-0\": \"`format`\",\n    \"1-1\": \"`json_numberstring`\\nThis encodes all numbers returned from our API as strings.\\n\\n`csv`\\nThis downloads rates as CSV file.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Rates Formatting\"\n}\n[/block]\nWhen fetching current rates there are also additional formatting parameters available.\n\nGET https://api.sendwyre.com/v2/rates\n\nThe ordering of the trade pair in the key represents the direction of an exchange. For example, BTCUSD is the rate used for BTC into USD conversions (e.g. the sell rate). On the other hand, converting USD into BTC (the buy rate) would use the opposite rate under USDBTC.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Rates Parameter\",\n    \"h-1\": \"Value\",\n    \"0-0\": \"`as`\",\n    \"0-1\": \"`divisor`\\nSource amount / rate = destination amount (default)\\n\\n`multiplier`\\nSource amount * rate = destination amount\\n\\n`priced`\\nShows both divisor and multiplier values\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\nYou can also view the rates in different formats according to your preference:\n\n##Examples:\nhttps://api.sendwyre.com/v2/rates?as=divisor - source amount / rate = destination amount (default)\n\nhttps://api.sendwyre.com/v2/rates?as=multiplier - source amount * rate = destination amount\n\nhttps://api.sendwyre.com/v2/rates?as=priced&pretty&format=json_numberstring - shows both divisor and multiplier values\n\nhttps://api.sendwyre.com/v2/rates?as=priced&pretty&format=csv - downloads rates as CSV file\nFor example, if 1 BTC is selling at 9000 USD, USDBTC will be 9000 in the divisor view and (1/9000) in the pretty view.\n[block:api-header]\n{\n  \"title\": \"Pagination Parameters\"\n}\n[/block]\nWe split our tabular data into pages of 25 items. You can apply the parameters below to any request for tabular to adjust the pagination.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`offset `\",\n    \"1-0\": \"`limit `\",\n    \"2-0\": \"`from `\",\n    \"3-0\": \"`to `\",\n    \"0-1\": \"How many items are skipped before the first item that is shown (default: 0).\",\n    \"1-1\": \"Number of items returned per page (default: 25).\",\n    \"2-1\": \"The lower bound of a creation time filter for the displayed items. Formatted in millisecond Epoch format. (default: 0)\",\n    \"3-1\": \"The upper bound of a creation time filter for the displayed items. Formatted in millisecond Epoch format. (default: current time)\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","updates":[],"order":5,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"60f1c711fe6ef5001cdfe5ed","createdAt":"2021-07-16T17:51:13.705Z","user":"5f7f6ea298ba660011771f74","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Wyre API","slug":"getting-started","order":0,"from_sync":false,"reference":true,"_id":"5be5d13ff1d319002baca9ce","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","createdAt":"2018-11-09T18:26:07.698Z","__v":0},"version":{"version":"3","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded","5e8127d61c906800374eeb1c","5f2768c98622b8005106544a","5f2768d05702ca0011f7655e","5f276e5348d2b600321aef9b","5f276fd300e519001139200a","5f9a2cb79dafe500259281a7","5fd92bf362bb7301b00e48ba","60ef489344d5cf002cd7414d"],"_id":"550f75de61d9d30d00af9e01","__v":25,"releaseDate":"2015-03-23T02:09:34.221Z","project":"550f74bb6fc8130d0038aad3","createdAt":"2015-03-23T02:09:34.221Z","forked_from":"550f74bb6fc8130d0038aad6"},"project":"550f74bb6fc8130d0038aad3","__v":0,"parentDoc":null}

Formatting Parameters

Formatting API response data

We have a few URL parameters to help format the API response data. URL parameters are appended to the URL where the first parameter is preceded with "?" and subsequent parameters are preceded with "&". Here is an example: https://api.sendwyre.com/v3/rates?pretty&as=priced You can see `?pretty` is the first parameter, and `&as=` is the second with a value of `priced`. If you remove the URL parameters the formatting reverts to a less structured state. [block:parameters] { "data": { "h-0": "URL Parameter", "h-1": "Values", "0-0": "`pretty`", "0-1": "no value\nReturns an easily readable JSON format", "1-0": "`format`", "1-1": "`json_numberstring`\nThis encodes all numbers returned from our API as strings.\n\n`csv`\nThis downloads rates as CSV file." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "title": "Rates Formatting" } [/block] When fetching current rates there are also additional formatting parameters available. GET https://api.sendwyre.com/v2/rates The ordering of the trade pair in the key represents the direction of an exchange. For example, BTCUSD is the rate used for BTC into USD conversions (e.g. the sell rate). On the other hand, converting USD into BTC (the buy rate) would use the opposite rate under USDBTC. [block:parameters] { "data": { "h-0": "Rates Parameter", "h-1": "Value", "0-0": "`as`", "0-1": "`divisor`\nSource amount / rate = destination amount (default)\n\n`multiplier`\nSource amount * rate = destination amount\n\n`priced`\nShows both divisor and multiplier values" }, "cols": 2, "rows": 1 } [/block] You can also view the rates in different formats according to your preference: ##Examples: https://api.sendwyre.com/v2/rates?as=divisor - source amount / rate = destination amount (default) https://api.sendwyre.com/v2/rates?as=multiplier - source amount * rate = destination amount https://api.sendwyre.com/v2/rates?as=priced&pretty&format=json_numberstring - shows both divisor and multiplier values https://api.sendwyre.com/v2/rates?as=priced&pretty&format=csv - downloads rates as CSV file For example, if 1 BTC is selling at 9000 USD, USDBTC will be 9000 in the divisor view and (1/9000) in the pretty view. [block:api-header] { "title": "Pagination Parameters" } [/block] We split our tabular data into pages of 25 items. You can apply the parameters below to any request for tabular to adjust the pagination. [block:parameters] { "data": { "0-0": "`offset `", "1-0": "`limit `", "2-0": "`from `", "3-0": "`to `", "0-1": "How many items are skipped before the first item that is shown (default: 0).", "1-1": "Number of items returned per page (default: 25).", "2-1": "The lower bound of a creation time filter for the displayed items. Formatted in millisecond Epoch format. (default: 0)", "3-1": "The upper bound of a creation time filter for the displayed items. Formatted in millisecond Epoch format. (default: current time)" }, "cols": 2, "rows": 4 } [/block]