🔄 btcflip.me API Documentation

BTC to XMR Exchange API - Go Edition

HTTP/2 HTTP/3 TLS 1.3

Health & Information

GET /api/health

Check the health status of the API service.

curl http://localhost/api/health
Response (200 OK):
{
  "status": "healthy",
  "service": "btcflip-exchange",
  "timestamp": "2024-01-01T00:00:00Z"
}
Try it →
GET /api/info

Get service information and supported features.

curl http://localhost/api/info
Try it →

Exchange Operations

GET /api/exchange/minimum

Get minimum and maximum BTC amounts for exchange.

curl http://localhost/api/exchange/minimum
Response (200 OK):
{
  "minimum_btc": "0.0005",
  "maximum_btc": "100",
  "currency_from": "btc",
  "currency_to": "xmr"
}
Try it →
GET /api/exchange/estimate

Estimate the XMR amount you'll receive for a given BTC amount.

Parameter Type Description
btc_amount required string Amount of BTC to exchange (e.g., "0.001")
curl "http://localhost/api/exchange/estimate?btc_amount=0.001"
Response (200 OK):
{
  "btc_amount": "0.00100000",
  "estimated_xmr_amount": "0.15234567",
  "exchange_rate": "152.34567000",
  "minimum_amount": "0.00050000",
  "maximum_amount": "100.00000000",
  "fee_amount": "0.00000500",
  "fee_percentage": 0.5,
  "net_btc_amount": "0.00099500"
}
POST /api/exchange/create

Create a new BTC to XMR exchange.

Parameter Type Description
btc_amount required string Amount of BTC to exchange
xmr_address required string Destination Monero address
curl -X POST http://localhost/api/exchange/create \
  -H "Content-Type: application/json" \
  -d '{
    "btc_amount": "0.001",
    "xmr_address": "4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2684Rge"
  }'
Response (200 OK):
{
  "exchange_id": "abc123def456",
  "btc_deposit_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "estimated_xmr_amount": "0.15234567",
  "status": "pending",
  "created_at": "2024-01-01T00:00:00Z",
  "btc_amount": "0.00100000",
  "fee_amount": "0.00000500",
  "fee_percentage": 0.5,
  "net_btc_amount": "0.00099500"
}
GET /api/exchange/{id}/status

Get the current status of an exchange.

Parameter Type Description
id required string Exchange ID from create response
curl http://localhost/api/exchange/abc123def456/status
Response (200 OK):
{
  "exchange_id": "abc123def456",
  "status": "completed",
  "status_message": "Exchange completed successfully",
  "btc_amount": "0.00100000",
  "xmr_amount": "0.15234567",
  "btc_deposit_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "progress_percentage": 100,
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:05:00Z",
  "completed_at": "2024-01-01T00:05:00Z"
}

Address Validation

POST /api/validate/address

Validate a cryptocurrency address.

Parameter Type Description
address required string Cryptocurrency address to validate
currency optional string Currency type (default: "xmr")
curl -X POST http://localhost/api/validate/address \
  -H "Content-Type: application/json" \
  -d '{
    "address": "4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2684Rge",
    "currency": "xmr"
  }'
Response (200 OK):
{
  "address": "4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx...",
  "currency": "xmr",
  "valid": true,
  "error_message": ""
}

HTTP Status Codes

Code Status Description
200 OK Request successful
400 Bad Request Invalid parameters or validation error
404 Not Found Exchange ID not found
500 Internal Server Error Server error occurred

Exchange Status Values

Status Description
pending Waiting for BTC deposit
waiting Deposit received, awaiting confirmations
exchanging Converting BTC to XMR
processing Processing the exchange
completed Exchange completed, XMR sent
failed Exchange failed