/bitcoin/latest

Retrieves the latest bitcoin rates for today, in USD.


Definition

https://api.upcdatabase.org/bitcoin/latest
Parameter Type Description
format string Can be json (default) or text (optional)

Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.upcdatabase.org/bitcoin/latest',
  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/latest",
  "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/latest' \
--header 'Authorization: Bearer THISISALIVEDEMOAPIKEY19651D54X47'
https://api.upcdatabase.org/bitcoin/latest?apikey=YOURAPIKEYHERE

Response

The response contains an JSON array with the recent bitcoin price. format.

{
    "success": true,
    "timestamp": 1693340227,
    "date": "2023-08-29",
    "base": "USD",
    "rates": {
        "high": "28031.6036",
        "low": "25909.4428",
        "latest": "27871.3997"
    }
}
27871.3997