A simple API to retrieve historical and current price data for Handshake (HNS).
View on GitHub
Returns the single most recent price for a given currency.
Query Parameters:
currency
(string, optional): usd
or
btc
. Defaults to usd
.
Behavior:
Accept: application/json
header is sent, returns
the full data object as JSON.
Examples:
# Get the latest BTC price as plain text curl
"https://price.hns.dev/latest?currency=btc"
# Get the latest USD price as a JSON object curl -H "Accept:
application/json" "https://price.hns.dev/latest"
Returns stored price data. Provides powerful filtering and aggregation.
Query Parameters:
from
(string, optional): Start date (YYYY-MM-DD).
Defaults to today.
to
(string, optional): End date (YYYY-MM-DD).currency
(string, optional): usd
or
btc
. Defaults to usd
.
Behavior:
from
is provided, returns all granular data for
that single day.
from
and to
are different, returns the
single latest entry for each day in the range.
Examples:
# Get all data for today in USD (default) curl
"https://price.hns.dev/historical"
# Get all granular data for a specific day in USD curl
"https://price.hns.dev/historical?from=2023-01-15"
# Get all granular data for a specific day in BTC curl
"https://price.hns.dev/historical?currency=btc&from=2023-01-15"
# Get a daily summary for a date range in BTC curl
"https://price.hns.dev/historical?currency=btc&from=2023-01-01&to=2023-01-31"
Downloads the complete SQLite database file.
# Download the database using a browser or curl curl -o database.db
"https://price.hns.dev/database.db"
Returns the minimum price for a given currency.
Query Parameters:
currency
(string, optional): usd
or
btc
. Defaults to usd
.
since
(string, optional): Start date (YYYY-MM-DD). If
provided, it will only include prices from that date onwards.
Behavior:
Accept: application/json
header is sent, returns
the full data object as JSON.
Examples:
# Get the minimum BTC price as plain text curl
"https://price.hns.dev/min?currency=btc"
# Get the minimum USD price since 2023-01-01 as a JSON object curl -H
"Accept: application/json"
"https://price.hns.dev/min?since=2023-01-01"
Returns the maximum price for a given currency.
Query Parameters:
currency
(string, optional): usd
or
btc
. Defaults to usd
.
since
(string, optional): Start date (YYYY-MM-DD). If
provided, it will only include prices from that date onwards.
Behavior:
Accept: application/json
header is sent, returns
the full data object as JSON.
Examples:
# Get the maximum BTC price as plain text curl
"https://price.hns.dev/max?currency=btc"
# Get the maximum USD price since 2023-01-01 as a JSON object curl -H
"Accept: application/json"
"https://price.hns.dev/max?since=2023-01-01"