STX Testnet tokens
Delivers testnet STX tokens to a specified address.
Request Body
application/json
OptionalQuery Parameters
address?string
A valid testnet STX address
stacking?boolean
Request the amount of STX tokens needed for individual address stacking
Default
false
Response Body
POST request that initiates a transfer of tokens to a specified testnet address
TypeScript Definitions
Use the response body type in TypeScript.
successboolean
Indicates if the faucet call was successful
Value in
true
txIdstring
The transaction ID for the faucet call
txRawstring
Raw transaction in hex string representation
Default Response
TypeScript Definitions
Use the response body type in TypeScript.
successboolean
Indicates if the faucet call was successful
Value in
false
errorstring
Error message
help?string
curl -X POST "https://api.hiro.so//extended/v1/faucets/stx?address=ST3M7N9Q9HDRM7RVP1Q26P0EE69358PZZAZD7KMXQ&stacking=false" \
-H "Content-Type: application/json" \
-d '{}'
const body = JSON.stringify({})
fetch("https://api.hiro.so//extended/v1/faucets/stx?address=ST3M7N9Q9HDRM7RVP1Q26P0EE69358PZZAZD7KMXQ&stacking=false", {
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.hiro.so//extended/v1/faucets/stx?address=ST3M7N9Q9HDRM7RVP1Q26P0EE69358PZZAZD7KMXQ&stacking=false"
body := strings.NewReader(`{}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://api.hiro.so//extended/v1/faucets/stx?address=ST3M7N9Q9HDRM7RVP1Q26P0EE69358PZZAZD7KMXQ&stacking=false"
body = {}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)
{
"success": true,
"txId": "string",
"txRaw": "string"
}
{
"success": false,
"error": "string",
"help": "string"
}