{"_id":"566b81db30cdb417008d217b","category":{"_id":"566b431d03b4b20d00d02c3a","version":"55312174c68f493900aebb42","__v":8,"pages":["566b438f1766bf0d00e73981","566b51a3f46dc90d009de82a","566b57f068eba90d009cac72","566b6564461c970d0038bfd9","566b6f17bc5adc0d0096760c","566b7c8a03870a0d008ee7a2","566b81db30cdb417008d217b","56a48d9521d3d60d000341f4"],"project":"55312174c68f493900aebb3f","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-11T21:41:49.917Z","from_sync":false,"order":1,"slug":"basic-requests","title":"API Endpoints"},"editedParams2":true,"version":{"_id":"55312174c68f493900aebb42","project":"55312174c68f493900aebb3f","__v":10,"createdAt":"2015-04-17T15:06:28.598Z","releaseDate":"2015-04-17T15:06:28.598Z","categories":["55312175c68f493900aebb43","566b431d03b4b20d00d02c3a","566b58f212bc0517005d3068","566b59110506f40d0034f148","566b7cc94d1a4d0d00801c00","566b82d130cdb417008d217d","566b855b4d1a4d0d00801c04","566b856f03870a0d008ee7a7","566c42d2f0a5dc0d009acbab","566c443d85dc790d0062c134"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.7.0","version":"0.7"},"editedParams":true,"__v":1,"project":"55312174c68f493900aebb3f","user":"5531215e29603d2300011341","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-12T02:09:31.364Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"https://openexchangerates.org/api/convert/19999.95/GBP/EUR?app_id=YOUR_APP_ID","language":"http"},{"language":"javascript","code":"var from = \"GBP\",\n    to = \"EUR\",\n    value = \"19999.95\";\n\n$.get('https://openexchangerates.org/api/convert/' + value + '/' + from + '/' + to, {app_id: 'YOUR_APP_ID'}, function(data) {\n    console.log(data);\n});","name":"jQuery"}]},"method":"get","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"disclaimer\": \"https://openexchangerates.org/terms/\",\n    \"license\": \"https://openexchangerates.org/license/\",\n    \"request\": {\n        \"query\": \"/convert/19999.95/GBP/EUR\",\n        \"amount\": 19999.95,\n        \"from\": \"GBP\",\n        \"to\": \"EUR\"\n    },\n    \"meta\": {\n        \"timestamp\": 1449885661,\n        \"rate\": 1.383702\n    },\n    \"response\": 27673.975864\n}","name":""},{"status":400,"name":"Bad Request (invalid_currency)","code":"{\n    \"error\": true,\n    \"status\": 400,\n    \"message\": \"invalid_currency\",\n    \"description\": \"Invalid `to` currency symbol - please try again, or contact support:::at:::openexchangerates.org\"\n}","language":"json"},{"code":"{\n    \"error\": true,\n    \"status\": 400,\n    \"message\": \"invalid_amount\",\n    \"description\": \"Invalid currency amount - please try again, or contact support@openexchangerates.org\"\n}","language":"json","status":400,"name":"Bad Request (invalid_amount)"}]},"settings":"","auth":"required","params":[{"_id":"566b47ff85fbc81700f89547","ref":"","in":"query","required":false,"desc":"Your unique App ID (required)","default":"Required","type":"string","name":"app_id"},{"_id":"566b6564461c970d0038bfda","ref":"","in":"path","required":false,"desc":"The value to be converted","default":"Required","type":"int","name":"value"},{"_id":"566b438f1766bf0d00e73983","ref":"","in":"path","required":false,"desc":"The base ('from') currency (3-letter code)","default":"Required","type":"string","name":"from"},{"_id":"566b438f1766bf0d00e73982","ref":"","in":"path","required":false,"desc":"The target ('to') currency (3-letter code)","default":"Required","type":"string","name":"to"},{"_id":"566b81db30cdb417008d217c","ref":"","in":"query","required":false,"desc":"Human-readable response for debugging","default":"Optional","type":"boolean","name":"prettyprint"}],"url":"/convert/:value/:from/:to"},"isReference":true,"order":4,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Unlimited Plan Feature\",\n  \"body\": \"Currency conversion requests are currently available for clients on the Unlimited plan.\"\n}\n[/block]\nYour query is returned in the `request` object parameter for validation.\n\nThe `rate` and `timestamp` used to perform the conversion are given in the `meta` object parameter.\n\nThe converted value is given in the `response` parameter. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Important note about Currency Conversion queries:\"\n}\n[/block]\nThe `/convert` API is offered to save time in integration, but does not imply any difference in accuracy, validity or fitness for purpose from the data that can be obtained with any other API request. \n\nReturned values are used at your own risk, so we strongly recommend validating any returned values before employing them in any system or interface where transactions are processed. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Errors\"\n}\n[/block]\nPlease see [API Error Messages](doc:errors) for a list of possible errors not specified above.","excerpt":"Convert any money value from one currency to another at the latest API rates using the /convert API endpoint.\n\nThis feature works differently to other endpoints in our API, using a REST-based approach and an alternate response format.\n\nCurrency conversion requests are currently available for clients on the Unlimited plan.","slug":"convert","type":"endpoint","title":"/convert"}

get/convert

Convert any money value from one currency to another at the latest API rates using the /convert API endpoint. This feature works differently to other endpoints in our API, using a REST-based approach and an alternate response format. Currency conversion requests are currently available for clients on the Unlimited plan.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

value:
integerRequired
The value to be converted
from:
stringRequired
The base ('from') currency (3-letter code)
to:
stringRequired
The target ('to') currency (3-letter code)

Query Params

app_id:
stringRequired
Your unique App ID (required)
prettyprint:
booleanOptional
Human-readable response for debugging

Examples


Result Format


Documentation

[block:callout] { "type": "info", "title": "Unlimited Plan Feature", "body": "Currency conversion requests are currently available for clients on the Unlimited plan." } [/block] Your query is returned in the `request` object parameter for validation. The `rate` and `timestamp` used to perform the conversion are given in the `meta` object parameter. The converted value is given in the `response` parameter. [block:api-header] { "type": "basic", "title": "Important note about Currency Conversion queries:" } [/block] The `/convert` API is offered to save time in integration, but does not imply any difference in accuracy, validity or fitness for purpose from the data that can be obtained with any other API request. Returned values are used at your own risk, so we strongly recommend validating any returned values before employing them in any system or interface where transactions are processed. [block:api-header] { "type": "basic", "title": "Errors" } [/block] Please see [API Error Messages](doc:errors) for a list of possible errors not specified above.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}