example-data.com
Menu
Browse docs and collections

Overview

stocks / #24

Costco Wholesale Corporation

symbol
COST
name
Costco Wholesale Corporation
exchange
NASDAQ
sector
Consumer Staples
marketCap
4218236097365
price
2652.73
priceChangePercent24h
14.86
volume24h
246413343
createdAt

Component variants

Related

Referenced by

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/stocks/24" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/stocks/24"
);
const stock = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/stocks.d.ts https://example-data.com/types/stocks.d.ts
import type { Stock } from "./types/stocks";

const res = await fetch(
  "https://example-data.com/api/v1/stocks/24"
);
const stock = (await res.json()) as Stock;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/stocks/24"
)
stock = res.json()

Response

{
  "id": 24,
  "symbol": "COST",
  "name": "Costco Wholesale Corporation",
  "exchange": "NASDAQ",
  "sector": "Consumer Staples",
  "marketCap": 4218236097365,
  "price": 2652.73,
  "priceChangePercent24h": 14.86,
  "volume24h": 246413343,
  "createdAt": "2024-11-14T20:29:08.043Z"
}