Skip to main content

API reference

API documentation

A read-only JSON API over the same market data this site renders. Successful responses use the { data, meta } envelope; failures use { error: { code, message } }.

Base URL
http://localhost:3000
Methods
GET only
Format
JSON, UTF-8
Rate limit
60 requests per 60 seconds, per IP address and endpoint

These are API examples. This site is served as static files.

Demo
Responses come from a deterministic demo dataset with fictional issuers unless the server sets MARKET_DATA_PROVIDER=fmp together with FMP_API_KEY. The meta.provider field of every response says which source answered.

List quotes

GET/api/quotes

Returns one page of instruments as a flat array, with total, page and pageSize in meta. Every screener filter below works here too; values that cannot be parsed are ignored.

Parameters

ParameterInTypeRequiredDescription
sectorquerystringOptionalExact sector name: Technology, Healthcare, Financials, Consumer Discretionary, Consumer Staples, Industrials, Energy, Materials, Utilities, Real Estate.
sortquerystringOptionalSort field: marketCap (default), price, changePercent, volume or symbol.
orderquerystringOptionalSort order: desc (default) or asc.
pagequerynumberOptionalPage number, starting at 1.
pageSizequerynumberOptionalRows per page: 20 by default, 100 at most.

Request

curl -s "http://localhost:3000/api/quotes?pageSize=3"

Response sample

200application/json

{
  "data": [
    {
      "symbol": "NWRB",
      "name": "Northwind Robotics",
      "exchange": "NASDAQ",
      "sector": "Technology",
      "industry": "Industrial Automation",
      "price": 733.8,
      "change": -16.52,
      "changePercent": -2.2,
      "previousClose": 750.32,
      "open": 750.03,
      "dayHigh": 751.29,
      "dayLow": 731.5,
      "volume": 3471317,
      "avgVolume": 2962633,
      "marketCap": 982258754565,
      "peRatio": 60.35,
      "eps": 12.16,
      "dividendYield": null,
      "week52High": 963.99,
      "week52Low": 583.89,
      "afterHoursPrice": 731,
      "afterHoursChangePercent": -0.38,
      "updatedAt": "2026-11-12T21:00:00.000Z"
    }
  ],
  "meta": {
    "provider": "demo",
    "generatedAt": "2026-11-12T21:00:04.512Z",
    "disclaimer": "Demo dataset: fictional issuers and simulated prices. Not investment advice.",
    "total": 20,
    "page": 1,
    "pageSize": 3
  }
}

The sample is shortened to one row.

Get a quote

GET/api/quotes/{symbol}

Returns the full quote for one instrument or index. An unknown symbol returns 404 not_found.

Parameters

ParameterInTypeRequiredDescription
symbolpathstringRequiredInstrument or index symbol, for example NWRB. Matching ignores case.

Request

curl -s "http://localhost:3000/api/quotes/NWRB"

Response sample

200application/json

{
  "data": {
    "symbol": "NWRB",
    "name": "Northwind Robotics",
    "exchange": "NASDAQ",
    "sector": "Technology",
    "industry": "Industrial Automation",
    "price": 733.8,
    "change": -16.52,
    "changePercent": -2.2,
    "previousClose": 750.32,
    "open": 750.03,
    "dayHigh": 751.29,
    "dayLow": 731.5,
    "volume": 3471317,
    "avgVolume": 2962633,
    "marketCap": 982258754565,
    "peRatio": 60.35,
    "eps": 12.16,
    "dividendYield": null,
    "week52High": 963.99,
    "week52Low": 583.89,
    "afterHoursPrice": 731,
    "afterHoursChangePercent": -0.38,
    "updatedAt": "2026-11-12T21:00:00.000Z"
  },
  "meta": {
    "provider": "demo",
    "generatedAt": "2026-11-12T21:00:04.512Z",
    "disclaimer": "Demo dataset: fictional issuers and simulated prices. Not investment advice."
  }
}

Get candles

GET/api/candles/{symbol}

Returns OHLCV candles, oldest first. The 1D range uses 30-minute intervals; every other range uses daily candles. An unknown range returns 400 bad_request.

Parameters

ParameterInTypeRequiredDescription
symbolpathstringRequiredInstrument or index symbol, for example NWRB. Matching ignores case.
rangequerystringOptionalOne of 1D, 5D, 1M, 6M, 1Y, 5Y. Defaults to 1M.

Request

curl -s "http://localhost:3000/api/candles/NWRB?range=1M"

Response sample

200application/json

{
  "data": [
    {
      "time": "2026-11-11",
      "open": 757.4,
      "high": 761.18,
      "low": 743.92,
      "close": 750.32,
      "volume": 3531710
    },
    {
      "time": "2026-11-12",
      "open": 750.03,
      "high": 751.29,
      "low": 731.5,
      "close": 733.8,
      "volume": 3471317
    }
  ],
  "meta": {
    "provider": "demo",
    "generatedAt": "2026-11-12T21:00:04.512Z",
    "disclaimer": "Demo dataset: fictional issuers and simulated prices. Not investment advice.",
    "symbol": "NWRB",
    "range": "1M"
  }
}

The sample is shortened to two candles; 1M returns 22.

Screen instruments

GET/api/screener

Filters, sorts and pages instruments with the same parameters as the screener page. The result carries rows together with total, page and pageSize; values that cannot be parsed are ignored.

Parameters

ParameterInTypeRequiredDescription
sectorquerystringOptionalExact sector name: Technology, Healthcare, Financials, Consumer Discretionary, Consumer Staples, Industrials, Energy, Materials, Utilities, Real Estate.
minMarketCap, maxMarketCapquerynumberOptionalMarket capitalisation bounds in USD.
minPrice, maxPricequerynumberOptionalPrice bounds in USD.
minChangePercent, maxChangePercentquerynumberOptionalDaily change bounds in percentage points: -3 means -3%.
minVolumequerynumberOptionalMinimum daily volume in shares.
profitableOnlyquerystringOptionalSet to 1 to keep only instruments with EPS above 0.
sortquerystringOptionalSort field: marketCap (default), price, changePercent, volume or symbol.
orderquerystringOptionalSort order: desc (default) or asc.
pagequerynumberOptionalPage number, starting at 1.
pageSizequerynumberOptionalRows per page: 20 by default, 100 at most.

Request

curl -s "http://localhost:3000/api/screener?profitableOnly=1&pageSize=5"

Response sample

200application/json

{
  "data": {
    "rows": [
      {
        "symbol": "NWRB",
        "name": "Northwind Robotics",
        "exchange": "NASDAQ",
        "sector": "Technology",
        "industry": "Industrial Automation",
        "price": 733.8,
        "change": -16.52,
        "changePercent": -2.2,
        "previousClose": 750.32,
        "open": 750.03,
        "dayHigh": 751.29,
        "dayLow": 731.5,
        "volume": 3471317,
        "avgVolume": 2962633,
        "marketCap": 982258754565,
        "peRatio": 60.35,
        "eps": 12.16,
        "dividendYield": null,
        "week52High": 963.99,
        "week52Low": 583.89,
        "afterHoursPrice": 731,
        "afterHoursChangePercent": -0.38,
        "updatedAt": "2026-11-12T21:00:00.000Z"
      }
    ],
    "total": 17,
    "page": 1,
    "pageSize": 5
  },
  "meta": {
    "provider": "demo",
    "generatedAt": "2026-11-12T21:00:04.512Z",
    "disclaimer": "Demo dataset: fictional issuers and simulated prices. Not investment advice.",
    "total": 17,
    "page": 1,
    "pageSize": 5
  }
}

The sample is shortened to one row.

Authentication

Demo mode needs no key. When the server sets the API_KEY environment variable, every request must send the same value in the X-API-Key header; anything else receives 401 unauthorized.

curl -s "http://localhost:3000/api/quotes/NWRB" \
  -H "X-API-Key: your-key-here"
Note
The key is read on the server only. The Send request buttons on this page call the API from your browser without a key, so they return 401 while key authentication is enabled.

Error codes

Failed requests return a matching HTTP status and one error object. Branch on code; the message is written for people and may change.

{
  "error": {
    "code": "not_found",
    "message": "A human-readable explanation."
  }
}
HTTP statusCodeWhen it happens
400bad_requestA parameter value is not allowed, for example an unknown candle range.
401unauthorizedAPI_KEY is configured and the request has no matching X-API-Key header.
404not_foundThe symbol does not exist in the dataset.
405method_not_allowedThe API is read-only: /api/quotes answers POST with this code.
429rate_limitedMore than 60 requests in 60 seconds from one IP address to one endpoint. The response includes Retry-After in seconds.

See the same data in the product

The market overview, quote pages and screener read the same provider as these endpoints.