/bitcoin/history

Retrieves the currency conversion rates for a specific date.


Definition

https://api.upcdatabase.org/bitcoin/history?date=YYYY-MM-DD
Parameter Description
date In format: YYYY-MM-DD (required)

Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.upcdatabase.org/bitcoin/history/?date=2020-04-24',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer THISISALIVEDEMOAPIKEY19651D54X47'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var settings = {
  "url": "https://api.upcdatabase.org/bitcoin/history/?date=2020-04-24",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer THISISALIVEDEMOAPIKEY19651D54X47"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
curl --location --request GET 'https://api.upcdatabase.org/bitcoin/history/?date=2020-04-24' \
--header 'Authorization: Bearer THISISALIVEDEMOAPIKEY19651D54X47'

Response

The response contains an array of all the currently supported currencies in JSON format.

{
    "success": true,
    "timestamp": 1693341317,
    "date": "2020-02-13",
    "base": "USD",
    "rates": {
        "high": "10512.4812",
        "low": "10107.0894",
        "close": "10245.4185"
    }
}