HNS Price API Documentation

A simple API to retrieve historical and current price data for Handshake (HNS).

View on GitHub

GET /latest

Returns the single most recent price for a given currency.

Query Parameters:

Behavior:

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"

GET /historical

Returns stored price data. Provides powerful filtering and aggregation.

Query Parameters:

Behavior:

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"

GET /database.db

Downloads the complete SQLite database file.

# Download the database using a browser or curl curl -o database.db "https://price.hns.dev/database.db"

GET /min

Returns the minimum price for a given currency.

Query Parameters:

Behavior:

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"

GET /max

Returns the maximum price for a given currency.

Query Parameters:

Behavior:

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"