Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt

Use this file to discover all available pages before exploring further.

Snapshot Endpoints

The world, frozen at an instant. Market price snapshots and source health metadata — the raw material from which predictions are made and against which they are judged.
  Snapshot data flow:

  ~90 data sources          Data Node               Next.js API
  (crypto, flights,     collects & stores        proxies to browser
   weather, trains...)   in SQLite
       |                     |                        |
       +---> fetch/poll ---> +--- /vision/snapshot -> +---> /api/vision/snapshot
       |     every 5 min     |                        |
       +---> fetch/poll ---> +--- /market/stats ----> +---> /api/vision/snapshot/meta
       |                     |                        |
       +---> fetch/poll ---> +                        |
                                                      |
  Grid view:  GET /api/vision/snapshot                |
              Returns up to 5000 assets               |
              Capped at 200 per source                 |
                                                      |
  Detail:     GET /api/vision/snapshot?source=crypto   |
              Returns up to 10,000 assets for          |
              that single source                       |

Get Market Snapshot

Current price/value data for market assets. The present, quantified.
GET /api/vision/snapshot
source
string
Optional. When provided, returns assets only from that source (up to 10,000). Without it, returns a capped grid view (up to 200 per source, 5,000 total).
# Grid view (all sources, capped)
curl "https://generalmarket.io/api/vision/snapshot"

# Single source detail
curl "https://generalmarket.io/api/vision/snapshot?source=crypto"
Price entry fields:
FieldTypeDescription
sourcestringData source identifier
assetIdstringUnique asset ID within the source
symbolstringShort display label
namestringFull asset name
categorystring|nullSource-specific category
valuenumberCurrent value/price
prevClosenullReserved (not populated)
changePctnumber|nullPercentage change (source-dependent period)
volume24hnumber|null24h volume (crypto/finance only)
marketCapnumber|nullMarket cap (crypto only)
fetchedAtstringISO timestamp of the data fetch
imageUrlnullReserved (not populated)
  Grid view capping:

  Source         Raw assets    Capped to
  ----------    ----------    ---------
  crypto         10,000        200
  defi            6,000        200
  earthquake        150        150  (under cap)
  flights         3,200        200
  weather           500        200
  trains          1,800        200
  ...

  Total grid: up to ~5,000 assets displayed
StatusMeaning
200Snapshot returned
502Data-node upstream unavailable
Snapshots are cached for 30 seconds at the CDN. The totalAssets field always reflects the true count from the data-node, even when the prices array is capped.

Get Source Metadata

Health status, asset counts, and sync timing for all data sources. A diagnostic of the machinery that watches the world.
GET /api/vision/snapshot/meta
curl "https://generalmarket.io/api/vision/snapshot/meta"
Source entry fields:
FieldTypeDescription
sourceIdstringUnique source identifier
displayNamestringDisplay name (currently same as sourceId)
enabledbooleanAlways true for listed sources
syncIntervalSecsnumberSync interval (default 300s)
lastSyncstring|nullISO timestamp of last successful sync
nextSyncnullReserved
estimatedNextUpdatenullReserved
statusstringHealth status (see below)
Status derivation:
  status = "healthy"      if activeAssets > 0 AND newest record < 7 days old
  status = "stale"        if activeAssets > 0 AND newest record > 7 days old
  status = "stale"        if activeAssets > 0 AND no newest record timestamp
  status = "not_started"  if activeAssets == 0
StatusMeaning
200Metadata returned (cached 30s, stale-while-revalidate 60s)
502Data-node upstream unavailable