QuantSet Docs Developer console

Endpoints / Returns, risk and historical multiples

Benchmark-relative returns

Subtracts the matching daily benchmark return in percentage points (US listing or index:SPX).

GET/api/v1/benchmark-relative-returns

Sandbox3 credits per 250 bars Try the sample free with mw_demo.

View as MarkdownWhole API as text

Parameters

tickerstringrequired

Catalog selector, such as NVDA, 7203.T, or a canonical ID such as us:NVDA.

benchmarkstringrequired

A US instrument ID, or index:SPX with basis=price for the S&P 500 price index.

limitinteger, 1 to 2,000

Maximum number of rows to return.

Optional parameters (6)
basisprice | total
startstring

First date to include, as an ISO date (YYYY-MM-DD).

endstring

Last date to include, as an ISO date (YYYY-MM-DD).

cursorstring

Opaque continuation. Pass it unchanged with the original filters and snapshot_id.

snapshot_idstring

Pin the request to one immutable snapshot so a read across several pages stays consistent.

formatjson | csv

Return a JSON page or UTF-8 CSV rows.

Response

Response fields (13)

Each row has these fields. Rows arrive in data, next to schema_version, snapshot_id, total_count, next_cursor, provenance.

  • instrument_idstring

    The listing's ID: a market prefix, a colon, then the ticker. For example us:NVDA, global:SHEL.L, crypto:BTCUSDT or index:SPX.

  • datestring

    The trading day or observation date, YYYY-MM-DD.

  • previous_datestring

    The trading day before this one.

  • session_countinteger

    How many trading days the figure covers.

  • return_basisprice | total

    Whether the return counts price only or includes dividends.

  • return_pctnumber

    The return over the period, in percent.

  • statusavailable | no_previous_close | session_gap | split_boundary | adjusted_close_unavailable

    The current state of the record.

  • adjusted_as_ofstring

    The date the adjusted close series was last rebuilt. Adjusted values change after each new dividend or split.

  • benchmark_idstring
  • benchmark_return_pctnumber

    The benchmark's return over the same period, in percent.

  • benchmark_adjusted_as_ofstring

    The date this value was observed.

  • benchmark_statusavailable | no_previous_close | session_gap | split_boundary | adjusted_close_unavailable
  • relative_return_pctnumber

    This listing's return minus the benchmark's, in percentage points.

View response example or schema

Research questions

On which sessions did Apple outperform the S&P 500?

GET https://api.quantset.dev/api/v1/benchmark-relative-returns?ticker=us:AAPL&benchmark=index:SPX&limit=10

Compare return_pct and benchmark_return_pct on matching dates. A move of 2% against 1% is an excess of one percentage point.

How did Apple move relative to another stock rather than an index?

GET https://api.quantset.dev/api/v1/benchmark-relative-returns?ticker=AAPL&benchmark=MSFT&basis=price&start=2024-06-03&end=2024-06-14

Confirm the resolved benchmark_id and compare the two returns on a matched session.

Reading the results

Use the same return_basis for both series. A relative daily return measures one interval and cannot be summed to obtain a compounded strategy return.

Coverage and limits

Both legs need usable observations over the same interval. Check status and benchmark_status whenever relative_return_pct is missing.

Related guides

CSV, spreadsheets and agents

The same rows as a spreadsheet-ready table. Add format=csv to the request.

curl "https://api.quantset.dev/api/v1/benchmark-relative-returns?ticker=us:AAPL&benchmark=index:SPX&limit=10&format=csv" -H "X-API-Key: mw_demo"

Or pull it straight into Google Sheets with one formula. Excel and larger pulls

=IMPORTDATA("https://api.quantset.dev/api/v1/benchmark-relative-returns?ticker=us:AAPL&benchmark=index:SPX&limit=10&format=csv&apikey=mw_demo")

AI agents call this endpoint over HTTP, or read its Markdown version. Connect Claude, ChatGPT, Cursor or your own agent

Errors

StatusCodeWhat to do
400conflicting_credentialsSupply one credential.
401invalid_credentialsSupply a valid API key.
402insufficient_creditsReduce the request ceiling or refill your credits.
403insufficient_accessYour key does not have the required access.
404unknown_instrumentThe requested listing is absent from the catalog.
409snapshot_changedStart the read again with the current snapshot.
413export_too_largeReduce the page size before requesting CSV again.
422invalid_parameter, ambiguous_instrumentCorrect the named parameter and retry.
429rate_limitedWait for Retry-After seconds.
500internal_errorThe request could not be completed.
503temporarily_unavailableRetry safe reads after a short delay.

Questions

Can I try Benchmark-relative returns without signing up?
Yes. Use the sandbox key mw_demo and the sample selectors on this page.
What does Benchmark-relative returns cost?
3 credits for every 250 bars returned. A request that fails costs nothing.
Which plan includes it?
Every account. Free credits, credit packs and subscriptions all read this data.
How do I read more than one page?
When next_cursor is not null, send it back as cursor together with the same snapshot_id, and repeat until it is null.
Can I get it as CSV or in a spreadsheet?
Yes. Add format=csv to the request. In Google Sheets, put that URL inside IMPORTDATA with a data-only key in apikey.
Can an AI agent use this?
Yes. An agent calls it over HTTP like any client. Add .md to this page's address for a version written for agents.
What does null mean in the response?
The value could not be confirmed. It is never a zero, so treat it as missing in your own calculations.