example-data.com
Menu
Browse docs and collections

Overview

crypto-holdings / #50

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/crypto-holdings/50" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/crypto-holdings/50"
);
const cryptoHolding = 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 } from "./types/crypto-holdings";

const res = await fetch(
  "https://example-data.com/api/v1/crypto-holdings/50"
);
const cryptoHolding = (await res.json()) as CryptoHolding;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/crypto-holdings/50"
)
crypto_holding = res.json()

Response

{
  "id": 50,
  "userId": 21,
  "cryptoId": 12,
  "quantity": 7.27875893,
  "costBasis": 4.236876,
  "purchasedAt": "2024-05-27T22:57:26.990Z"
}