example-data.com
Menu
Browse docs and collections

crypto-holdings

crypto-holdings

Page 17 of 21.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/crypto-holdings?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/crypto-holdings?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/crypto-holdings.d.ts https://example-data.com/types/crypto-holdings.d.ts
import type { CryptoHolding, ListEnvelope } from "./types/crypto-holdings";

const res = await fetch(
  "https://example-data.com/api/v1/crypto-holdings?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<CryptoHolding>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/crypto-holdings",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 385,
      "userId": 196,
      "cryptoId": 14,
      "quantity": 16.98991868,
      "costBasis": 120.09208,
      "purchasedAt": "2024-10-29T04:02:51.133Z"
    },
    {
      "id": 386,
      "userId": 196,
      "cryptoId": 9,
      "quantity": 19.54583801,
      "costBasis": 12.15470375,
      "purchasedAt": "2024-09-03T02:58:44.178Z"
    },
    {
      "id": 387,
      "userId": 197,
      "cryptoId": 26,
      "quantity": 29.47693771,
      "costBasis": 36.64838785,
      "purchasedAt": "2024-07-20T23:13:47.029Z"
    }
  ],
  "meta": {
    "page": 17,
    "limit": 24,
    "total": 498,
    "totalPages": 21
  },
  "links": {
    "self": "/api/v1/crypto-holdings?page=17&limit=24",
    "first": "/api/v1/crypto-holdings?page=1&limit=24",
    "last": "/api/v1/crypto-holdings?page=21&limit=24",
    "next": "/api/v1/crypto-holdings?page=18&limit=24",
    "prev": "/api/v1/crypto-holdings?page=16&limit=24"
  }
}