Polygon.Client 1.4.0

dotnet add package Polygon.Client --version 1.4.0
NuGet\Install-Package Polygon.Client -Version 1.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Polygon.Client" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Polygon.Client --version 1.4.0
#r "nuget: Polygon.Client, 1.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Polygon.Client as a Cake Addin
#addin nuget:?package=Polygon.Client&version=1.4.0

// Install Polygon.Client as a Cake Tool
#tool nuget:?package=Polygon.Client&version=1.4.0

polygon-dotnet-client

image

.NET client for getting stocks, crypto, forex, and indices data from Polygon.io API.

Prerequisites

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

Setup

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.

Without Dependency Injection
using var client = new PolygonClient("API KEY GOES HERE");
With Dependency Injection

Install the Polygon.Client.Dependency NuGet package.

Package Manager PM > Install-Package Polygon.Client.DependencyInjection

services.AddPolygonClient("API KEY GOES HERE");

Usage

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

Independently developed, this is not an official library and I am not affiliated with Polygon.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Polygon.Client:

Package Downloads
Polygon.Client.DependencyInjection

Creates a .NET client for getting stocks, crypto, forex, and indices data from Polygon.io API via Dependency Injection. Independently developed, this is not an official library and I am not affiliated with Polygon.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 353 3/28/2024
1.3.0 104 3/27/2024
1.3.0-preview.4 51 3/27/2024
1.3.0-preview.3 42 3/27/2024
1.3.0-preview.2 46 3/27/2024
1.3.0-preview.1 45 3/27/2024
1.2.0 68 3/26/2024
1.1.0 73 3/26/2024
1.0.0 72 3/26/2024

Change request/response contracts and constructors to allow dependency injection