Marketplace

Available datasets

De-identified extracts published from the Cureledger Data Trust. This is the free catalog — metadata only. Buy a dataset’s full records by card, or with a one-line USDC payment (x402); see How to access the data below.

For developers

How to access the data

Browsing the catalog is free. Buy a dataset’s full de-identified records with x402 — a one-line, on-chain USDC payment on Base. Three steps: list the datasets, read the price, pay. Every endpoint is under https://buy.cureledger.com.

You’ll need curl + jq to inspect, and — to actually buy — Node and a wallet holding a little USDC on Base. No gas token required: the payment is gasless for you (the facilitator submits it on-chain).

1. Browse the catalog

Public — no auth, no payment.

curl https://buy.cureledger.com/api/marketplace/datasets
{
  "datasets": [
    {
      "id": "dataset-…",
      "title": "phe-food-logs",
      "rowCount": 128,
      "price": null,
      "deidVersion": "consumer-food-1",
      "fieldSchema": {
        "studyId": "opaque per-dataset id",
        "logs": "[{ dayOffset, foodId, foodName, grams, pheMg, proteinG, kcal, estimate, source }]"
      },
      "createdAt": "2026-08-28T19:45:06.124Z"
    }
  ]
}

2. Read the price

Ask for a download without paying and you get back 402 Payment Required. The exact terms — network, amount, token, and address — ride in a base64 payment-required header. Decode it in one pipe:

curl -sD - -o /dev/null \
  https://buy.cureledger.com/api/marketplace/datasets/<id>/download \
  | grep -i '^payment-required:' | awk '{print $2}' | base64 -d | jq

That prints the terms:

{
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:8453",         // Base mainnet
    "amount": "10000",                // 0.01 USDC (6 decimals)
    "asset": "0x833589fCD6…",         // USDC on Base
    "payTo": "0x…"                    // where the USDC goes
  }]
}

3. Pay + download

The payment has to be signed by your wallet, so plain curl can’t finish it. Point any x402 client at the same URL — it reads the terms from the 402, pays on Base, and retries in one call. Install the client:

npm install @x402/core @x402/evm @x402/fetch viem

Then buy (WALLET_KEY is your buyer wallet’s private key — fund it with USDC on Base):

import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.WALLET_KEY);
const client = registerExactEvmScheme(new x402Client(), {
  signer: account,
  networks: ["eip155:8453"], // Base
});
const pay = wrapFetchWithPayment(fetch, client);

const res = await pay("https://buy.cureledger.com/api/marketplace/datasets/<id>/download");
console.log(await res.text()); // → 200, the de-identified CSV

You get back 200 and the CSV — long-format, one row per diet log with each record’s fields repeated. Same USDC you signed for moves to the payTo address; nothing else is charged.