example-data.com
Menu
Browse docs and collections

stocks

stocks

Page 2 of 5.

Overview

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/stocks?limit=25"
);
const { data, meta } = 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, ListEnvelope } from "./types/stocks";

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

Python example

import requests

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

Response

{
  "data": [
    {
      "id": 25,
      "symbol": "CVX",
      "name": "Chevron Corporation",
      "exchange": "NYSE",
      "sector": "Energy",
      "marketCap": 4691422441999,
      "price": 4383.48,
      "priceChangePercent24h": -3.2,
      "volume24h": 337939101,
      "createdAt": "2025-03-16T15:09:52.590Z"
    },
    {
      "id": 26,
      "symbol": "WMT",
      "name": "Walmart Inc.",
      "exchange": "NYSE",
      "sector": "Consumer Staples",
      "marketCap": 11917636752430,
      "price": 2401.22,
      "priceChangePercent24h": -2.58,
      "volume24h": 494683067,
      "createdAt": "2025-07-07T11:18:49.913Z"
    },
    {
      "id": 27,
      "symbol": "MRK",
      "name": "Merck & Co. Inc.",
      "exchange": "NYSE",
      "sector": "Health Care",
      "marketCap": 14513729204691,
      "price": 3970.08,
      "priceChangePercent24h": 9.43,
      "volume24h": 22319382,
      "createdAt": "2024-07-07T12:01:15.549Z"
    }
  ],
  "meta": {
    "page": 2,
    "limit": 24,
    "total": 100,
    "totalPages": 5
  },
  "links": {
    "self": "/api/v1/stocks?page=2&limit=24",
    "first": "/api/v1/stocks?page=1&limit=24",
    "last": "/api/v1/stocks?page=5&limit=24",
    "next": "/api/v1/stocks?page=3&limit=24",
    "prev": "/api/v1/stocks?page=1&limit=24"
  }
}