Cryptocurrency Converter

Authentication

To interact with our API, authentication is required for all endpoints. Include your API token in the request header using the Authorization header.

How to authenticate?

Use your API token in the request header like so:

Example: Using cURL

curl -H "Authorization: Bearer YOUR_API_TOKEN" -s https://api.plenix.net/v1/cryptocurrency-converter/cryptocurrencies

Example: Using JavaScript (fetch API)

                                                
fetch("https://api.plenix.net/v1/cryptocurrency-converter/cryptocurrencies", {
    headers: {
        "Authorization": "Bearer YOUR_API_TOKEN"
    }
})
.then(response => response.json())
.then(data => console.log(data));
                                                
                                            

Example: Using Postman

1. Open Postman and create a new request.
2. Set the request type to GET.
3. Enter the URL:

https://api.plenix.net/v1/cryptocurrency-converter/cryptocurrencies
4. Go to the Headers tab and add:
Key: Authorization
Value: Bearer YOUR_API_TOKEN
5. Click Send to receive the response.

Usage

Use the endpoints provided to convert cryptocurrencies, get historical data, and more.

Convert Cryptocurrency

Convert a specified amount of one cryptocurrency into another.

curl -H "Authorization: Bearer YOUR_API_TOKEN" -s https://api.plenix.net/v1/cryptocurrency-converter/convert?crypto=bitcoin&currency=usd&amount=1
                                                
{
    "amount": "1",
    "crypto": "BITCOIN",
    "currency": "USD",
    "converted_value": "45000.00"
}
                                                
                                            

Historical Data

Retrieve historical market data for a given cryptocurrency over a specified date range within the last 365 days.

The historical data includes price, market cap, and total volume information.

To retrieve data, you need to specify the following parameters:

  • crypto - The cryptocurrency (e.g., bitcoin, ethereum).
  • currency - The target fiat currency (e.g., usd, eur).
  • start_date - Start date in YYYY-MM-DD format.
  • end_date - End date in YYYY-MM-DD format.

Request Example

curl -H "Authorization: Bearer YOUR_API_TOKEN" -s "https://api.plenix.net/v1/cryptocurrency-converter/historical-data?crypto=bitcoin&currency=usd&start_date=2024-01-01&end_date=2024-01-07"

Response Example

                                                
{
    "prices": [
        [1704067241331, 42261.04],
        [1704070847420, 42493.28],
        [1704074443652, 42654.07]
    ],
    "market_caps": [
        [1704067241331, 827596236151.196],
        [1704070847420, 831531023621.411],
        [1704074443652, 835499399014.932]
    ],
    "total_volumes": [
        [1704067241331, 14305769170.9498],
        [1704070847420, 14130205376.1709],
        [1704074443652, 13697382902.2424]
    ]
}
                                                
                                            

Response Format

The response will include the following fields:

  • prices - An array of arrays where each sub-array contains a timestamp (UNIX) and the corresponding price.
  • market_caps - An array of arrays where each sub-array contains a timestamp (UNIX) and the market cap value at that time.
  • total_volumes - An array of arrays where each sub-array contains a timestamp (UNIX) and the total volume traded at that time.

Latest Rates

Fetch the latest exchange rates for the specified cryptocurrency.

This endpoint provides up-to-date conversion rates for a specific cryptocurrency in a given currency.

Required parameters:

  • crypto - The cryptocurrency (e.g., bitcoin, ethereum).
  • currency - The currency to convert to (e.g., usd, eur).
curl -H "Authorization: Bearer YOUR_API_TOKEN" -s "https://api.plenix.net/v1/cryptocurrency-converter/latest?crypto=bitcoin&currency=usd"
                                                
{
    "bitcoin": {
        "usd": 45000.00
    }
}
                                                
                                            

Available Cryptocurrencies

Retrieve a list of supported cryptocurrencies.

This endpoint returns a full list of supported cryptocurrencies, with their IDs and symbols.

curl -H "Authorization: Bearer YOUR_API_TOKEN" -s "https://api.plenix.net/v1/cryptocurrency-converter/cryptocurrencies"
                                                
[
    {
        "id": "bitcoin",
        "symbol": "btc",
        "name": "Bitcoin"
    },
    {
        "id": "ethereum",
        "symbol": "eth",
        "name": "Ethereum"
    },
    {
        "id": "ripple",
        "symbol": "xrp",
        "name": "Ripple"
    },
    ...
]