{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Market Rates v2","type":"basic","slug":"market-rates-v2","excerpt":"","body":"## List all default exchange rates\n\nReturns all default exchange rates for all configured markets.\n\n**Query Parameters:**\n- `region` (optional) Client's region, which is PH by default\n\nFor PH region: https://quote.coins.ph/v2/markets\nFor TH region: https://quote.coins.ph/v2/markets?region=TH\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    markets: [\\n    {\\n        symbol: \\\"BTC-USD\\\",\\n        currency: \\\"USD\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"11357.06\\\",\\n        ask: \\\"11691.87\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"XRP-PHP\\\",\\n        currency: \\\"PHP\\\",\\n        product: \\\"XRP\\\",\\n        bid: \\\"12.84\\\",\\n        ask: \\\"13.01\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-HKD\\\",\\n        currency: \\\"HKD\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"88414.00\\\",\\n        ask: \\\"91099.88\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BCH-PHP\\\",\\n        currency: \\\"PHP\\\",\\n        product: \\\"BCH\\\",\\n        bid: \\\"12691.41\\\",\\n        ask: \\\"13230.13\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"ETH-PHP\\\",\\n        currency: \\\"PHP\\\",\\n        product: \\\"ETH\\\",\\n        bid: \\\"18294.36\\\",\\n        ask: \\\"19066.74\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-BCH\\\",\\n        currency: \\\"BCH\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"42.41034780\\\",\\n        ask: \\\"44.21338748\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"USD-PHP\\\",\\n        currency: \\\"PHP\\\",\\n        product: \\\"USD\\\",\\n        bid: \\\"48.27\\\",\\n        ask: \\\"48.81\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-PHP\\\",\\n        currency: \\\"PHP\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"550156.53\\\",\\n        ask: \\\"572469.86\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-IDR\\\",\\n        currency: \\\"IDR\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"161982563\\\",\\n        ask: \\\"177051098\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-MYR\\\",\\n        currency: \\\"MYR\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"47600.03\\\",\\n        ask: \\\"49046.04\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-TWD\\\",\\n        currency: \\\"TWD\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"335014.11\\\",\\n        ask: \\\"345191.33\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-VND\\\",\\n        currency: \\\"VND\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"262476933\\\",\\n        ask: \\\"270450579\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-XRP\\\",\\n        currency: \\\"XRP\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"42388.290688\\\",\\n        ask: \\\"43197.089202\\\",\\n        expires_in_seconds: 30\\n    },\\n    {\\n        symbol: \\\"BTC-ETH\\\",\\n        currency: \\\"ETH\\\",\\n        product: \\\"BTC\\\",\\n        bid: \\\"29.433203680367358097\\\",\\n        ask: \\\"30.655979127180751129\\\",\\n        expires_in_seconds: 30\\n    }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**PROPERTIES**\n\n**symbol** - Market symbol, which is a unique identifier for the exchange rate.\n**currency** - The currency to be exchanged to produce one unit of product.\n**product** - The currency produced when the required amount of currency is exchanged.\n**bid** - The price per unit when product is being exchanged for currency.\n**ask** - The price per unit when currency is being exchanged for a product.\n**expires_in_seconds** - The amount of seconds before the quote expires.\n\n## Get regular exchange rate\n\nIn order to get the exchange rate for a specific market symbol, you can also include the `symbol` on the path parameters of the request.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\n\\nurl = 'https://quote.coins.ph/v2/markets/BTC-PHP'\\n\\nheaders = {\\n    'Authorization': 'Bearer useraccesstoken'\\n    'Content-Type': 'application/json;charset=UTF-8',\\n    'Accept': 'application/json'\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nSample response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    symbol: \\\"BTC-PHP\\\",\\n    currency: \\\"PHP\\\",\\n    product: \\\"BTC\\\",\\n    bid: \\\"550232.19\\\",\\n    ask: \\\"572792.20\\\",\\n    expires_in_seconds: 30\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Get exchange rate base on an amount or quantity\n\nCoins.ph's market rates API also allows you to get the exchange rates based on a specified **amount** or **quantity**. However, this feature requires [authentication](doc:choosing-an-authentication-method).\n\nThis capability is only available to the new endpoint https://quote.coins.ph/v2/private_markets/\n\nParameters and properties from earlier examples are still relevant. To get the exchange rate for the provided `symbol`, a sample request would follow https://quote.coins.ph/v2/private_markets/BTC-PHP\n\n**Query Parameters:**\n- `quantity` quantity of a product.\n- `amount` amount of currency.\n- `region` (optional) Client's region, which is PH by default\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"1. Only one query parameter is allowed per request. The parameters `quantity` or `amount` should not both be used at the same time.\\n\\n2. Private Markets endpoint with the query parameters `quantity` or `amount` will only work if the symbol is included e.g https://quote.coins.ph/v2/private_markets/BTC-PHP?quantity=100.\",\n  \"title\": \"Important Notes\"\n}\n[/block]\nA request with any of the query parameters - quantity or amount - **without a specified symbol** will yield the following result:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\n\\nurl = 'https://quote.coins.ph/v2/private_markets?quantity=100'\\n\\nheaders = {\\n    'Authorization': 'Bearer useraccesstoken'\\n    'Content-Type': 'application/json;charset=UTF-8',\\n    'Accept': 'application/json'\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    symbol: \\\"BTC-PHP\\\",\\n    currency: \\\"PHP\\\",\\n    product: \\\"BTC\\\",\\n    bid: \\\"550232.19\\\",\\n    ask: \\\"572792.20\\\",\\n    expires_in_seconds: 30\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","updates":[],"order":999,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5f4f5d311e5c9d001a6c3127","createdAt":"2020-09-02T08:52:01.103Z","user":"5f48b1396405e2006ba2024f","category":{"sync":{"isSync":false,"url":""},"pages":["56326e9ddf556c0d00cd08d5","56326e9ddf556c0d00cd08d6","56326e9ddf556c0d00cd08d7","56326e9ddf556c0d00cd08d8","56326e9ddf556c0d00cd08d9"],"title":"Getting Started","slug":"getting-started","order":0,"from_sync":false,"reference":false,"_id":"56326e9ddf556c0d00cd08cb","version":"56326e9cdf556c0d00cd08ca","createdAt":"2014-10-28T16:17:02.556Z","project":"544fc17e698ab40800b4f891","__v":1},"version":{"version":"2.1","version_clean":"2.1.0","codename":"collector","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56326e9ddf556c0d00cd08cb","56326e9ddf556c0d00cd08cc","56326e9ddf556c0d00cd08cd","56326e9ddf556c0d00cd08ce","56326e9ddf556c0d00cd08cf","56326e9ddf556c0d00cd08d0","56326e9ddf556c0d00cd08d1","56326e9ddf556c0d00cd08d2","56326e9ddf556c0d00cd08d3","56326e9ddf556c0d00cd08d4","56d942ac337fd11300d6a251","5ab2fcf66a1d77001230b47e","5afc2943bd2ef4000330bca7","5d1d87419a969a00141c6b4c","5d1d8948ef26b2002c6468d1","5d1d8afe7b2b24005bec7de0","5d1d8b24f5cfcb00201490bb","5d1d8bb82d46d1004a02581f","5d1d8de1e4edb0019ed63acd","5d1d8f6b613fb90050d0d3e0","5d1d934ed377870191039d28","5d1d99810b2e4600500eb5ff","5d1da14e613fb90050d0d491","5d229a846cf323005a7fa998","5d229a8c8abf65001cc4768d","5d229a9494b856002e26b6e1","5d229a9bf77bb900507ccb04","5d229aa88abf65001cc4768e","5d24310a9ca8c80054786177","5d24359101cc3a00508e7482","5d24418fa791b20050733b32"],"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","releaseDate":"2015-10-29T19:08:12.724Z","__v":22,"createdAt":"2015-10-29T19:08:12.724Z"},"project":"544fc17e698ab40800b4f891","__v":0}
## List all default exchange rates Returns all default exchange rates for all configured markets. **Query Parameters:** - `region` (optional) Client's region, which is PH by default For PH region: https://quote.coins.ph/v2/markets For TH region: https://quote.coins.ph/v2/markets?region=TH [block:code] { "codes": [ { "code": "{\n markets: [\n {\n symbol: \"BTC-USD\",\n currency: \"USD\",\n product: \"BTC\",\n bid: \"11357.06\",\n ask: \"11691.87\",\n expires_in_seconds: 30\n },\n {\n symbol: \"XRP-PHP\",\n currency: \"PHP\",\n product: \"XRP\",\n bid: \"12.84\",\n ask: \"13.01\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-HKD\",\n currency: \"HKD\",\n product: \"BTC\",\n bid: \"88414.00\",\n ask: \"91099.88\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BCH-PHP\",\n currency: \"PHP\",\n product: \"BCH\",\n bid: \"12691.41\",\n ask: \"13230.13\",\n expires_in_seconds: 30\n },\n {\n symbol: \"ETH-PHP\",\n currency: \"PHP\",\n product: \"ETH\",\n bid: \"18294.36\",\n ask: \"19066.74\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-BCH\",\n currency: \"BCH\",\n product: \"BTC\",\n bid: \"42.41034780\",\n ask: \"44.21338748\",\n expires_in_seconds: 30\n },\n {\n symbol: \"USD-PHP\",\n currency: \"PHP\",\n product: \"USD\",\n bid: \"48.27\",\n ask: \"48.81\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-PHP\",\n currency: \"PHP\",\n product: \"BTC\",\n bid: \"550156.53\",\n ask: \"572469.86\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-IDR\",\n currency: \"IDR\",\n product: \"BTC\",\n bid: \"161982563\",\n ask: \"177051098\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-MYR\",\n currency: \"MYR\",\n product: \"BTC\",\n bid: \"47600.03\",\n ask: \"49046.04\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-TWD\",\n currency: \"TWD\",\n product: \"BTC\",\n bid: \"335014.11\",\n ask: \"345191.33\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-VND\",\n currency: \"VND\",\n product: \"BTC\",\n bid: \"262476933\",\n ask: \"270450579\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-XRP\",\n currency: \"XRP\",\n product: \"BTC\",\n bid: \"42388.290688\",\n ask: \"43197.089202\",\n expires_in_seconds: 30\n },\n {\n symbol: \"BTC-ETH\",\n currency: \"ETH\",\n product: \"BTC\",\n bid: \"29.433203680367358097\",\n ask: \"30.655979127180751129\",\n expires_in_seconds: 30\n }\n ]\n}", "language": "json" } ] } [/block] **PROPERTIES** **symbol** - Market symbol, which is a unique identifier for the exchange rate. **currency** - The currency to be exchanged to produce one unit of product. **product** - The currency produced when the required amount of currency is exchanged. **bid** - The price per unit when product is being exchanged for currency. **ask** - The price per unit when currency is being exchanged for a product. **expires_in_seconds** - The amount of seconds before the quote expires. ## Get regular exchange rate In order to get the exchange rate for a specific market symbol, you can also include the `symbol` on the path parameters of the request. [block:code] { "codes": [ { "code": "import requests\n\nurl = 'https://quote.coins.ph/v2/markets/BTC-PHP'\n\nheaders = {\n 'Authorization': 'Bearer useraccesstoken'\n 'Content-Type': 'application/json;charset=UTF-8',\n 'Accept': 'application/json'\n}", "language": "python" } ] } [/block] Sample response: [block:code] { "codes": [ { "code": "{\n symbol: \"BTC-PHP\",\n currency: \"PHP\",\n product: \"BTC\",\n bid: \"550232.19\",\n ask: \"572792.20\",\n expires_in_seconds: 30\n}", "language": "json" } ] } [/block] ## Get exchange rate base on an amount or quantity Coins.ph's market rates API also allows you to get the exchange rates based on a specified **amount** or **quantity**. However, this feature requires [authentication](doc:choosing-an-authentication-method). This capability is only available to the new endpoint https://quote.coins.ph/v2/private_markets/ Parameters and properties from earlier examples are still relevant. To get the exchange rate for the provided `symbol`, a sample request would follow https://quote.coins.ph/v2/private_markets/BTC-PHP **Query Parameters:** - `quantity` quantity of a product. - `amount` amount of currency. - `region` (optional) Client's region, which is PH by default [block:callout] { "type": "warning", "body": "1. Only one query parameter is allowed per request. The parameters `quantity` or `amount` should not both be used at the same time.\n\n2. Private Markets endpoint with the query parameters `quantity` or `amount` will only work if the symbol is included e.g https://quote.coins.ph/v2/private_markets/BTC-PHP?quantity=100.", "title": "Important Notes" } [/block] A request with any of the query parameters - quantity or amount - **without a specified symbol** will yield the following result: [block:code] { "codes": [ { "code": "import requests\n\nurl = 'https://quote.coins.ph/v2/private_markets?quantity=100'\n\nheaders = {\n 'Authorization': 'Bearer useraccesstoken'\n 'Content-Type': 'application/json;charset=UTF-8',\n 'Accept': 'application/json'\n}", "language": "python" } ] } [/block] [block:code] { "codes": [ { "code": "{\n symbol: \"BTC-PHP\",\n currency: \"PHP\",\n product: \"BTC\",\n bid: \"550232.19\",\n ask: \"572792.20\",\n expires_in_seconds: 30\n}", "language": "json" } ] } [/block]