Name | Status | History |
---|---|---|
GitHub Actions |
Regular.Polygon is a library for interacting with Polygon's financial information APIs. See their documentation here. It is supported for .net 6.0+.
Regular.Polygon is available at nuget.org.
Package Manager PM > Install-Package Regular.Polygon
You can make all calls to Polygon's Rest API via the IPolygonApi
interface.
Register Regular.Polygon with the application services:
services.AddPolygonApi(<key>);
where <key>
is an API key provided by Polygon.
Receive an instance of the IPolygonApi
interface from the application services
and make API calls via this instance.
public sealed class StockService
{
private readonly IPolygonApi _polygonApi;
public StockService(IPolygonApi polygonApi)
{
_polygonApi = polygonApi;
}
public async Task DoSomething()
{
var marketStatus = await _polygonApi.GetMarketStatus();
}
}