enhancementgood first issueintegrationnew-featurenew-integration
Repository metrics
- Stars
- (1,930 stars)
- PR merge metrics
- (PR metrics pending)
Description
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 integrationintegrations/linear/- Project management integrationintegrations/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
apiKeyor viaAuthorization: Bearerheader - 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 barsGET /v3/trades/{ticker}- Get trades for a tickerGET /v3/quotes/{ticker}- Get quotes (NBBO) for a tickerGET /v2/snapshot/locale/us/markets/stocks/tickers- All ticker snapshotsGET /v2/snapshot/locale/us/markets/stocks/tickers/{ticker}- Single ticker snapshotGET /v3/reference/tickers- List/search tickersGET /v3/reference/tickers/{ticker}- Get ticker detailsGET /v1/marketstatus/now- Current market statusGET /v2/reference/news- Market news articles
Events to Track
- Price Data - OHLCV aggregate bars (daily, hourly, minute)
- Trades - Individual trade executions
- Quotes - NBBO quotes and bid/ask data
- Snapshots - Current market snapshots for tickers
- News - Market news and press releases
- Market Status - Market open/close events
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement API Key authentication in
account-create.ts - Create API utilities in
utils.tswith Polygon.io REST API client - Implement sync logic in
schedule.tsfor 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
- Polygon.io API Documentation
- Polygon.io REST API Quickstart
- Polygon.io GitHub
- Polygon.io API Postman Collection
Labels
enhancement, integration, new-feature