.NET client for getting stocks, crypto, forex, and indices data from Polygon.io API.
Independently developed, this is not an official library and I am not affiliated with Polygon.Create an account with Polygon. Upon account creation, an API key will be provided for you.
You can manage your API keys on the Dashboard
Install the Polygon.Client NuGet package
Package Manager PM > Install-Package Polygon.Client
Using the API key that was generated for you earlier, you can create a Polygon client in the following ways.
using var client = new PolygonClient("API KEY GOES HERE");services.AddPolygonClient("API KEY GOES HERE");public class SomeClass
{
private readonly IPolygonClient _polygonClient;
public SomeClass(IPolygonClient polygonClient)
{
_polygonClient = polygonClient;
}
public async Task<PolygonAggregateResponse> DoSomething()
{
// This will get all of the 1-minute bars for 2024-04-20
var request = new PolygonAggregatesRequest
{
Ticker = "SPY",
Multuplier = 1
Timespan = "minute",
From = "2024-04-20",
To = "2024-04-20"
};
var response = await _polygonClient.GetAggregatesAsync(request);
return response;
}
}| Market Data Endpoints | Supported? |
|---|---|
| Aggregates | ✔️ |
| Grouped Daily | ✔️ |
| Daily Open/Close | ❌ |
| Previous Close | ❌ |
| Trades | ❌ |
| Last Trade | ❌ |
| Quotes (NBBO) | ❌ |
| Last Quote | ❌ |
| Snapshot - All Tickers | ✔️ |
| Snapshot - Gainers/Losers | ❌ |
| Snapshot - Ticker | ❌ |
| Snapshot - Universal | ❌ |
| Technical Indicators - SMA | ❌ |
| Technical Indicators - EMA | ❌ |
| Technical Indicators - MACD | ❌ |
| Technical Indicators - RSI | ❌ |
| Reference Data Endpoints | Supported? |
|---|---|
| Tickers | ✔️ |
| Ticker Details V3 | ✔️ |
| Ticker Events | ❌ |
| Ticker News | ❌ |
| Ticker Types | ❌ |
| Market Holidays | ❌ |
| Market Status | ❌ |
| Stock Splits V3 | ❌ |
| Dividends V3 | ❌ |
| Stock Financials VX | ❌ |
| Conditions | ❌ |
| Exchanges | ❌ |