Create SUBTC API Key via curl

permalink SUBTC
#api#create#key#subtc#via

Before using the SUBTC Bitcoin API, you must generate an API key.
This key authenticates all requests sent to the SUBTC gateway.

Command:
RESP=$(curl -sS -X POST "https://api.subtc.net/v1/btc?mode=key_create" \
-H "Content-Type: application/json")

Extract the key from the JSON response:

KEY=$(echo "$RESP" | sed -n 's/.*"key":"\([^"]*\)".*/\1/p')

Print the key:

echo "KEY=$KEY"

Example output:

KEY=SUBTC-KEY-c942534db29afa0a50957ef909c8ea4a4fb17bf5392b1682

This key must be included in all authenticated requests using the header:

X-SUBTC-KEY

API Base:
https://subtc.net/api