Skip to content

viceroypenguin/Regular.Polygon

Repository files navigation

Regular.Polygon

Name Status History
GitHub Actions Build GitHub Actions Build History

GitHub release GitHub license GitHub issues GitHub issues-closed

What is Regular.Polygon?

Regular.Polygon is a library for interacting with Polygon's financial information APIs. See their documentation here. It is supported for .net 6.0+.

Where can I get it?

Regular.Polygon is available at nuget.org.

Package Manager PM > Install-Package Regular.Polygon

How it works?

You can make all calls to Polygon's Rest API via the IPolygonApi interface.

Initialize Regular.Polygon

Register Regular.Polygon with the application services:

services.AddPolygonApi(<key>);

where <key> is an API key provided by Polygon.

Use IPolygonApi

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();
	}
}