RedPlanetHQ/core

New Integration: Polygon

開放

#521 建立於 2026年2月24日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (184 個分叉)auto 404
enhancementgood first issueintegrationnew-featurenew-integration

倉庫指標

星標
 (1,930 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Description

Add Polygon.io integration to sync financial market data including stock prices, trades, quotes, and market events into CORE.

Reference Implementations

Existing Integrations (use as templates)

  • integrations/github-analytics/ - Data/analytics-oriented integration
  • integrations/linear/ - Project management integration
  • integrations/hubspot/ - API key-based integration reference

Required Files Structure

integrations/polygon/
├── src/
│   ├── index.ts          # Main entry, API spec
│   ├── schedule.ts       # Sync logic
│   ├── utils.ts          # Polygon.io API utilities
│   ├── account-create.ts # API key setup
│   └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md

Polygon.io API Integration

OAuth Setup

  • Use API Key authentication
  • API key passed as query parameter apiKey or via Authorization: Bearer header
  • Free and paid tiers available with different rate limits
  • Base URL: https://api.polygon.io

Key Endpoints

  • GET /v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to} - Aggregate bars (OHLCV)
  • GET /v2/aggs/grouped/locale/us/market/stocks/{date} - Grouped daily bars
  • GET /v3/trades/{ticker} - Get trades for a ticker
  • GET /v3/quotes/{ticker} - Get quotes (NBBO) for a ticker
  • GET /v2/snapshot/locale/us/markets/stocks/tickers - All ticker snapshots
  • GET /v2/snapshot/locale/us/markets/stocks/tickers/{ticker} - Single ticker snapshot
  • GET /v3/reference/tickers - List/search tickers
  • GET /v3/reference/tickers/{ticker} - Get ticker details
  • GET /v1/marketstatus/now - Current market status
  • GET /v2/reference/news - Market news articles

Events to Track

  1. Price Data - OHLCV aggregate bars (daily, hourly, minute)
  2. Trades - Individual trade executions
  3. Quotes - NBBO quotes and bid/ask data
  4. Snapshots - Current market snapshots for tickers
  5. News - Market news and press releases
  6. Market Status - Market open/close events

Implementation Tasks

  • Set up basic integration structure following integrations/github/src/index.ts pattern
  • Implement API Key authentication in account-create.ts
  • Create API utilities in utils.ts with Polygon.io REST API client
  • Implement sync logic in schedule.ts for price data, snapshots, news
  • Convert Polygon.io market data to CORE activity format
  • Add error handling and rate limiting
  • Create integration documentation
  • Add to integrations/README.md

Technical Notes

  • REST API with JSON responses
  • Also supports WebSocket streaming for real-time data
  • Free tier includes end-of-day data; paid tiers include real-time and historical tick data
  • Covers Stocks, Options, Indices, Forex, and Crypto markets
  • Rate limits vary by subscription plan
  • Aggregate endpoints are most efficient for historical data sync
  • Snapshot endpoints provide current market state
  • Company has rebranded to "Massive" but all polygon.io URLs continue to work
  • OpenAPI/Swagger specs available
  • Sandbox environment available for testing

Resources

Labels

enhancement, integration, new-feature

貢獻者指南