# Sat

`GET /api/sat/{n}`

One sat: the block that mined it, its types and rows, inscriptions, where it is now, every sale of it (newest first) and the marketplace's live listing of its UTXO. Cacheable 15 s. `pending` says where a transaction still in the mempool takes it; its pending sales lead `sales`, marked `pending`.

#### Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `n` | integer | yes | The sat number, a decimal integer below 2,099,999,997,690,000. (min 0) |

#### Example request

```bash title="cURL"
curl 'https://raresats.net/api/sat/45100023043'
```
```js title="JavaScript"
const response = await fetch('https://raresats.net/api/sat/45100023043');
const data = await response.json();
```
```python title="Python"
import requests

data = requests.get("https://raresats.net/api/sat/45100023043").json()
```

#### Response `200`

| Field | Type | Description |
| --- | --- | --- |
| `sat` | integer | The sat number. |
| `as_of` | object \| null | `{height, time}` of the index. |
| `explorer` | string \| null | Block explorer base URL (`https://mempool.space`). |
| `height` | integer | The block that mined it. |
| `block_time` | integer \| null | That block's time, unix seconds. |
| `luck` | integer \| null | Its luck, its block's: how many more leading zero bits the block hash has than its difficulty target required (every sat of a block shares it). `null` while the luck table is being read. |
| `tracked` | boolean | Whether the rare-sat index tracks it (location and sales are known only then). |
| `types` | array of string | Its sat types. |
| `rows` | array of string | Its rows. |
| `inscribed` | boolean | Whether it carries inscriptions. |
| `inscriptions` | integer | How many. |
| `location` | object \| null | Where it is now: `{kind: unspent\|burned\|lost\|overwritten, satpoint, outpoint, offset, output}`. `output` is the UTXO holding it (`outpoint`, `value`, `address`, `quantity`, `groups`, `ranges`, `rows` (the fork's sats per row), …), `null` for a lost sat. Its `output` carries `spent_by_pending` (a `PendingSpend`) while a pending transaction spends it. |
| `sales` | array of object | Every sale of it, newest first. |
| `sales[].seq` | integer \| null | The sales store's sequence number, else `null`. |
| `sales[].txid` | string | The sale transaction. |
| `sales[].vin` | integer \| null | The seller input. |
| `sales[].height` | integer \| null | Block height (null while pending). |
| `sales[].time` | integer | Unix seconds. |
| `sales[].marketplace` | string | Marketplace id. |
| `sales[].price` | integer \| null | Price in sats. |
| `sales[].row` | string \| null | The sale's own row. |
| `sales[].unit_price` | number \| null | Unit price per sat of that row. |
| `sales[].count` | integer \| null | Sats of that row sold. |
| `sales[].sats_sold` | integer \| null | Tracked sats the sale sold. |
| `sales[].seller` | object \| null | `{address, outpoint}`. |
| `sales[].buyer` | object \| null | `{address, outpoint}`. |
| `sales[].inscribed` | boolean | An inscription was on a sold sat. |
| `sales[].outlier` | boolean \| null | A statistical outlier (`null` when unknown). |
| `sales[].secondary` | map of integer | A sale's secondary rows: the market rows of the other sats it sold (not its own row, a row it is a sub-category of, or a label row), each with its sats, primary-first: `{"black_omega": 1}` for a black omega sold with an alpha uncommon; `{}` for none. A sale never counts in its secondary rows' markets (the primary-sat rule, in Concepts). |
| `sales[].as` | array of string | The sat's rows (`rows`, in its order) the sale sold sats of: why a sale another row led is listed on this sat (a Block 9 chunk on its palindrome's page names `block9`, `block9_palindrome`, `nakamoto_palindrome`). |
| `sales[].pending` | boolean | Still in the mempool: listed first, with `first_seen` and `fee_rate`; `time` is `first_seen`. |
| `sales[].first_seen` | integer \| null | When the transaction was first seen in the mempool (bitcoind's entry time), unix seconds. |
| `sales[].fee_rate` | number \| null | Its fee rate, sat/vB (one decimal). |
| `listing` | [Listing](https://raresats.net/docs/listing-object.md) \| null | The marketplace's live (active or pending) listing of its UTXO, else `null`. |
| `pending` | object \| null | Where transactions still in the mempool take it (the end of a chain of them), else null: `{txid, first_seen, fee_rate, kind: unspent\|burned\|fee, satpoint, outpoint, offset, output, url}`; `output` is the pending output (a `PendingOutput`), null when it goes to fees. `location` stays the confirmed one, its output carrying `spent_by_pending`. Present only while the index serves its mempool overlay. |

#### Errors

`{error}` (a message, no code):

| Status | When |
| --- | --- |
| 400 | Not a sat number. |
| 503 | The index is unavailable or busy. |

- A sat the index does not track still gets its types and rows, with no location or sales.
- `luck` is its block's: how many more leading zero bits the block hash has than its difficulty target required ([Sat luck](https://raresats.net/docs/guide-filters.md#sat-luck)).
- `listing` is the marketplace's live listing of the UTXO the sat is in (a [Listing](https://raresats.net/docs/listing-object.md)), or `null`.
- Each sale in `sales` carries the Sales tab's `seq`, row, unit price and count when the sales index has it, and its `secondary` rows: the other sats sold with it (a black omega sold with this alpha uncommon).
- `pending` says where a transaction still in the mempool takes the sat (`{txid, first_seen, fee_rate, kind, satpoint, outpoint, offset, output}`; `kind` is `fee` when it goes to the miner), else `null`. `location` stays the confirmed one; its output carries `spent_by_pending`. The sat's pending sales lead `sales`, with `pending: true`, `first_seen` and `fee_rate` and no `height`.
