# Polygon — Pipedream Connect

> Stock Market Data APIs

- API slug: `polygon` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Web & App Development
- Website: https://polygon.io
- This page (HTML): https://pipedream.com/apps/polygon
- Tools: 3 actions · 3 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: polygon`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "polygon",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Get Company Financials:
const result = await mcp.callTool({
  name: "polygon-get-company-financials",
  arguments: {
    stockTicker: "Stock Ticker",
    filingDate: "Filing Date",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Polygon endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2020-06-01/2020-06-17

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkucG9seWdvbi5pby92Mi9hZ2dzL3RpY2tlci9BQVBML3JhbmdlLzEvZGF5LzIwMjAtMDYtMDEvMjAyMC0wNi0xNw?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "polygon-get-company-financials",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    polygon: { authProvisionId: "apn_xxxxxxx" },
    stockTicker: "Stock Ticker",
    filingDate: "Filing Date",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (3)

### `polygon-get-company-financials` — Get Company Financials (Read-only)

Retrieves financial details for a specific company by stock ticker. See the documentation.

Full schema: https://pipedream.com/apps/polygon/actions/get-company-financials.md

### `polygon-get-historical-prices` — Get Historical Prices (Read-only)

Fetches historical price data for a specified stock ticker within a date range. See the documentation

Full schema: https://pipedream.com/apps/polygon/actions/get-historical-prices.md

### `polygon-get-stock-price` — Get Stock Price (Read-only)

Get the open, close and afterhours prices of a stock symbol on a certain date. See the documentation

Full schema: https://pipedream.com/apps/polygon/actions/get-stock-price.md

## Triggers (3)

### `polygon-new-market-news` — New Market News (Polling)

Emit new events when a news article related to the stock market is published.

Full schema: https://pipedream.com/apps/polygon/triggers/new-market-news.md

### `polygon-new-stock-price-summary` — New Stock Price Summary (Polling)

Emit new event when the daily price summary (open, high, low, close) for a specified stock ticker is available.

Full schema: https://pipedream.com/apps/polygon/triggers/new-stock-price-summary.md

### `polygon-new-stock-trade` — New Stock Trade (Polling)

Emit new event when a trade occurs for a specified stock ticker.

Full schema: https://pipedream.com/apps/polygon/triggers/new-stock-trade.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
