{"slug":"perp-gap-api-perpgap-workers-dev-history-760245","title":"Use when an agent needs to backtest or chart how a stock perp's premium/discount","host":"perp-gap-api.perpgap.workers.dev","method":"GET","resource":"https://perp-gap-api.perpgap.workers.dev/history","category":"market","description":"Use when an agent needs to backtest or chart how a stock perp's premium/discount and funding evolved, including weekends and holidays when the stock is shut. One ticker: trade.xyz perp mark/oracle vs stock and xStock, basis, funding, OI, Aster/Lighter/OKX cross-venue gaps; 30-minute snapshots plus ~","price_listed":0.02,"price_asked":0.02,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":441,"reported_calls_30d":4,"reported_payers_30d":1,"networks":["eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"method":"GET","queryParams":{"interval":"1h","ticker":"NVDA"},"type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"method":{"enum":["GET"],"type":"string"},"queryParams":{"additionalProperties":false,"properties":{"from":{"description":"Optional ISO 8601 start (default: 7 days before 'to').","format":"date-time","type":"string"},"interval":{"default":"1h","description":"Optional bucket size.","enum":["30m","1h","4h","1d"],"type":"string"},"ticker":{"description":"Stock ticker, case-insensitive (free list: GET /catalog).","examples":["NVDA"],"pattern":"^[A-Za-z0-9.]{1,12}$","type":"string"},"to":{"description":"Optional ISO 8601 end (default: now).","format":"date-time","type":"string"}},"required":["ticker"],"type":"object"},"type":{"const":"http","type":"string"}},"required":["type","method"],"type":"object"},"output":{"properties":{"example":{"description":"Error responses are JSON {error: string, hint?: string}. 400 bad params (never charged); 402 payment required; 404 ticker/market not listed (checked before settlement, never charged); 502 upstream error. Full field docs: /openapi.json.","properties":{"count":{"type":"number"},"disclaimer":{"type":"string"},"from":{"type":"string"},"interval":{"type":"string"},"rows":{"type":"array"},"sources":{"type":"object"},"ticker":{"type":"string"},"to":{"type":"string"}},"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-10-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.02,"price_match":true,"latency_ms":441,"error":null}],"description_full":"Use when an agent needs to backtest or chart how a stock perp's premium/discount and funding evolved, including weekends and holidays when the stock is shut. One ticker: trade.xyz perp mark/oracle vs stock and xStock, basis, funding, OI, Aster/Lighter/OKX cross-venue gaps; 30-minute snapshots plus ~60d backfill, up to 90 days per call. Bad params return 400/404 before any charge. Errors: 400, 402, 404, 502. Data, not advice.","last_updated":"2026-10-22T21:53:08.621Z","schemes":["exact"]}