Skip to content

Pagination & filtering

Every list endpoint in the QuantConomy API returns the same envelope: a data array plus a meta block that describes the page. High-churn feeds use cursor-based pagination, reference/catalog endpoints use page metadata, and account/billing logs use offset metadata.

This guide uses GET /api/v1/entries as the worked cursor example. The same data + meta contract applies to every list endpoint (assets, markets, publishers, clusters, SEC datasets, prediction markets, request logs, billing history, and so on).

A successful list response looks like this:

{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Apple Reports Record Q4 Earnings, Beats Expectations",
"excerpt": "Apple Inc. reported quarterly earnings that exceeded analyst expectations...",
"url": "https://reuters.com/technology/apple-q4-earnings-2024",
"urlDomain": "reuters.com",
"author": "John Smith",
"imageUrl": "https://example.com/images/apple-earnings.jpg",
"language": "en",
"sentimentScore": 0.75,
"assetKeys": ["us_stock_AAPL"],
"topicSlugs": ["earnings-reports", "technology"],
"publishedAt": "2024-01-15T14:30:00.000Z",
"createdAt": "2024-01-15T14:35:00.000Z"
}
],
"meta": {
"totalCount": 50000,
"count": 50,
"limit": 50,
"hasMore": true,
"hasPrev": false,
"nextCursor": "MjAyNC0wMS0xNVQxNDozNTowMC4wMDBaXzU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMA==",
"prevCursor": null,
"sort": "createdAt:desc",
"query": null,
"plan": "starter"
}
}
FieldTypeDescription
totalCountnumberTotal number of records matching your filters across all pages.
countnumberNumber of items in this page’s data array.
limitnumberThe effective page size that was applied (may be lower than you requested).
hasMorebooleantrue if there are more (older) results after this page.
hasPrevbooleantrue if there are newer results before this page.
nextCursorstring | nullOpaque cursor for the next (older) page. null when hasMore is false.
prevCursorstring | nullOpaque cursor for the previous (newer) page. null when hasPrev is false.
sortstringThe sort order that was applied.
querystring | nullThe search term that was applied, if any.
planstringYour plan slug (authenticated requests only).

Reference/catalog endpoints expose page, prevPage, and nextPage in meta. Account request logs and billing history expose offset navigation:

FieldTypeDescription
totalCountnumberTotal number of records matching your filters across all pages.
countnumberNumber of items in this page’s data array.
limitnumberThe effective page size that was applied.
offsetnumberNumber of records skipped before this page.
hasMorebooleantrue if another page exists after this one.
prevOffsetnumber | nullOffset for the previous page. null when this is the first page.
nextOffsetnumber | nullOffset for the next page. null when there are no more results.

For offset lists, pass limit and offset in the query string and use meta.nextOffset / meta.prevOffset to drive your UI.

GET /api/v1/entries is sorted newest-first by default (createdAt:desc), so “forward” means moving toward older entries.

  • Omit after and before on the first request to get the newest page.
  • To get the next (older) page, pass the response’s nextCursor back as the after query parameter.
  • To go back to a newer page, pass prevCursor back as the before parameter.
  • Stop when hasMore is false (or nextCursor is null).
Terminal window
curl -s "https://api.quantconomy.com/api/v1/entries?limit=50" \
-H "Authorization: Bearer mtk_your_key_here"

Take meta.nextCursor from the previous response and pass it as after:

Terminal window
curl -s "https://api.quantconomy.com/api/v1/entries?limit=50&after=MjAyNC0wMS0xNVQxNDozNTowMC4wMDBaXzU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMA==" \
-H "Authorization: Bearer mtk_your_key_here"

Loop until hasMore is false, feeding nextCursor back as after each time.

#!/usr/bin/env bash
KEY="mtk_your_key_here"
BASE="https://api.quantconomy.com/api/v1/entries?limit=100&assetKey=us_stock_AAPL"
after=""
while :; do
url="$BASE"
[ -n "$after" ] && url="$BASE&after=$after"
resp=$(curl -s "$url" -H "Authorization: Bearer $KEY")
# ...do something with the page here...
echo "$resp" | jq -r '.data[].title'
has_more=$(echo "$resp" | jq -r '.meta.hasMore')
after=$(echo "$resp" | jq -r '.meta.nextCursor')
[ "$has_more" = "true" ] && [ "$after" != "null" ] || break
done

A key is required on every endpoint. The limit parameter accepts values from 1 to 100, but the effective page size depends on your access level. For your own key the API silently clamps limit down to your plan’s cap — meta.limit always reports the value that was actually applied.

CallerDefault limitMax limitPaginationAdvanced filters
Demo key (mtk_demo)33Not availableNot available
Your own key (any plan)50100Cursor paginationAvailable

The demo key behaves differently: instead of silently clamping, it rejects ?limit greater than 3 with 400 BAD_REQUEST, and it rejects any pagination parameter (cursor, offset, page) with 400 as well — it can only ever return the first 3 results. To raise the cap, paginate, and unlock the advanced filters below, create your own key.

Pass filters as query parameters. They combine with AND semantics and apply to totalCount as well as the returned page.

ParameterDescription
searchFull-text search across the title and content.
limitPage size, 1–100 (clamped to your cap).

These are ignored for demo-key requests:

ParameterDescriptionExample
hasAssetstrue to only return entries that mention a financial asset.hasAssets=true
assetKeyFilter by mentioned asset key.assetKey=us_stock_AAPL
assetIdFilter by asset UUID.assetId=<uuid>
topicSlugFilter by topic slug.topicSlug=interest-rates
topicIdFilter by topic UUID.topicId=<uuid>
publisherSlugFilter by publisher slug.publisherSlug=reuters
publisherIdFilter by publisher UUID.publisherId=<uuid>
languageFilter by detected language code.language=en
countryCodeFilter by publisher country code.countryCode=US
sentimentScoreMinMinimum sentiment score, −1 to 1.sentimentScoreMin=0.2
sentimentScoreMaxMaximum sentiment score, −1 to 1.sentimentScoreMax=0.9
publishedAfterOnly entries published after this ISO 8601 timestamp.publishedAfter=2024-01-01T00:00:00.000Z
publishedBeforeOnly entries published before this ISO 8601 timestamp.publishedBefore=2024-12-31T23:59:59.999Z

Example: bullish Apple-related news from US publishers, published in 2024:

Terminal window
curl -s "https://api.quantconomy.com/api/v1/entries?\
assetKey=us_stock_AAPL&\
countryCode=US&\
sentimentScoreMin=0.3&\
publishedAfter=2024-01-01T00:00:00.000Z&\
limit=100" \
-H "Authorization: Bearer mtk_your_key_here"

Use sortBy to control the order. The default is createdAt:desc.

ValueOrder
createdAt:descRecently added first (default).
createdAt:ascEarliest added first.
publishedAt:descNewest by publication date.
publishedAt:ascOldest by publication date.
Terminal window
curl -s "https://api.quantconomy.com/api/v1/entries?sortBy=publishedAt:desc&limit=50" \
-H "Authorization: Bearer mtk_your_key_here"
  1. Request the first page with no cursor and your desired limit, filters, and sortBy.

  2. Read meta.hasMore and meta.nextCursor from the response.

  3. While hasMore is true, request the next page with after=<nextCursor>.

  4. Stop when hasMore is false.