Skip to main content

Get Coin ID

This endpoint allows you to generate a coin ID from parent coin name, puzzle hash, and amount.

Endpoint

POST https://api.spacescan.io/tools/get_coin_id

Request Body Parameters

ParameterTypeRequiredDefaultDescription
parent_coin_namestringYes-Parent coin name (with or without 0x prefix)
puzzle_hashstringYes-Puzzle hash (with or without 0x prefix)
amountnumberYes-Amount in XCH
Free API

Use api.spacescan.io for free tier access. See our API Plans for rate limits and features.

Pro API

Use pro-api.spacescan.io with your API key in the x-api-key header. See our API Plans for details.

curl -X POST "https://pro-api.spacescan.io/tools/get_coin_id" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"parent_coin_name":"0x6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589","puzzle_hash":"0x94c6db00186900418ef7c1f05e127ee1a647cbe6e514ec32c66bd9bb228d96da","amount":1.5}'

Request Examples

curl -X POST "https://api.spacescan.io/tools/get_coin_id" \
-H "Content-Type: application/json" \
-d '{
"parent_coin_name": "0x6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589",
"puzzle_hash": "0x94c6db00186900418ef7c1f05e127ee1a647cbe6e514ec32c66bd9bb228d96da",
"amount": 1.5
}'

Response Schema

FieldTypeDescription
statusstringStatus of the request (success/failure)
datastringThe generated coin ID

Example Response

{
"status": "success",
"data": "0x8b3c547f70d1f2e9b12f302c3a1fa12905152406e7b42f3903f21c1dcd4e6d54"
}

Error Responses

HTTP Status CodeMeaning
400Bad Request -- Invalid input format or parameters
429Too Many Requests -- You're requesting too many times
500Internal Server Error -- We had a problem with our server
503Service Unavailable -- We're temporarily offline for maintenance