raresats.net API
Listings API View as Markdown

Get an affiliate

GET/api/market/affiliates/{address}

Any address of the network is an affiliate (no registration). Its totals and its newest referred purchases: purchases broadcast here whose referral applied. registered is informational, kept for compatibility.

Path parameters #

ParameterTypeRequiredDescription
addressstringyesThe affiliate's mainnet address.

Example request #

cURL
curl 'https://raresats.net/api/market/affiliates/bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh'
JavaScript
const response = await fetch('https://raresats.net/api/market/affiliates/bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh');
const data = await response.json();
Python
import requests

data = requests.get("https://raresats.net/api/market/affiliates/bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh").json()

Response 200 #

FieldTypeDescription
addressstringThe affiliate's address, normalized.
registeredbooleanInformational, kept for compatibility: whether the address used the optional registration. Not needed to be paid: any address is an affiliate.
registered_atinteger | nullWhen it used the optional registration (unix seconds), or null.
share_bpsintegerThe affiliate's share of the platform fee in force, basis points.
totalsobject
totals.purchasesintegerReferred purchases broadcast through the marketplace (pending or confirmed).
totals.confirmedintegerOf those, confirmed.
totals.pendingintegerOf those, in the mempool.
totals.earnedintegerSats paid to the affiliate in confirmed purchases.
totals.pending_earnedintegerSats in purchases still in the mempool.
totals.volumeintegerSummed listing prices of the referred purchases.
purchasesarray of objectThe 25 newest referred purchases, newest first.
purchases[].txidstringThe purchase transaction.
purchases[].itemsintegerListings bought.
purchases[].pricesintegerTheir summed prices.
purchases[].platform_feeintegerThe platform fee the buyer paid.
purchases[].affiliate_feeintegerThe affiliate's output.
purchases[].statusstringpending or confirmed.
purchases[].timeintegerUnix seconds.
Response
{
  "address": "bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh",
  "registered": false,
  "registered_at": null,
  "share_bps": 5000,
  "totals": {
    "purchases": 1,
    "confirmed": 1,
    "pending": 0,
    "earned": 757,
    "pending_earned": 0,
    "volume": 60546
  },
  "purchases": [
    {
      "txid": "6897451c42f02de2594abfdd6a5d4fcf4794a62cbbd9fbec1ec983893ddc5df4",
      "items": 1,
      "prices": 60546,
      "platform_fee": 1514,
      "affiliate_fee": 757,
      "status": "confirmed",
      "time": 1790952985
    }
  ]
}

Errors #

{error, code}; see Errors for every code.

StatusCodeMeaning
400bad_addressAn address is not a mainnet address (or not one at all).
400bad_pathThe path is not valid percent-encoding.
Error (400)
{"error": "not a mainnet address", "code": "bad_address"}

Any address of the network is an affiliate. registered is informational, kept for compatibility: whether the address used the optional registration, which is not needed to be paid. Only purchases whose referral applied count: an affiliate output is in the transaction. A referral that was ignored_self, invalid or below_minimum paid nothing and is not listed. The registering wallets' addresses are kept private. How the programme works: Affiliates.