Conversion
curl --request POST \
--url https://s-apis.oppigames.com/game/conversion-rates \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-signature: <x-signature>' \
--header 'x-timestamp: <x-timestamp>' \
--data '
{
"currency": "<string>",
"amount": 123
}
'import requests
url = "https://s-apis.oppigames.com/game/conversion-rates"
payload = {
"currency": "<string>",
"amount": 123
}
headers = {
"x-api-key": "<x-api-key>",
"x-signature": "<x-signature>",
"x-timestamp": "<x-timestamp>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-signature': '<x-signature>',
'x-timestamp': '<x-timestamp>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({currency: '<string>', amount: 123})
};
fetch('https://s-apis.oppigames.com/game/conversion-rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://s-apis.oppigames.com/game/conversion-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => '<string>',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>",
"x-signature: <x-signature>",
"x-timestamp: <x-timestamp>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": "RS_OK",
"data": [
{
"currencyCode": "INR",
"amount": 170
},
{
"currencyCode": "EUR",
"amount": 500
}
]
}
{
"status": "RS_ERROR",
"message": "Oops! Something went wrong. Please refresh the page or try again in a moment"
}
Currency
Conversion
This API converts an amount from one currency to another; if no currency is provided, it converts to all supported currencies, and if no amount is provided, it defaults to 1 USD.
POST
/
game
/
conversion-rates
Conversion
curl --request POST \
--url https://s-apis.oppigames.com/game/conversion-rates \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-signature: <x-signature>' \
--header 'x-timestamp: <x-timestamp>' \
--data '
{
"currency": "<string>",
"amount": 123
}
'import requests
url = "https://s-apis.oppigames.com/game/conversion-rates"
payload = {
"currency": "<string>",
"amount": 123
}
headers = {
"x-api-key": "<x-api-key>",
"x-signature": "<x-signature>",
"x-timestamp": "<x-timestamp>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-signature': '<x-signature>',
'x-timestamp': '<x-timestamp>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({currency: '<string>', amount: 123})
};
fetch('https://s-apis.oppigames.com/game/conversion-rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://s-apis.oppigames.com/game/conversion-rates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => '<string>',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>",
"x-signature: <x-signature>",
"x-timestamp: <x-timestamp>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": "RS_OK",
"data": [
{
"currencyCode": "INR",
"amount": 170
},
{
"currencyCode": "EUR",
"amount": 500
}
]
}
{
"status": "RS_ERROR",
"message": "Oops! Something went wrong. Please refresh the page or try again in a moment"
}
Headers
string
required
A unique identifier associated with operator calling API.
string
required
A SHA256 HMAC signature generated using the request body and timestamp.
Format: HMAC_SHA256(JSON.stringify(data) + ’|’ + timestamp), signed using the provided secret key.
string
required
An Unix timestamp (milliseconds) Used to verify the request’s freshness.
Ensure the same value is used in signature generation.
The signature will remain valid for only 5 minutes from the provided timestamp.
string
required
Must be set to
application/json.Request Body
string
The currency code for which the conversion is requested (e.g., “INR”, “USD”).
See the list of supported currencies here.
See the list of supported currencies here.
number
The amount to be converted.
Response
string
required
Code indicates status of the request whether it is succeeded or failed. We have listed error codes here.
Show data properties
Show data properties
{
"status": "RS_OK",
"data": [
{
"currencyCode": "INR",
"amount": 170
},
{
"currencyCode": "EUR",
"amount": 500
}
]
}
{
"status": "RS_ERROR",
"message": "Oops! Something went wrong. Please refresh the page or try again in a moment"
}
⌘I
