Lana Coins Logo

Lana Coins API Documentation

Exchange Rate API

Endpoint

GET /api/exchange-rate

Description

Returns the current exchange rate for Lana Coins in EUR.

Authentication

API requests require an API key passed as a query parameter.

api_key=097196115e1c903f492fd5cede78fb9f3519737a68584b2c2bc0397bfeae5e39

Example Request

GET /api/exchange-rate?api_key=097196115e1c903f492fd5cede78fb9f3519737a68584b2c2bc0397bfeae5e39

Example Response

{
  "success": true,
  "data": {
    "rate": 0.0000123,
    "rate_formatted": "0.0000123",
    "currency": "EUR",
    "updated_at": "2023-04-01T12:34:56.789012"
  }
}

Error Responses

Invalid or missing API key:

{
  "error": "Invalid or missing API key"
}

Exchange rate not available:

{
  "error": "Exchange rate not available"
}

Implementation Example

JavaScript/jQuery

// Using jQuery
$.ajax({
  url: 'https://your-domain.com/api/exchange-rate',
  method: 'GET',
  data: {
    api_key: '097196115e1c903f492fd5cede78fb9f3519737a68584b2c2bc0397bfeae5e39'
  },
  success: function(response) {
    console.log('Current rate:', response.data.rate);
  },
  error: function(xhr) {
    console.error('Error:', xhr.responseJSON.error);
  }
});

Python

import requests

url = 'https://your-domain.com/api/exchange-rate'
params = {
    'api_key': '097196115e1c903f492fd5cede78fb9f3519737a68584b2c2bc0397bfeae5e39'
}

response = requests.get(url, params=params)
data = response.json()

if response.status_code == 200:
    print(f"Current rate: {data['data']['rate']}")
else:
    print(f"Error: {data['error']}")