What can you do with it?

Access comprehensive financial market data through Polygon.io API, including real-time and historical stock prices, options contracts, market snapshots, and detailed company information for investment analysis and trading applications.

How to use it?

Basic Command Structure

/your-polygon-io-connection [action] [required-parameters] [optional-parameters]

Parameters

Required:

  • action - The operation to perform (get-aggregates, get-options, get-snapshot, get-daily-price, get-ticker-details)

Optional:

  • ticker - Stock ticker symbol (e.g., AAPL, MSFT)
  • from-date - Start date in YYYY-MM-DD format
  • to-date - End date in YYYY-MM-DD format
  • timespan - Time interval (minute, hour, day, week, month, quarter, year)
  • multiplier - Time multiplier (default: 1)

Tools

Get Aggregates Data

Retrieve OHLCV (Open, High, Low, Close, Volume) data for stocks, options, indices, or forex

Parameters:

  • ticker (required) - The stock ticker symbol
  • multiplier (optional) - Time multiplier (default: 1)
  • timespan (optional) - Time interval (default: day)
  • from-date (required) - Start date in YYYY-MM-DD format
  • to-date (required) - End date in YYYY-MM-DD format

Example:

/your-polygon-io-connection
action: get-aggregates
ticker: AAPL
multiplier: 1
timespan: day
from-date: 2023-01-09
to-date: 2023-01-13

Response:

{
  "ticker": "AAPL",
  "queryCount": 5,
  "resultsCount": 5,
  "adjusted": true,
  "results": [
    {
      "v": 76532548,
      "vw": 130.8995,
      "o": 130.465,
      "c": 130.73,
      "h": 132.4899,
      "l": 129.89,
      "t": 1673298000000,
      "n": 657212
    }
  ],
  "status": "OK",
  "count": 5
}

Get Options Contracts

Retrieve detailed options contract data for a specific underlying ticker

Parameters:

  • ticker (required) - The underlying stock ticker symbol
  • expiration-date (required) - Options expiration date in YYYY-MM-DD format

Example:

/your-polygon-io-connection
action: get-options
ticker: AAPL
expiration-date: 2023-07-21

Response:

{
  "results": [
    {
      "ticker": "O:AAPL230721C00150000",
      "underlying_ticker": "AAPL",
      "contract_type": "call",
      "exercise_style": "american",
      "expiration_date": "2023-07-21",
      "strike_price": 150,
      "shares_per_contract": 100,
      "primary_exchange": "OPRA",
      "cfi": "OCASPS"
    }
  ],
  "status": "OK",
  "count": 50
}

Get Stock Snapshot

Get the most recent minute data, day’s aggregate, and last trade for a single ticker

Parameters:

  • ticker (required) - The stock ticker symbol

Example:

/your-polygon-io-connection
action: get-snapshot
ticker: AAPL

Response:

{
  "ticker": {
    "ticker": "AAPL",
    "todaysChange": 1.25,
    "todaysChangePerc": 0.67,
    "updated": 1673463600000,
    "day": {
      "o": 132.45,
      "h": 133.51,
      "l": 131.88,
      "c": 133.49,
      "v": 79829739,
      "vw": 132.6474
    },
    "lastTrade": {
      "p": 133.49,
      "s": 200,
      "t": 1673463600321
    },
    "min": {
      "c": 133.49,
      "h": 133.51,
      "l": 133.41,
      "o": 133.41,
      "v": 143532
    },
    "prevDay": {
      "o": 130.46,
      "h": 132.49,
      "l": 129.89,
      "c": 130.73,
      "v": 76532548
    }
  }
}

Get Daily Open/Close Price

Retrieve the open, close, high, and low prices of a stock symbol on a certain date

Parameters:

  • ticker (required) - The stock ticker symbol
  • date (required) - The date in YYYY-MM-DD format

Example:

/your-polygon-io-connection
action: get-daily-price
ticker: AAPL
date: 2023-01-09

Response:

{
  "status": "OK",
  "from": "2023-01-09",
  "symbol": "AAPL",
  "open": 130.465,
  "high": 132.4899,
  "low": 129.89,
  "close": 130.73,
  "volume": 76532548,
  "afterHours": 130.42,
  "preMarket": 132.71
}

Get Ticker Details

Get detailed information about a stock ticker including company information

Parameters:

  • ticker (required) - The stock ticker symbol

Example:

/your-polygon-io-connection
action: get-ticker-details
ticker: AAPL

Response:

{
  "results": {
    "ticker": "AAPL",
    "name": "Apple Inc.",
    "market": "stocks",
    "locale": "us",
    "primary_exchange": "XNAS",
    "type": "CS",
    "active": true,
    "currency_name": "usd",
    "market_cap": 2107160401920,
    "phone_number": "(408) 996-1010",
    "address": {
      "address1": "One Apple Park Way",
      "city": "Cupertino",
      "state": "CA",
      "postal_code": "95014"
    },
    "description": "Apple Inc. designs, manufactures, and markets smartphones...",
    "homepage_url": "https://www.apple.com",
    "total_employees": 164000,
    "list_date": "1980-12-12"
  },
  "status": "OK"
}

Notes

Date format must be YYYY-MM-DD with hyphens. Supported resolutions are minute, hour, day, week, month, quarter, and year. Timestamps in responses are Unix time in milliseconds. The API provides both real-time and historical market data with comprehensive metadata.