stock-holdings #228
- userId
-
Leora Doyle @leora_doyle
- stockId
- stocks/42
- quantity
- 9.415
- costBasis
- 323.15
- purchasedAt
Overview
stock-holdings / #228
#228
#228
Request
curl example
curl -sS \ "https://example-data.com/api/v1/stock-holdings/228" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/stock-holdings/228" ); const stockHolding = await res.json();
TypeScript example
// Download once: mkdir -p types && curl -o types/stock-holdings.d.ts https://example-data.com/types/stock-holdings.d.ts
import type { StockHolding } from "./types/stock-holdings";
const res = await fetch(
"https://example-data.com/api/v1/stock-holdings/228"
);
const stockHolding = (await res.json()) as StockHolding; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/stock-holdings/228"
)
stock_holding = res.json() Response
{
"id": 228,
"userId": 117,
"stockId": 42,
"quantity": 9.415,
"costBasis": 323.15,
"purchasedAt": "2024-09-26T13:09:47.432Z"
}