Xurrency provides developers with direct access to exchange rate information. Now you can integrate the data into your site directly from Xurrency or allow people to query the exchange rate. The API is based in JSON, a simple machine-readable data-interchange format.
Xurrency API requires the use of an API Key in order to access to its data. If you want to adquire a license key, please click here.
When a request is successful, the following JSON object is returned:
Attribute | Value | Explanation |
---|---|---|
status | ok | You can check status for success (ok) or failure (fail) |
code | 0 | Have a look at Return codes table |
result | object |
result is a JSON object containing the following attributes:
|
When a request is failed, a JSON object is returned as well, but with different attributes:
Attribute | Value | Explanation |
---|---|---|
status | fail | You can check status for success (ok) or failure (fail) |
code | 1-6 | Have a look at Return codes table |
message | string | Error explanation |
Code | Status | Message |
---|---|---|
0 | ok | |
1 | fail | Amount should be between 0 and 999999999 |
2 | fail | Currencies are not valid |
3 | fail | Limit Reached (10 requests per day). Please adquire a license key |
4 | fail | The api key is not valid |
5 | fail | Your api key has expired. Please renew it |
6 | fail | Currency codes are the same |
7 | fail | Invalid Date |
{
"result":{
"updated_at":"2020-10-13T16:01:24Z",
"value":"1.3577",
"target":"gbp",
"base":"eur"
},
"code":0,
"status":"ok"
}
{
"code":2,
"message":"Currencies are not valid",
"status":"fail"
}
{
"code":1,
"message":"Amount should be between 0 and 999999999",
"status":"fail"
}
{
"result":[
{
"updated_at":"2020-10-13T16:01:24Z",
"value":1.3287,
"target":"gbp",
"base":"eur"
},
{
"updated_at":"2020-10-13T16:01:24Z",
"value":2.17275,
"target":"usd",
"base":"eur"
},
{
"updated_at":"2020-10-13T16:01:24Z",
"value":2.0877,
"target":"cad",
"base":"eur"
}
],
"code":0,
"status":"ok"
}
{
"result":{
"updated_at":"/api/eur/gbp/usd/cad/1.5",
"value":"1.3487",
"target":"usd",
"base":"eur"
},
"code":0,
"status":"ok"
}